Skip to main content

Interface: RagRetrievalOptions

Defined in: packages/agentos/src/rag/IRetrievalAugmentor.ts:141

Options controlling retrieval behavior.

Properties

includeEmbeddings?

optional includeEmbeddings: boolean

Defined in: packages/agentos/src/rag/IRetrievalAugmentor.ts:188

Include chunk embeddings in the response.


metadataFilter?

optional metadataFilter: MetadataFilter

Defined in: packages/agentos/src/rag/IRetrievalAugmentor.ts:149

Metadata filter applied at the vector-store layer.


queryEmbeddingModelId?

optional queryEmbeddingModelId: string

Defined in: packages/agentos/src/rag/IRetrievalAugmentor.ts:190

Query embedding model override.


rerankerConfig?

optional rerankerConfig: object

Defined in: packages/agentos/src/rag/IRetrievalAugmentor.ts:171

Cross-encoder reranking configuration.

When enabled, retrieved chunks are re-scored using a cross-encoder model for improved relevance ranking. Disabled by default due to added latency.

Recommended use cases:

  • Background analysis tasks (accuracy over speed)
  • Batch processing (no user waiting)
  • Knowledge-intensive tasks (reduces hallucination)

NOT recommended for real-time chat (latency sensitive).

enabled?

optional enabled: boolean

Enable cross-encoder reranking. Default: false

maxDocuments?

optional maxDocuments: number

Max documents to send to reranker (limits cost/latency). Default: 100

modelId?

optional modelId: string

Reranker model ID (e.g., 'rerank-english-v3.0', 'cross-encoder/ms-marco-MiniLM-L-6-v2')

params?

optional params: Record<string, any>

Provider-specific parameters

providerId?

optional providerId: string

Provider ID ('cohere', 'local')

timeoutMs?

optional timeoutMs: number

Request timeout in ms. Default: 30000

topN?

optional topN: number

Number of top results to return after reranking


strategy?

optional strategy: "hybrid" | "similarity" | "mmr"

Defined in: packages/agentos/src/rag/IRetrievalAugmentor.ts:151

Retrieval strategy (defaults to similarity search).


strategyParams?

optional strategyParams: object

Defined in: packages/agentos/src/rag/IRetrievalAugmentor.ts:153

Strategy-specific parameters (MMR lambda, hybrid alpha, etc.).

custom?

optional custom: Record<string, any>

hybridAlpha?

optional hybridAlpha: number

mmrLambda?

optional mmrLambda: number


targetDataSourceIds?

optional targetDataSourceIds: string[]

Defined in: packages/agentos/src/rag/IRetrievalAugmentor.ts:145

Set of explicit data sources to query.


targetMemoryCategories?

optional targetMemoryCategories: RagMemoryCategory[]

Defined in: packages/agentos/src/rag/IRetrievalAugmentor.ts:147

Memory categories to consult (maps to data sources via config).


tokenBudgetForContext?

optional tokenBudgetForContext: number

Defined in: packages/agentos/src/rag/IRetrievalAugmentor.ts:192

Advisory token/character budget for final context construction.


topK?

optional topK: number

Defined in: packages/agentos/src/rag/IRetrievalAugmentor.ts:143

Maximum number of chunks per query.


userId?

optional userId: string

Defined in: packages/agentos/src/rag/IRetrievalAugmentor.ts:194

Caller identity for logging/billing.