Skip to main content
Khora exposes ~150 tunable parameters. Most ship with defaults tuned against the retrieval_basic benchmark. Adjust them only when profiling identifies a specific problem. This page documents the parameters most likely to need adjustment, with the rationale for each.

Threshold defaults

Khora’s retrieval defaults follow one principle: retrieve broadly, then rank precisely. An earlier version of Khora filtered aggressively at every stage and produced a 25.5% zero-result rate on the retrieval_basic benchmark. Descriptive queries such as “wrought-iron tower built for the 1889 World’s Fair” returned nothing because the 0.5 cosine floor discarded a 0.35-similarity Eiffel Tower chunk before ranking saw it. The current defaults lower thresholds to a noise floor (0.0 for chunk similarity and 0.05 for entity similarity), let RRF fusion and reranking determine relevance, and add a zero-result fallback that re-queries with min_similarity=0.0. Before raising a threshold, confirm the underlying issue is filtering rather than something upstream such as ranking or reranker quality.

Where parameters are set

Per-call > engine constructor > config > env. See Configuration for the complete env-var reference.

Tuning by symptom

VectorCypher

VectorCypher’s tunables live on VectorCypherConfig and are passed in as engine_kwargs={"vectorcypher_config": VectorCypherConfig(...)}. The defaults below were chosen against the retrieval_basic benchmark. The “When to adjust” column lists the symptom or workload that warrants overriding them.

Extraction cost

Fusion and routing

Graph traversal

Temporal

BM25 and reranking

Reranking model selection

The default is BAAI/bge-reranker-v2-m3, a 568M-parameter multilingual (XLM-RoBERTa-large) reranker. It discriminates markedly better than the older MS MARCO MiniLM cross-encoders. On GraphRAG-Bench it lifted medium-difficulty accuracy from about 0.796 to 0.82. The cost is weight: roughly 2.3 GB to download, and it wants a GPU (the reranker auto-detects the device). It emits relevance logits rather than 0–1 scores, which the default reranking_blend_weight=0.7 handles fine. On CPU-only or latency-sensitive deployments, switch to a small MS MARCO MiniLM cross-encoder. The L-N suffix is the transformer layer count (sentence-transformers pretrained models): more layers is more accurate but slower. The reranker is cached by (model, include_date_prefix), so switching is a one-line change:
One precedence edge case. A vectorcypher_config field you set explicitly beats query.* / KHORA_QUERY_RERANKING_*, which in turn beats the VectorCypherConfig defaults. But a vectorcypher_config field set to its own dataclass default can’t be told apart from “never set”, so query.* wins for that field. Configure those through query.* instead of restating the default.

Per-call parameters

Beyond VectorCypherConfig, these arguments are passed per call to recall() / remember() / remember_batch():

Shared parameters

These live on KhoraConfig (env-var prefix KHORA_*) and affect every engine. Most have stable defaults. The rationale below covers the ones with real workload-dependent tradeoffs.

Retrieval thresholds

Fusion weights

MMR diversity and reranking

HyDE (query expansion)

Pipeline (extraction)

Conversation chunking

Storage (pgvector)

Storage (LanceDB)

Neo4j (VectorCypher only)

LLM