mini-swe-agent: The Minimal AI Agent for Solving GitHub Issues

Summary
mini-swe-agent is a remarkably simple yet powerful AI agent, comprising just 100 lines of Python code. It's designed to solve GitHub issues and assist in command-line tasks, achieving over 74% on the SWE-bench verified benchmark. This project offers a radically simple approach to AI-driven software engineering, avoiding complex configurations and large monorepos.
Repository Info
Tags
Click on any tag to explore related repositories
Introduction
mini-swe-agent emerges from the creators of SWE-bench and SWE-agent, offering a streamlined, highly performant AI agent. This project re-evaluates the necessity of complex tools and interfaces for AI agents, demonstrating that a minimal, 100-line Python agent can achieve impressive results, scoring over 74% on the SWE-bench verified benchmark. It's built by the Princeton & Stanford team and is widely adopted by leading tech companies and universities.
Designed for simplicity and effectiveness, mini-swe-agent focuses on leveraging the language model's capabilities through a basic bash interface. It supports various deployment environments, including local, Docker, and Singularity, and is compatible with numerous models via litellm and other endpoints. Its core philosophy emphasizes a linear history and independent action execution, making it robust, scalable, and easy to debug.
Installation
Getting started with mini-swe-agent is straightforward. Choose the option that best suits your needs:
Option 1: Try out the CLI (package installed in anonymous virtual environment)
pip install uv && uvx mini-swe-agent
# or
pip install pipx && pipx ensurepath && pipx run mini-swe-agent
Option 2: Install CLI & Python bindings in current environment
pip install mini-swe-agent
mini # run the CLI
Option 3: Install from source (developer setup)
git clone https://github.com/SWE-agent/mini-swe-agent.git
cd mini-swe-agent && pip install -e .
mini # run the CLI
Examples
mini-swe-agent provides several ways to interact with its capabilities:
- CLI (
mini): Engage with the agent directly from your command line for interactive problem-solving. - Batch inference: Run the agent against multiple issues or tasks for automated evaluation and processing.
- Trajectory browser: Visualize and debug the agent's decision-making process and actions.
- Python bindings: Integrate
mini-swe-agentinto your Python projects for custom automation and development.
agent = DefaultAgent(
LitellmModel(model_name=...),
LocalEnvironment(),
)
agent.run("Write a sudoku game")
Why Use mini-swe-agent?
mini-swe-agent stands out for its radical simplicity and powerful performance, making it an excellent choice for developers and researchers alike:
- Minimalist Design: With only about 100 lines of Python for the agent class, it's easy to understand, debug, and extend. It avoids complex tools, relying solely on bash, which simplifies sandboxing and deployment.
- High Performance: Despite its simplicity, it achieves over 74% on the SWE-bench verified benchmark, demonstrating that advanced capabilities don't require bloated architectures.
- Flexible Deployment: Supports local environments, Docker/Podman, Singularity/Apptainer, and more, offering versatility for various setups.
- Model Compatibility: Works with all models via
litellm,openrouter,portkey, and other endpoints, providing broad compatibility. - Stable and Scalable: Actions are executed independently using
subprocess.run, ensuring stability and effortless scaling, unlike stateful shell sessions. - Linear History: Every step appends to the message history, making trajectories transparent and ideal for debugging and fine-tuning language models.
Consider mini-swe-agent as your default choice if you need a quick, stable command-line tool, a simple control flow agent, or a system for faster benchmark evaluations and fine-tuning without overfitting to a specific agent scaffold.
Links
- GitHub Repository: https://github.com/SWE-agent/mini-swe-agent
- Official Documentation: https://mini-swe-agent.com/latest/
- Quick Start Guide: https://mini-swe-agent.com/latest/quickstart/
- SWE-bench: https://swebench.com
- SWE-agent: https://swe-agent.com