RAG Indexing Operations¶
Source support¶
Drive-only ingestion in v0.0.4 supports:
- plain text (
text/plain) - PDF (
application/pdf) - Google Docs (
application/vnd.google-apps.document) - Google Slides (
application/vnd.google-apps.presentation)
Slides include both:
- slide body text
- speaker notes
Index lifecycle¶
buildIndexfor first-time creation.syncIndexto update changed/new/removed files.inspectIndexfor metadata checks.searchandanswerfor retrieval and grounded responses.
Recommended operational defaults¶
chunkSizeChars=1200chunkOverlapChars=200minChunkChars=200maxChunks <= 2000skipParseFailures=truefor robust batch indexing- enable request/runtime cache for repeated hot queries:
cache.enabled=truecache.backend='storage_json'for shared multi-user workloadscache.embeddingTtlSecandcache.searchTtlSectuned to your update cadence
Failure handling¶
- Source extraction failures throw typed errors.
- With
skipParseFailures=true, build/sync continue and return warnings. - Unsupported embedding providers throw
AstRagEmbeddingCapabilityError. - Missing grounding in
answerreturnsstatus=insufficient_context.
Index storage model¶
Indexes are Drive JSON files with:
- schema and timestamps
- embedding provider/model metadata
- source fingerprints/checksums
- chunk text + vectors
Use RAG_DEFAULT_INDEX_FOLDER_ID to control default destination.
Query cache controls¶
search(...) and answer(...) support optional cache overrides:
cache.enabledcache.backendcache.namespacecache.ttlSec,cache.searchTtlSec,cache.answerTtlSec,cache.embeddingTtlSeccache.storageUri(required forstorage_json)cache.lockTimeoutMscache.lockScope(script|user|none)cache.updateStatsOnGet
Script property defaults are also supported:
RAG_CACHE_ENABLEDRAG_CACHE_BACKENDRAG_CACHE_NAMESPACERAG_CACHE_TTL_SECRAG_CACHE_SEARCH_TTL_SECRAG_CACHE_ANSWER_TTL_SECRAG_CACHE_EMBEDDING_TTL_SECRAG_CACHE_STORAGE_URIRAG_CACHE_LOCK_TIMEOUT_MSRAG_CACHE_LOCK_SCOPERAG_CACHE_UPDATE_STATS_ON_GET
Retrieval latency budgets¶
Use retrieval budgets to bound search/answer latency under load:
search.options.maxRetrievalMsanswer.options.maxRetrievalMs
Timeout behavior for answer(...) is controlled by:
answer.options.onRetrievalTimeout='error'(default): throw typed retrieval timeout error.answer.options.onRetrievalTimeout='insufficient_context': return deterministic abstain response.answer.options.onRetrievalTimeout='fallback': run fallback answer behavior when configured.
Integrity checklist¶
- Keep one index bound to one embedding provider+model.
- Rebuild or sync after source updates.
- Avoid mixing unrelated corpora in the same index file.
- Validate output citations in consumer UI before rendering as authoritative.
CI/runtime checks¶
Before release candidate validation: