defaults < config.json < .env < env < code
(precedence), and can be set from code with
the config API or
cognee-cli config.
Search
Thesearch and search.hybrid engine sections tune the standard retrievers;
cognee hands them to SearchBuilder::with_tuning (Settings::search_tuning).
Three
Settings fields tune the search orchestrator itself, lowered by the same
Settings::search_tuning:
Triplet retriever hub cap
Measured on a synthetic 100k corpus, a cap of 100 keeps a Jaccard similarity of
0.93–0.96 against the uncapped result set, with a worst query at 0.67; a cap of
200 keeps 0.92–0.93 but has a worst query at 0.18. The latency it buys is small
on a uniform corpus and large on real hub-heavy text (one
graph_completion
search went from 332 ms to 76 ms). Treat it as a knob for a corpus with known
hubs, measured on that corpus, not as a default.
The cap bounds single-query graph search at depth 1 only: it has no effect with
a neighborhood_depth above 1. Batch graph search
(brute_force_triplet_search_batch, several queries at once) loads the whole
graph, as Python’s batch mode does, and the cap does not apply to it — see
Operations: search.
PgGraphAdapter applies the cap in SQL; every other backend gets the same
semantics from GraphDBTrait::get_neighborhood_scoped’s client-side default.
Hybrid retriever knobs
TheHYBRID_COMPLETION search type (SearchType::HybridCompletion) accepts a
set of per-request tuning knobs. These are library / orchestrator-only —
typed Option<...> fields on
SearchParams,
populated from the snake_case JSON keys inside
SearchRequest.retriever_specific_config. They have no env binding.
When a knob is unset the retriever falls back through
retriever_specific_config.<knob> → SearchRequest.top_k capped at 10 → the
HybridRetriever::new constructor default (an explicit per-lane knob is never
capped):
TEMPORAL.
TEMPORAL search (SearchType::Temporal) runs the same hybrid
fetch, so it reads the same keys, with two differences. The fallback above
applies to the HYBRID_COMPLETION lanes only: TEMPORAL’s top_k is
SearchRequest.top_k (5 when unset) and is not capped at 10. And its chunk
and entity lanes are sized by candidate_top_k and its fact lane by top_k,
overriding chunks_top_k / entities_top_k / facts_top_k (text_summaries_top_k
is ignored too: the summary lane follows the chunk lane); the time-window
rerank then cuts the candidates back to top_k. A top_k of 0 or a
candidate_top_k below top_k is rejected with InvalidInput, as in Python.
Chunk-lane fusion. chunk_lane_fusion chooses how the DocumentChunk_text
lane and the TextSummary_text lane are combined:
"relative_score"(default) normalises each lane’s similarities to[0, 1]against that lane’s own candidates and adds them, the summary lane weighted bysummary_lane_weight(the chunk lane always weighs1.0)."reciprocal_rank"is Python’srank_chunk_summary_pairsverbatim — RRF over ranks only.
chunk_lane_fusion = "reciprocal_rank" to get the
Python ranking back.
Reserved (Phase 2, inert). These keys are parsed and stored but have no
effect yet: use_truth_weight (default false), include_global_context_index
(default false) and global_context_index_top_k (default 3). The
HTTP-facing degradation notes live with the server’s search-router docs, which
are not part of the cognee-rs repository.
Search history
When on, each search (CLI
search / recall, bindings) records one query row
and one result row after retrieval. They carry the searched dataset’s
dataset_id when exactly one dataset was searched. Turn it off with
cognee-cli config set log_search_history false or
COGNEE_LOG_SEARCH_HISTORY=false. This setting is the only switch: the
per-request SearchRequest::save_interaction (saveInteraction /
save_interaction in the bindings) is removed, and CLI search, which used
to skip history, now records it too.