Skip to main content

Interface: RagRetrievalOptions

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

Options controlling retrieval behavior.

Properties

hyde?

optional hyde: object

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

HyDE (Hypothetical Document Embedding) configuration. When enabled, generates a hypothetical answer before embedding for improved retrieval quality. Adds one LLM call per retrieval.

enabled?

optional enabled: boolean

Enable HyDE for this retrieval. Default: false.

hypothesis?

optional hypothesis: string

Pre-generated hypothesis (skip LLM call if provided).

initialThreshold?

optional initialThreshold: number

Initial similarity threshold for adaptive thresholding. Default: 0.7.

minThreshold?

optional minThreshold: number

Minimum threshold to step down to. Default: 0.3.


includeAudit?

optional includeAudit: boolean

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

When true, generates a RAGAuditTrail with per-operation transparency.


includeEmbeddings?

optional includeEmbeddings: boolean

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

Include chunk embeddings in the response.


metadataFilter?

optional metadataFilter: MetadataFilter

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

Metadata filter applied at the vector-store layer.


queryEmbeddingModelId?

optional queryEmbeddingModelId: string

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

Query embedding model override.


rerankerConfig?

optional rerankerConfig: object

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

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-v3.5', '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:152

Retrieval strategy (defaults to similarity search).


strategyParams?

optional strategyParams: object

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

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:146

Set of explicit data sources to query.


targetMemoryCategories?

optional targetMemoryCategories: RagMemoryCategory[]

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

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


tokenBudgetForContext?

optional tokenBudgetForContext: number

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

Advisory token/character budget for final context construction.


topK?

optional topK: number

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

Maximum number of chunks per query.


userId?

optional userId: string

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

Caller identity for logging/billing.