Skip to main content

RetrievalConfig

Defined in the Retrieval Config module.
AI Agent Unified configuration for Agent retrieval behavior. This is the SINGLE configuration surface that replaces:
  • knowledge_config
  • rag_config
Attributes: enabled: Whether retrieval is enabled (default: True if knowledge provided) policy: When to retrieve (auto, always, never) top_k: Number of chunks to retrieve min_score: Minimum relevance score threshold (0.0-1.0) max_context_tokens: Maximum tokens for retrieved context rerank: Whether to rerank results for better relevance hybrid: Whether to use hybrid retrieval (dense + keyword) citations: Whether to include source citations citations_mode: How to include citations (append, inline, hidden)

Vector store configuration

vector_store_provider: Vector store provider (chroma, mongodb, etc.) vector_store_config: Provider-specific configuration collection_name: Collection/index name persist_path: Path for persistent storage

Embedding configuration

embedder_provider: Embedding provider embedder_model: Embedding model name

Advanced options

auto_keywords: Keywords that trigger retrieval in auto mode auto_min_length: Minimum query length for auto retrieval context_template: Template for formatting retrieved context system_separation: Whether to use system prompt separation for safety

Properties

bool
No description available.
RetrievalPolicy
No description available.
int
No description available.
float
No description available.
int
No description available.
bool
No description available.
bool
No description available.
bool
No description available.
CitationsMode
No description available.
Optional[int]
No description available.
int
No description available.
bool
No description available.
str
No description available.
bool
No description available.
float
No description available.
Optional[list]
No description available.
Optional[list]
No description available.
Optional[str]
No description available.
str
No description available.
Dict[str, Any]
No description available.
Optional[str]
No description available.
str
No description available.
Optional[str]
No description available.
Optional[str]
No description available.
Optional
No description available.
frozenset
No description available.
int
No description available.
str
No description available.
bool
No description available.

Methods

get_token_budget()

Get TokenBudget instance for this config.

get_strategy()

Get retrieval strategy based on config and corpus stats.

to_knowledge_config()

Convert to Knowledge-compatible config.

to_rag_config()

Convert to RAG pipeline config.

should_retrieve()

Determine if retrieval should be performed for a query.
  • from_dict: Create from dictionary.
  • to_dict: Convert to dictionary.

Source

View on GitHub

praisonaiagents/rag/retrieval_config.py at line 28

Configuration Overview

Agent Config

Evaluation Concept

LLM as Judge

Evaluation Loop