# Repository Briefing: Optim-Agent/optim-agent
> Source: https://repoforai.com/repo/Optim-Agent/optim-agent (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/Optim-Agent/optim-agent
- **Official Docs / Website**: https://optim-agent.github.io/optim-agent/
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: B (58/100 · Maintenance 12/35 · Adoption 12/25 · Releases 14/20 · License 20/20)
- **Latest Release**: 0.1.1 (2026-07-14) — https://github.com/Optim-Agent/optim-agent/releases
- **Review Snapshot**: 2026-12-04
- **Deployment / Stack Signals**: MCP, CLI
- **Momentum**: 798 ★ total (+0 24h / +0 7d) · 44 forks
- **Topics**: `agent-skills`, `ai-agents`, `automl`, `claude-code`, `codex-cli`, `developer-tools`, `hyperparameter-optimization`, `machine-learning`, `optimization`, `skill`
- **When to Use**: Best for: Teams with an existing evaluator, meaningful parameter descriptions, and a tight trial budget for training, serving, or simulation experiments. Skip if: 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.

## Overview
```text
### Architecture & 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.
```

## Key Capabilities
```text
- Execution boundary: AgentSampler proposes parameter values; the harness validates them and falls back to sampling on invalid replies.
- Search space: Define-by-run trials support continuous, integer, and categorical parameters; the quickstart demonstrates log-scaled integer sampling.
- Backend controls: Claude Code, Codex, and OpenCode are CLI backends; reasoning effort, visible trial history, explicit reasoning, and qualitative notes are configurable.
- Study records: JSON or SQLite persistence retains configurations, scores, states, context, and optional rationale for inspection and resumption.
- Benchmark design: The image-classification study compares contextual and no-context GPT-5.5 runs against random sampling and Optuna TPE over 10 trials and five seeds.
- Distribution: PyPI package, Claude Code plugin, and Codex skill; release 0.1.1 added ready-to-install integrations and prompt controls.
```

## Quick Start / Clone
```bash
pip install -e ".[examples]"
pytest                     # runs tests/test_optim_agent.py
```
