Skip to main content
Version: latest

agrag.retrieval.settings.RetrievalSettings

Bases: BaseSettings

Configuration for retrieval methods and fusion.

Attributes:

  • entity_labels (list[str]) – The graph labels native entity search runs against, one vector index each. These are the schema's entity labels. Only read when the caller passes no label filter.
  • node_distance_seed_top_k (int) – How many of the highest-ranked entity hits seed the node-distance reranker. Candidates are ordered by graph distance to those seeds.
  • entity_top_k (int) – Results requested per entity search call.
  • resolved_entity_top_k (int) – Results requested per resolved-entity search call.
  • chunk_top_k (int) – Results requested per chunk search call.
  • traversal_depth (int) – Maximum BFS hops from a seed entity.
  • traversal_limit (int) – Maximum nodes a BFS expansion can return.
  • rrf_k (int) – The RRF constant controlling how much rank position matters.
  • reranker_min_score (float | None) – Results scoring below this after rerank are dropped. None disables the threshold.
  • cross_encoder_model (str) – The sentence-transformers CrossEncoder model used for cross_encoder reranking. Env: RETRIEVAL_CROSS_ENCODER_MODEL.
  • community_top_k (int) – Results requested per community search call when the caller passes no explicit limit. It plays the same role entity_top_k and chunk_top_k play for their retrievers. It is distinct from Recipe.community_top_k (enrichment budget and reserved slice size). Same name, different class, different job.

Env prefix: RETRIEVAL_.

chunk_top_k​

chunk_top_k: int = 10

community_top_k​

community_top_k: int = 5

cross_encoder_model​

cross_encoder_model: str = 'cross-encoder/ms-marco-MiniLM-L-6-v2'

entity_labels​

entity_labels: list[str] = []

entity_top_k​

entity_top_k: int = 10

model_config​

model_config = SettingsConfigDict(env_prefix='RETRIEVAL_', env_file='.env', extra='ignore', hide_input_in_errors=True)

node_distance_seed_top_k​

node_distance_seed_top_k: int = 3

reranker_min_score​

reranker_min_score: float | None = None

resolved_entity_top_k​

resolved_entity_top_k: int = 10

rrf_k​

rrf_k: int = 60

traversal_depth​

traversal_depth: int = 2

traversal_limit​

traversal_limit: int = 50