Skip to content

Document Indexing 🟑 BETA

Indexing turns files in a bot's Drive folders and crawled websites into scoped vector records that rag-mode retrieval can read.

Developer guide map

Automatic triggers

The Drive monitor sees changes to .gbkb and re-indexes affected content; git-owned .gbdialog and .gbot prefixes are materialised from the bot's repository and are not edited in Drive. A website is indexed when a script registers it with USE WEBSITE and the crawler runs.

Processing pipeline

Stage What happens
Discover New or changed files in the collection folder.
Extract Text is read from the document by the indexer's file handler.
Embed KbEmbeddingGenerator produces a vector from bot configuration.
Store botqdrant writes the vector with content and source metadata into the scoped collection.
Recheck Retrieval validates payload stamp and current ACL before returning text.

Documents are indexed as whole-file records: there is no chunking step and no overlap. If no embedding endpoint is configured the generator uses a local hash fallback; a failed generation degrades to keyword scroll β€” see Retrieval and RAG.

Configuration

Key Read by Effect
embedding-url EmbeddingConfig::from_bot_config Endpoint used for embeddings; empty means hash fallback.
embedding-model same Model identifier passed to the endpoint.
embedding-dimensions same Overrides the detected vector size.
embedding-batch-size, embedding-timeout, embedding-concurrent same Request shaping for the embedding service.
rag-mode kb_context_ops How indexed records are queried.

Structure-aware indexing of saved Docs documents

Saved Docs documents have a separate, process-local citation index. The search endpoint returns identity fields (document_id, file, version, source_ref, section, score) for documents the caller may read, never document text. In chat, a matching question can add citation-only lines to the system message for an authenticated user; anonymous turns get none. See Knowledge Base.

Stable IDs and ACL metadata

The citation index keys records by document identity and section reference, and applies the caller's read permission before returning an identity line. This is separate from the vector collections above.

Limits

  • No chunking: long documents are one record and lose precision.
  • No embedding URL means a hash vector, not semantic retrieval.
  • Website content is only as fresh as the crawler that registered it.
  • The Docs citation index returns identity, never document text.

Troubleshooting

Symptom Check
Files not searchable Confirm the folder is in .gbkb and the collection is active in the session.
Weak matches Check embedding-url and rag-mode.
No citations The Docs index is process-local and returns identity only to authorised callers.

See Also