Skip to content

search_space

diapason.learning.optimize.search_space

Search space builder and default search space for configuration optimization.

build_search_space(config)

Build a SearchSpace from a TOML-style config dict.

Expected format::

{
    "optimize": {
        "search": [
            {
                "name": "agent.type",
                "type": "categorical",
                "values": ["orchestrator", "native_react"],
                "description": "Agent architecture",
            },
            {
                "name": "intelligence.temperature",
                "type": "continuous",
                "low": 0.0,
                "high": 1.0,
                "description": "Generation temperature",
            },
        ],
        "fixed": {"engine": "ollama", "model": "qwen3:8b"},
        "constraints": {
            "rules": ["SimpleAgent should only have max_turns = 1"],
        },
    }
}