rag
Knowledge bases you host yourself: ingest documents, then retrieve relevant passages at query time (hybrid BM25 + semantic). Reach for this when you want control over the vector backend and chunking.
To give an agent a knowledge base on the hosted platform, open the Knowledge
manager in Studio — upload files or add a website, attach it to your agent, and it
searches automatically through the built-in knowledge.search tool. No YAML, no
vector store to run, nothing to grant. This page documents the self-hosted
rag module — reach for it only when you run your own daemon and vector backend
(Qdrant/pgvector/Elasticsearch/…).
catalog.describe_module rag returns the real tools and every parameter,
from the live registry - the authority for what actually runs.
Tools, at a glance: create_knowledge_base, list_knowledge_bases,
knowledge_base_stats, delete_knowledge_base, ingest, ingest_file,
ingest_directory, query, reindex, index_stats, migrate_embeddings.
Gotchas
queryretrieves; it does not write the answer. The agent's own model writes the answer from whatqueryreturned.- Database/web sources are configured on the module and driven by the indexer as
background indexing - that's config, not agent tool calls.
auto_index.scheduleis a cron string handled by the indexer directly.
A working app
Compiles as-is. The brain uses a Digitorn gateway model (the default - no API key of your own needed); see the note below to use your own key or a local model instead.
app:
app_id: kb_assistant
name: Knowledge Assistant
runtime:
entry_agent: main
agents:
- id: main
system_prompt: |
Answer from the knowledge bases: query for relevant passages, then write
the answer from what you retrieved. Ingest new documents when asked.
brain:
provider: openai
backend: openai_compat
model: mimo-v2.5-free # a model the Digitorn gateway serves
config:
api_key: placeholder # ignored in gateway mode
tools:
modules:
rag: {}
capabilities:
grant:
- module: rag
tools: [query, create_knowledge_base, ingest, ingest_file, list_knowledge_bases]
Related
- Longer YAML / concepts: RAG