Knowledge Bases and RAG: Ground Your AI Answers in Your Own Documents
What is a knowledge base?
A knowledge base is a collection of your own documents — PDFs, markdown files, text notes, web pages — that ToRun indexes and searches at query time. When you attach a knowledge base to a chat or workflow, the system retrieves the most relevant passages from your documents and passes them as context to the model before it generates a reply. This technique is called Retrieval-Augmented Generation (RAG).
The practical result: the model answers from your content, not from its training data alone. It can cite the exact passage it drew from, and you can verify every claim against your source files.
How to add documents
- Open Knowledge Bases in the sidebar and select New knowledge base.
- Give it a name and optional description, then choose a visibility setting (personal, team, or organization).
- Click Add documents and upload one or more files. Supported formats include PDF, plain text, and markdown. You can also paste a URL to ingest a web page.
- Wait for indexing to complete — the status indicator turns green when chunks are ready for retrieval.
- In any chat, open the context panel and toggle the knowledge base on. The retrieval pipeline activates automatically for that session.
You can attach multiple knowledge bases to the same chat and reorder their priority.
How retrieval grounds answers
At each turn, ToRun embeds your query, runs a similarity search across indexed chunks, and injects the top-scoring passages into the model's context window. The model sees both your question and the retrieved evidence before generating a reply, which keeps answers factual and traceable.
RAG vs long-term memory — when to use each
| RAG (knowledge base) | Long-term memory | |
|---|---|---|
| Best for | Reference documents, specs, internal wikis, PDFs | Durable personal facts: preferences, names, recurring context |
| Scope | Files you explicitly upload | Facts the model learns from your conversations |
| User control | You manage the document set | You can view and delete individual memory entries |
| Grounding | Cites source passages | Recalled as background context |
Use a knowledge base when the answer must come from a specific document. Use memory when you want the model to remember who you are across sessions without you repeating yourself.