Basics·5 min read

Give Your Bot Knowledge

Upload documents into a knowledge base so your bots can answer from your own content, not just their training data.

Give Your Bot Knowledge

Out of the box, a bot reasons from the model's general knowledge. To make it answer from your content — product docs, FAQs, policies — attach a knowledge base.

1. Create a knowledge base

Go to Knowledge in the dashboard and click New Base. Give it a name that reflects its contents (e.g. "Product FAQ").

2. Upload your documents

Add PDFs, text files, Markdown, CSVs, or JSON docs. Bothive extracts readable text, splits it into searchable chunks, and indexes it so a bot can retrieve the most relevant passages at answer time (retrieval-augmented generation).

For PDFs:

  1. Open Knowledge.
  2. Pick a base.
  3. Click Upload PDF/docs.
  4. Choose a searchable PDF under 15MB.
  5. Wait for the success toast showing how many chunks were indexed.

If upload says the PDF has no readable text, it is probably scanned/image-only. Export it with OCR first, then upload again.

3. Attach it to a bot

In the bot's settings, select the knowledge base. Now when a user asks something covered by your docs, the bot pulls the relevant context and answers from it — with far fewer hallucinations.

4. Search it from HiveLang

You can also search a knowledge base explicitly as a capability:

hivelang
bot Support { instructions { Answer product questions using our documentation. } capabilities { knowledge.search } on user.message { call knowledge.search with { query: input } as context call ai.generate with { prompt: "Answer using this context: " + context + "\n\nQuestion: " + input } as answer respond with answer } }

Tips

  • Keep bases focused — one topic per base retrieves more accurately than one giant catch-all.
  • Re-upload when your docs change; the index reflects what you've uploaded.

Next steps

Quick tip

Use the test pane to iterate quickly. Every change you make is live — no need to save first.

Important

API keys are shown only once. Store them securely and never commit them to version control.

Best practice

Test your bot with edge cases before deployment. Try empty inputs, long messages, and special characters.

Pro tip

Chain multiple specialized bots in a workflow for better results than one general-purpose bot.

Give Your Bot Knowledge