Skip to content

Config

Auto-generated from source docstrings (mkdocstrings). The complete public contract is agentmaker.__all__ plus each subpackage __all__.

Config aggregation plus serialization primitives.

AgentmakerConfig: the "set defaults in one place / tune in one file" entry point that bundles the per-subsystem frozen sub-configs together.

It is a pure holder: frozen, with no module-level instance, and components do not depend on it (each component depends on its own narrow sub-config, which the from_config classmethods (Memory/RagRetriever/IngestionPipeline) slice out and hand down). to_dict/from_dict use a hand-written recursion (not dataclasses.asdict, whose internal deepcopy raises TypeError on MappingProxyType).

Where config lives (a two-layer rule): - Subsystem knobs (top_k / chunk / weights / halflife / keep_recent / rrf_k / mq / summary_top_k ...) go into the sub-configs here. - Single-instance settings (CLITool(timeout=) / OpenAIEmbedder(dimensions=) / Tracer(max_value_len=) ...) go into that component's own constructor argument, not here.

AgentmakerConfig dataclass

The developer's "set defaults in one place / tune in one file" aggregation entry: a pure holder of the narrow sub-configs.

No logic, no module-level instance, and components do not depend on it (each component depends on its own narrow sub-config, sliced out and handed down by that class's from_config). Usage: an app/script instantiates one at the assembly root and passes it explicitly to each component (or wires it in one line via each class's from_config); to persist to a file, use to_dict / from_dict.

to_dict()

Export to a plain dict (json.dumps-able / persistable to a file).

from_dict(d) classmethod

Restore from a dict (read from JSON / YAML / env-assembled): fail loud on unknown top-level keys, fall back to defaults on missing keys.

for_window(context_window, *, use_ratio=0.5, fallback_window=None)

Derive a new instance with context.max_tokens set from the model's window (solving the AgentmakerConfig() out-of-the-box problem).

Keeps the other context fields (mmr_lambda / source_ratios ...) and only sets max_tokens.

validate()

Independent range validation of each sub-config (pure read-only assertions, no business logic: this is the god-object boundary).

Note: cross-subsystem checks that need _PREFIX_TOKENS (such as "per-source context quota vs chunk-render accounting") stay in ContextBuilder (only there is the render accounting available); AgentmakerConfig does not duplicate them, to avoid accounting drift.