Knowledge Bases & RAG
Last updated 8 Nov 2026
Overview
A knowledge base lets you give the AI your own documents to ground its answers. ToRun ingests documents, splits them into chunks, indexes them, and at query time retrieves the most relevant chunks using a hybrid of vector (semantic) and lexical (keyword) search — this is Retrieval-Augmented Generation (RAG).
How it's structured
- Knowledge base — the index of a project's files; it belongs to you.
- Knowledge document — each file or source you add to a base.
- Knowledge chunk — the indexed pieces a document is split into; retrieval happens at the chunk level.
Knowledge bases are user-scoped — your base and its contents belong to you.
Creating and populating a base
- Open a project, or create one — the files you add to it make up its knowledge base.
- Add documents. ToRun ingests each document, splits it into chunks, and builds embeddings for semantic search.
- Once indexed, the base is available to ground answers.
How retrieval works
When you ask a question against a base, ToRun runs:
- Vector search — embeds your query and finds semantically similar chunks.
- Lexical search — matches keywords directly, catching exact terms vector search can miss.
- The combined top results are passed to the model as grounding context, and the answer is generated from them.
This hybrid approach catches both "means the same thing" and "contains this exact term" matches.
Cost
Embedding documents during ingestion and answering grounded questions are AI calls, so each produces a BillingRecord with a pricing snapshot. Ingestion cost is roughly proportional to document volume; query cost is per question.
Tips
- Add clean, well-structured documents — garbled text indexes poorly and retrieves poorly.
- Keep a base focused on one topic or project; a single giant mixed base retrieves noisier results.
- Re-add or refresh documents when the underlying material changes — retrieval only knows what's indexed.
Watch how it works
Projects, your own files and memory: an AI assistant that knows your work
A project groups related chats, files and memory, and every new chat in it follows the project's system prompt. Add PDFs, documents or text files under Knowledge and the assistant searches them in that project's chats. Memory works across all your chats: mention something worth keeping and you don't have to say it again. Everything it remembers is on your memory page, where you can edit it or make it forget for good.