Skip to main content
This guide shows you how to look inside 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

Code in Action

What Just Happened

Each recall() 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

A handful of sentences about Alice and Bob gives hybrid retrieval something to find — entities, a relationship between them, and the passages they come from.

Step 2: Passage-Focused Context

With 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

With 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

With 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

All three sections are present in 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 passes only_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:
A typical result:
(The exact wording depends on the LLM provider you use.) This works the same way with any of the 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