Optim-Agent/optim-agent
A Python framework that uses coding-agent CLIs to tune bounded parameters
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
optim-agent is a Python framework for black-box optimization. A caller defines a scalar objective and declares parameter bounds through trial.suggest_* calls. AgentSampler uses parameter descriptions, study context, and measured trial history to ask a coding-agent CLI for the next configuration. The harness checks values against the declared space and falls back to sampling if the response is invalid. The evaluator's measured result, not the agent's explanation, determines the best trial.
create_study configures direction, sampler, optional persistence, and optional summarization; study.optimize runs the evaluations. JSON and SQLite store trial configurations, outcomes, states, context, and optional rationale. The package uses setuptools.build_meta with setuptools>=77.0.3 as its build backend. The concrete integration path is through CLI backends and host plugins or skills; an MCP deployment should not be assumed without a documented server entrypoint or transport.
Key Capabilities & Differentiators
The sampler supports bounded continuous, integer, and categorical parameters, with study-wide and per-parameter context. Claude Code, Codex, and OpenCode are supported backends. effort is forwarded to the backend CLI, while the history window and optional rationale and notes shape the prompt and response. history=None exposes all completed or pruned trials rather than limiting the history window.
In the 10-trial, five-seed classification benchmark, contextual GPT-5.5 reached a cumulative best-so-far error of 5.668 on MNIST versus 7.166 for Optuna TPE, and 220.994 on CIFAR-10 versus 278.920 for random sampling. Without context, GPT-5.5 scored 8.910 and 281.466, respectively. The benchmark notes that the contextual comparison also includes earlier access to agent-guided proposals, so the gap does not isolate the effect of parameter descriptions alone.
Trade-offs & Limitations
Choose this over an ordinary sampler when parameters have useful semantics and each evaluation is expensive enough to justify an additional agent call. Optuna TPE and random search are better starting points when evaluations are cheap, the parameter names convey little, or you want to avoid model latency, cost, and version drift. A fair comparison should report both best objective at a fixed trial budget and wall time and model spend; fewer evaluations are not necessarily cheaper overall.
Treat the benchmarks as adoption signals, not a universal ranking. In the credit benchmark, contextual GPT-5.5 and TPE both show test log loss of 0.422 at the reported precision; the retained configuration was selected using both validation and test loss, so this is not an untouched estimate of generalization. Bounds checking protects the declared search space, not the host or confidential inputs. Review CLI permissions and data handling separately from the package's MIT license.
Hardware & Deployment Guide
The package requires Python 3.9 or newer. Install it with python -m pip install optim-agent, or use the GitHub source install to test a newer revision. For AgentSampler, put one authenticated claude, codex, or opencode executable on PATH. The objective runs in your Python environment; whether agent calls leave your infrastructure depends on the CLI and model configuration. Local study storage does not make the full workflow offline. Size CPU, GPU, and memory for the evaluator, any local inference, and the planned concurrency.
Release 0.1.1 added ready-to-install Claude Code and Codex integrations, sampler prompt controls, and explicit development and optional vision dependency groups. The supplied source manifest lists 0.2.0 and classifies the project as alpha, while the listed release is 0.1.1. Pin a tested package version or source revision, and check that the matching integration exposes the options you intend to use.
Teams with an existing evaluator, meaningful parameter descriptions, and a tight trial budget for training, serving, or simulation experiments.
You need deterministic offline proposals, your evaluations are too cheap to justify a model call, or your security policy rules out the available agent backends.
Quick Start & Installation
pip install -e ".[examples]" pytest # runs tests/test_optim_agent.py
Comparison vs. Top Agents & Frameworks Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| optim-agent ★ | 798 | — | Python | MIT | A Python framework that uses coding-agent CLIs to tune bounded parameters |
| agno | 43.4k | +66 | Python | Apache-2.0 | Python framework and runtime for durable agent services over REST and MCP |
| browser-use | 122.7k | +477 | Python | MIT | Python REPL and CDP for adaptive browser automation |
| langgraph | 45.8k | +293 | Python | MIT | Python graph orchestration for stateful, resumable agents and workflows |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/Optim-Agent/optim-agent.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about optim-agent
How do I integrate optim-agent with an existing evaluator?
trial.suggest_float or trial.suggest_int, and return a measured score. Set the optimization direction in create_study and call study.optimize. Add study or per-parameter context when it explains a real constraint or interaction. AgentSampler proposes configurations; your evaluator still runs the workload and determines the score.What hardware do I need, and where does runtime overhead come from?
Can I use this commercially and keep experiment data on my own infrastructure?
When should I choose this over Optuna TPE or random search?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy