SearchType.HYBRID_COMPLETION — the default search type — before it turns into a final answer, and how to shape which parts of that context are included.
Before You Start
- Be familiar with the main concepts of Recall.
- Complete the Understand Recall with RAG Completion guide to see the shared
recall()parameters this guide builds on (query_text,datasets,only_context) in action.
Code in Action
What Just Happened
Eachrecall() call below sets only_context=True plus one or two retriever_specific_config limits to 0, which removes that section from the context entirely. A non-zero limit controls how many items of that section are included — a larger number produces a more detailed (and larger) context.
Step 1: Ingest the Example Dataset
Step 2: Passage-Focused Context
entities_top_k and facts_top_k at 0, context_passage_focused contains only matched passages — the raw text chunks that matched the query, combining lexical (keyword) and semantic (embedding) search, with no graph entities or derived facts.
Use this when you want to see raw supporting text without any graph-derived summarization — for example, to quote source text verbatim, or to debug retrieval quality without graph-derived noise in the way.
Step 3: Entity-Focused Context
chunks_top_k and facts_top_k at 0, context_entity_focused contains only matched entities — nodes from the graph (like Alice, Bob, Cognee) — and the edges connected to each one (capped by max_edges_per_entity), rendered as short sentences such as Alice contributed to documentation.
Use this when you care about which entities are connected and how, more than the exact wording of the source text.
Step 4: Fact-Focused Context
chunks_top_k and entities_top_k at 0, context_fact_focused contains only the compact, fact-style statements derived from graph edges — a more compact form of the same relationships shown in Step 3, with no raw passages and no entity listings.
Use this when you want the smallest possible context — for example to get a quick relationship summary without the full passage text or entity listings.
Step 5: Balanced Context
context_balanced, each capped at a small limit. This mirrors the default behavior, just with tighter limits — useful when you want a compact context that still draws on passages, entities, and facts together.
Generating the Final Answer
Every call above passesonly_context=True, so recall() stops after assembling the context and never reaches the completion step. Drop only_context=True — the retrieval, ranking, and context assembly stay exactly the same — and recall() sends that same context to the LLM to generate a real answer instead:
retriever_specific_config shapes from Steps 2-5 above — passage-focused, entity-focused, fact-focused, or balanced — since only_context only controls whether the completion step runs, not what gets retrieved.
Recall
Understand recall()‘s full parameter surface and auto-routing behavior
SearchType
See every search type and its retriever_specific_config options