How ajamshid2000/agent-smith works
Agent Smith solves MBPP function-writing tasks and SWE-bench repository issues through a Thought→Code→Observation agent loop, returning a function or patch with execution metrics. The SWE-bench runner prepares a Docker task environment and exposes repository operations through MCP; MBPP uses benchmark tools for function-level execution. The separate Moulinette CLI dumps tasks and validates solutions for both benchmarks, including metrics checks. Edges reflect the README and shown/indexed source references; unsampled wiring is omitted or marked unverified.
Main entry points: loop.py Reasoning loop · agent_swebench.py SWE-bench runner · __main__.py Evaluation CLI · agent_mbpp.py MBPP runner
Components 19
Agent runtime
- Reasoning loop
agent_smith/loop.py - Response extraction
agent_smith/extract.py - LLM provider
agent_smith/providers.py - Agent data models
agent_smith/models.py
Sandbox and tools
- Code sandbox
agent_smith/sandbox.py - MCP client
agent_smith/mcp.py - MBPP tools
mcp_tools_mbpp.py - SWE-bench tools
mcp_tools_swebench.py - Task Docker container
Benchmark runners
- MBPP runner
agent_mbpp.py - SWE-bench runner
agent_swebench.py
Moulinette evaluation
- Evaluation CLI
moulinette/moulinette/__main__.py - Evaluation models
moulinette/moulinette/models.py - Solution contract
moulinette/models_public.py - MBPP evaluator
moulinette/moulinette/mbpp/interact.py - SWE-bench evaluator
moulinette/moulinette/swebench/interact.py
Other components
- Benchmark user
- Compatible model API
- Evaluation containers
Connections 21
- Benchmark user → MBPP runner: starts task
README.md - Benchmark user → SWE-bench runner: starts task
README.md - MBPP runner → Reasoning loop: runs loop
agent_mbpp.py - SWE-bench runner → Reasoning loop: runs loop
agent_swebench.py - Reasoning loop → LLM provider: requests completions
agent_smith/loop.py - LLM provider → Compatible model API: sends requests
agent_smith/providers.py - Reasoning loop → Code sandbox: executes code
agent_smith/loop.py - Reasoning loop → Response extraction: uses extraction
agent_smith/loop.py - Reasoning loop → Agent data models: records metrics
agent_smith/loop.py - Code sandbox → MCP client: proxies tool calls
agent_smith/sandbox.py - SWE-bench runner → MCP client: discovers tools
agent_swebench.py - MBPP runner → MBPP tools: configures tools
- SWE-bench runner → SWE-bench tools: routes operations
README.md - SWE-bench runner → Task Docker container: starts task image
agent_swebench.py - SWE-bench tools → Task Docker container: operates in container
README.md - Benchmark user → Evaluation CLI: requests evaluation
README.md - Evaluation CLI → Evaluation models: loads models
moulinette/moulinette/__main__.py - Evaluation models → Solution contract: extends contract
moulinette/moulinette/models.py - Evaluation CLI → MBPP evaluator: validates MBPP
moulinette/moulinette/__main__.py - Evaluation CLI → SWE-bench evaluator: validates patches
moulinette/moulinette/__main__.py - SWE-bench evaluator → Evaluation containers: evaluates patch