Configuration Reference
On this page
All configuration lives in config.py as a tree of @dataclass definitions rooted at ContextEngineConfig. Every sub-config has a sensible default, so ContextEngineConfig() works with zero arguments.
from zerda.context import ContextEngineConfig
config = ContextEngineConfig()
config.retriever.top_k = 30
config.composer.template = "structured"
config.guard.check_relevance = True
ContextEngineConfig (root)
It also exposes three backward-compatible properties that proxy into composer:
max_context_length(get/set) →composer.max_context_lengthseparator(get only) →composer.separatortemplate(get only) →composer.template
ContextConfig is a plain alias: ContextConfig = ContextEngineConfig. They are the same class.
QueryAnalyzerConfig
RetrieverConfig
[!WARNING]
metadata_filtersvs. per-callfiltersRetrieverConfig.metadata_filtersexists as a field but is never referenced byretriever.py,engine.py, orpipeline.py. The filters that actually take effect are the ones passed as themetadata_filtersargument toContextEngine.run(), which flow intoHybridRetriever.retrieve(filters=...). Don't rely on the config field.
FilterConfig
RankingConfig
[!NOTE] Weights don't have to sum to 1.0 The implementation never normalizes these weights — it computes a plain weighted sum. If you change weights without checking the total, the resulting
composite_scorescale will shift accordingly. This mostly matters if you compare scores across different configurations.
ComposerConfig
GuardConfig
CacheConfig
LengthCounter
Not a dataclass — a type alias: LengthCounter = Callable[[str], int]. Used wherever the codebase needs to measure "length" abstractly (characters by default via char_counter, or tokens via make_token_counter).