Skip to main content

agrag.retrieval.recipes.Recipe

Bases: BaseModel

A named configuration of what SearchEngine runs for a query.

Attributes:

  • methods (list[str]) – Which retrieval methods to fan out to concurrently, by name.
  • bfs (bool) – Whether to run a BFS expansion after methods complete, seeded from their entity results. BFS needs seed ids methods produce, so it cannot run concurrently with them.
  • bfs_depth (int | None) – Traversal depth when bfs is true. None uses RetrievalSettings.traversal_depth.
  • reranker (Literal['cross_encoder', 'node_distance'] | None) – The optional Rerank pass to run after Fusion. None skips reranking.
  • min_score (float | None) – Results the reranker scores below this are dropped. None uses RetrievalSettings.reranker_min_score, so a caller can tighten the floor for one call without touching the configured default.
  • limit (int) – The maximum number of results SearchEngine returns.
  • community_expand (bool) – Whether to fetch and fuse in overlapping communities' reports after BFS.
  • community_top_k (int) – How many communities community_context returns, and (when reranker is cross_encoder) how many are reserved a slot after rerank.

bfs​

bfs: bool = False

bfs_depth​

bfs_depth: int | None = None

community_expand​

community_expand: bool = False

community_top_k​

community_top_k: int = 3

limit​

limit: int = 10

methods​

methods: list[str]

min_score​

min_score: float | None = None

reranker​

reranker: Literal['cross_encoder', 'node_distance'] | None = None