Skip to content

[config] Named presets — fast/balanced/accurate profiles #133

@dgenio

Description

@dgenio

Context

Split from #45. Adds named presets for quick configuration without manual tuning.

Proposal

Add ProfileConfig.from_preset(name) classmethod supporting "fast", "balanced", and "accurate" presets:

Preset beam_width max_depth top_k budget.answer
fast 1 4 5 3000
balanced 2 8 10 6000
accurate 4 12 20 8000
profile = ProfileConfig.from_preset("fast")
router = Router(graph, items=catalog.all(), **profile.routing_kwargs())

Acceptance Criteria

  • ProfileConfig dataclass in config.py bundling: budget, policy, scoring, routing (a new RoutingConfig dataclass)
  • RoutingConfig dataclass: beam_width, max_depth, top_k, confidence_gap, max_children
  • ProfileConfig.from_preset(name) supporting "fast", "balanced", "accurate"
  • "balanced" preset produces identical behavior to current defaults
  • to_dict() / from_dict() on both dataclasses
  • Backward-compatible: all existing constructors unchanged
  • Tests for all 3 presets and roundtrip serialization

File Paths

  • src/contextweaver/config.py (edit)
  • tests/test_config.py (edit)

Parent Issue

Part of #45 (ProfileConfig).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/contextContext engine: manager, pipeline, firewallarea/routingRouting engine: catalog, graph, router, cardscomplexity/averageStandard effort, moderate familiarity neededenhancementNew feature or requestmilestone/v0.4v0.4 Observability & evaluationpriority/highHigh priority — closes a critical gap

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions