Skip to main content

RAG Module

The rag module indexes sources into knowledge bases and retrieves for agents. This page matches internal/modules/rag in the Go daemon. Older docs that listed fourteen agent tools (including multi_query, sql_query, ingest_database, clear_cache, list_models) were wrong for this build.

Authoritative tool table: reference/modules/rag.

Agent tools (11)

create_knowledge_base, delete_knowledge_base, list_knowledge_bases, knowledge_base_stats, index_stats, ingest, ingest_file, ingest_directory, query, reindex, migrate_embeddings.

There is no separate vector tool module in digitornd.

Zero-config

yaml
tools:
modules:
rag: {}

Configuration (high level)

Config is bound from YAML under tools.modules.rag (and related module config). Important groups from Config in Go:

AreaNotes
embedding_modelString shortcut or {id, dimensions, pooling}
backendVector store settings (Qdrant / pgvector / Elasticsearch appear in code)
pipeline / chunking / citations / cache / aclRetrieval and safety knobs
sourcesFile, DB, web, kafka-style source entries for the indexer
auto_indexon_start, schedule (cron string for indexer triggers, not cron_native)
default_knowledge_baseDefault KB name
max_knowledge_bases / max_documentsCaps

Source entries can carry their own triggers (type, every, cron). Exact field validation lives in the module and its tests; do not invent agent tools for Text2SQL or multi-query if they are not in the RegisterTool list above.

Example

yaml
tools:
modules:
rag:
config:
embedding_model: minilm-l12
default_knowledge_base: docs
auto_index:
on_start: true
schedule: "" # optional cron for indexer; not cron_native
sources:
- name: handbook
type: file
path: "{{workdir}}/docs"
extensions: [.md, .txt]
recursive: true
capabilities:
grant:
- module: rag