IndexDocumentsOptions
Interface: IndexDocumentsOptions
Defined in: src/lib/rag/indexDocuments.ts:44
Properties
embedderId?
readonlyoptionalembedderId?:string
Defined in: src/lib/rag/indexDocuments.ts:71
Stable id of the embedder. Stored on each entry so a future
embedder swap doesn't silently mix similarity scores. Default:
'default-embedder' — pass an explicit id when you may rotate
embedders.
identity?
readonlyoptionalidentity?:MemoryIdentity
Defined in: src/lib/rag/indexDocuments.ts:63
Identity scope to write under. Default: a single shared
{ conversationId: '_global' } namespace, suitable for app-wide
corpora.
Multi-tenant footgun: the read side (agent.run({ identity }))
queries within whichever identity is passed at request time.
If you index here under _global but query under
{ tenant: 'acme' }, you'll get ZERO results — silently. Either:
- Index every document under each tenant's identity (duplicated storage, but isolated), or
- Index under
_globalAND query under_global(shared corpus across tenants — fine for product docs, NOT for tenant-private data), or - Use a vector store adapter that supports multi-namespace reads at query time (Pinecone, Qdrant — outside this helper's scope).
maxConcurrency?
readonlyoptionalmaxConcurrency?:number
Defined in: src/lib/rag/indexDocuments.ts:99
Max number of concurrent embed calls when the embedder doesn't
implement embedBatch. Default 8. Without this cap, a 10K-doc
corpus would fire 10K parallel embed calls and trigger rate limits.
Ignored when embedBatch is available (the embedder controls
its own batching).
signal?
readonlyoptionalsignal?:AbortSignal
Defined in: src/lib/rag/indexDocuments.ts:90
Optional abort signal — embedders making network calls thread this through to abort batch indexing on shutdown / timeout.
tier?
readonlyoptionaltier?:"hot"|"warm"|"cold"
Defined in: src/lib/rag/indexDocuments.ts:78
Optional tier tag to attach to indexed entries ('hot' /
'warm' / 'cold'). Useful when read-side defineRAG should
filter to a subset of the corpus.
ttlMs?
readonlyoptionalttlMs?:number
Defined in: src/lib/rag/indexDocuments.ts:84
Optional TTL in milliseconds from indexing time. Useful for compliance retention windows (e.g., re-index quarterly).
