Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.praison.ai/llms.txt

Use this file to discover all available pages before exploring further.

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

enabled
bool
No description available.
policy
RetrievalPolicy
No description available.
top_k
int
No description available.
min_score
float
No description available.
max_context_tokens
int
No description available.
rerank
bool
No description available.
hybrid
bool
No description available.
citations
bool
No description available.
citations_mode
CitationsMode
No description available.
model_context_window
Optional
No description available.
reserved_response_tokens
int
No description available.
dynamic_budget
bool
No description available.
strategy
str
No description available.
compress
bool
No description available.
compression_ratio
float
No description available.
include_glob
Optional
No description available.
exclude_glob
Optional
No description available.
path_filter
Optional
No description available.
vector_store_provider
str
No description available.
vector_store_config
Dict
No description available.
collection_name
Optional
No description available.
persist_path
str
No description available.
embedder_provider
Optional
No description available.
embedder_model
Optional
No description available.
auto_keywords
frozenset
No description available.
auto_min_length
int
No description available.
context_template
str
No description available.
system_separation
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