https://github.com/SWE-agent/mini-swe-agent
The 100 line AI agent that solves GitHub issues or helps you in your command line. Radically simple, no huge configs, no giant monorepo—but scores 68% on SWE-bench verified!
https://github.com/SWE-agent/mini-swe-agent
agent agentic-ai agentic-ai-cli ai ai-agent textual
Last synced: 6 months ago
JSON representation
The 100 line AI agent that solves GitHub issues or helps you in your command line. Radically simple, no huge configs, no giant monorepo—but scores 68% on SWE-bench verified!
- Host: GitHub
- URL: https://github.com/SWE-agent/mini-swe-agent
- Owner: SWE-agent
- License: mit
- Created: 2025-06-28T20:18:15.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-16T15:53:57.000Z (6 months ago)
- Last Synced: 2025-09-16T16:39:14.165Z (6 months ago)
- Topics: agent, agentic-ai, agentic-ai-cli, ai, ai-agent, textual
- Language: Python
- Homepage: https://mini-swe-agent.com
- Size: 7.56 MB
- Stars: 1,647
- Watchers: 4
- Forks: 159
- Open Issues: 33
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing.md
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: docs/SECURITY.md
Awesome Lists containing this project
- awesome-repositories - SWE-agent/mini-swe-agent - The 100 line AI agent that solves GitHub issues or helps you in your command line. Radically simple, no huge configs, no giant monorepo—but scores >74% on SWE-bench verified! (Python)
- StarryDivineSky - SWE-agent/mini-swe-agent - agent/mini-swe-agent是一个轻量级AI代理项目,仅用100行代码即可实现自动解决GitHub问题或协助命令行操作的功能。该项目以极简设计为核心,完全避免了传统AI代理所需的复杂配置和巨型代码库,却能在SWE-bench基准测试中取得68%的验证成绩。其工作原理基于强化学习框架,通过自主推理直接分析GitHub问题描述和代码上下文,生成修复代码或命令行操作建议。项目特别强调对开发者日常任务的实用性,例如自动定位代码错误、生成补丁或执行终端指令,同时保持代码量极小(仅100行),适合需要快速部署或资源受限的场景。相比传统大型AI代理框架,mini-swe-agent无需依赖庞大配置文件或分布式架构,所有核心逻辑集成在单个文件中,显著降低了使用门槛。尽管功能相对基础,但其在GitHub问题解决场景中表现出色,尤其适合处理结构清晰、需求明确的编程任务。项目开发者通过精简模型设计和高效推理机制,实现了在有限代码量下仍能完成复杂任务的突破,为AI代理的轻量化发展提供了参考范例。 (A01_文本生成_文本对话 / 大语言对话模型及数据)
- awesome-ai-agents - SWE-agent/mini-swe-agent - mini-swe-agent is a minimalistic 100-line AI agent that efficiently solves GitHub issues and assists in command line tasks using bash, designed for simplicity, scalability, and ease of deployment. (Personal Assistants & Conversational Agents / Chatbots)
- awesome - SWE-agent/mini-swe-agent - The 100 line AI agent that solves GitHub issues or helps you in your command line. Radically simple, no huge configs, no giant monorepo—but scores >74% on SWE-bench verified! (Python)
- awesome-agentic-coding-papers - [Project
README
# The 100 line AI agent that solves GitHub issues & more
📣 [New blogpost: Randomly switching between GPT-5 and Sonnet 4 boosts performance](https://www.swebench.com/SWE-bench/blog/2025/08/19/mini-roulette/)
[](https://mini-swe-agent.com/latest/)
[](https://join.slack.com/t/swe-bench/shared_invite/zt-36pj9bu5s-o3_yXPZbaH2wVnxnss1EkQ)
[](https://pypi.org/project/mini-swe-agent/)
In 2024, [SWE-bench](https://github.com/swe-bench/SWE-bench) & [SWE-agent](https://github.com/swe-agent/swe-agent) helped kickstart the coding agent revolution.
We now ask: **What if SWE-agent was 100x smaller, and still worked nearly as well?**
`mini` is for
- **Researchers** who want to **[benchmark](https://swe-bench.com), [fine-tune](https://swesmith.com/) or RL** without assumptions, bloat, or surprises
- **Developers** who like their tools like their scripts: **short, sharp, and readable**
- **Engineers** who want something **trivial to sandbox & to deploy anywhere**
Here's some details:
- **Minimal**: Just [100 lines of python](https://github.com/SWE-agent/mini-swe-agent/blob/main/src/minisweagent/agents/default.py) (+100 total for [env](https://github.com/SWE-agent/mini-swe-agent/blob/main/src/minisweagent/environments/local.py),
[model](https://github.com/SWE-agent/mini-swe-agent/blob/main/src/minisweagent/models/litellm_model.py), [script](https://github.com/SWE-agent/mini-swe-agent/blob/main/src/minisweagent/run/hello_world.py)) — no fancy dependencies!
- **Powerful:** Resolves 68% of GitHub issues in the [SWE-bench verified benchmark](https://www.swebench.com/) ([leaderboard](https://swe-bench.com/)).
- **Convenient:** Comes with UIs that turn this into your daily dev swiss army knife!
- **Deployable:** In addition to local envs, you can use **docker**, **podman**, **singularity**, **apptainer**, and more
- **Tested:** [](https://codecov.io/gh/SWE-agent/mini-swe-agent)
- **Cutting edge:** Built by the Princeton & Stanford team behind [SWE-bench](https://swebench.com) and [SWE-agent](https://swe-agent.com).
More motivation (for research)
[SWE-agent](https://swe-agent.com/latest/) jump-started the development of AI agents in 2024. Back then, we placed a lot of emphasis on tools and special interfaces for the agent.
However, one year later, as LMs have become more capable, a lot of this is not needed at all to build a useful agent!
In fact, mini-SWE-agent
- **Does not have any tools other than bash** — it doesn't even use the tool-calling interface of the LMs.
This means that you can run it with literally any model. When running in sandboxed environments you also don't need to take care
of installing a single package — all it needs is bash.
- **Has a completely linear history** — every step of the agent just appends to the messages and that's it.
So there's no difference between the trajectory and the messages that you pass on to the LM.
Great for debugging & fine-tuning.
- **Executes actions with `subprocess.run`** — every action is completely independent (as opposed to keeping a stateful shell session running).
This makes it trivial to execute the actions in sandboxes (literally just switch out `subprocess.run` with `docker exec`) and to
scale up effortlessly. Seriously, this is [a big deal](https://mini-swe-agent.com/latest/faq/#why-no-shell-session), trust me.
This makes it perfect as a baseline system and for a system that puts the language model (rather than
the agent scaffold) in the middle of our attention.
You can see the result on the [SWE-bench (bash only)](https://www.swebench.com/) leaderboard, that evaluates the performance of different LMs with `mini`.
More motivation (as a tool)
Some agents are overfitted research artifacts. Others are UI-heavy frontend monsters.
`mini` wants to be a hackable tool, not a black box.
- **Simple** enough to understand at a glance
- **Convenient** enough to use in daily workflows
- **Flexible** to extend
Unlike other agents (including our own [swe-agent](https://swe-agent.com/latest/)), it is radically simpler, because it:
- **Does not have any tools other than bash** — it doesn't even use the tool-calling interface of the LMs.
Instead of implementing custom tools for every specific thing the agent might want to do, the focus is fully on the LM utilizing the shell to its full potential.
Want it to do something specific like opening a PR?
Just tell the LM to figure it out rather than spending time to implement it in the agent.
- **Executes actions with `subprocess.run`** — every action is completely independent (as opposed to keeping a stateful shell session running).
This is [a big deal](https://mini-swe-agent.com/latest/faq/#why-no-shell-session) for the stability of the agent, trust me.
- **Has a completely linear history** — every step of the agent just appends to the messages that are passed to the LM in the next step and that's it.
This is great for debugging and understanding what the LM is prompted with.
Should I use SWE-agent or mini-SWE-agent?
You should use `mini-swe-agent` if
- You want a quick command line tool that works locally
- You want an agent with a very simple control flow
- You want even faster, simpler & more stable sandboxing & benchmark evaluations
- You are doing FT or RL and don't want to overfit to a specific agent scaffold
You should use `swe-agent` if
- You need specific tools or want to experiment with different tools
- You want to experiment with different history processors
- You want very powerful yaml configuration without touching code
What you get with both
- Excellent performance on SWE-Bench
- A trajectory browser
Simple UI (mini)
Visual UI (mini -v)


Batch inference
Trajectory browser


```python
agent = DefaultAgent(
LitellmModel(model_name=...),
LocalEnvironment(),
)
agent.run("Write a sudoku game")
```
* [Quick start](https://mini-swe-agent.com/latest/quickstart/)
* [`mini`](https://mini-swe-agent.com/latest/usage/mini/)
* [FAQ](https://mini-swe-agent.com/latest/faq/)
* [Global configuration](https://mini-swe-agent.com/latest/advanced/global_configuration/)
* [Yaml configuration files](https://mini-swe-agent.com/latest/advanced/yaml_configuration/)
* [Power up](https://mini-swe-agent.com/latest/advanced/cookbook/)
## Let's get started!
Option 1: Install + run in virtual environment
```bash
pip install uv && uvx mini-swe-agent [-v]
# or
pip install pipx && pipx ensurepath && pipx run mini-swe-agent [-v]
```
Option 2: Install in current environment
```bash
pip install mini-swe-agent && mini [-v]
```
Option 3: Install from source
```bash
git clone https://github.com/SWE-agent/mini-swe-agent.git
cd mini-swe-agent
pip install -e .
mini [-v]
```
Read more in our [documentation](https://mini-swe-agent.com/latest/):
* [Quick start guide](https://mini-swe-agent.com/latest/quickstart/)
* More on [`mini`](https://mini-swe-agent.com/latest/usage/mini/) and [`mini -v`](https://mini-swe-agent.com/latest/usage/mini_v/)
* [Global configuration](https://mini-swe-agent.com/latest/advanced/global_configuration/)
* [Yaml configuration files](https://mini-swe-agent.com/latest/advanced/yaml_configuration/)
* [Power up with the cookbook](https://mini-swe-agent.com/latest/advanced/cookbook/)
* [FAQ](https://mini-swe-agent.com/latest/faq/)
* [Contribute!](https://mini-swe-agent.com/latest/contributing/)
## Attribution
If you found this work helpful, please consider citing the [SWE-agent paper](https://arxiv.org/abs/2405.15793) in your work:
```bibtex
@inproceedings{yang2024sweagent,
title={{SWE}-agent: Agent-Computer Interfaces Enable Automated Software Engineering},
author={John Yang and Carlos E Jimenez and Alexander Wettig and Kilian Lieret and Shunyu Yao and Karthik R Narasimhan and Ofir Press},
booktitle={The Thirty-eighth Annual Conference on Neural Information Processing Systems},
year={2024},
url={https://arxiv.org/abs/2405.15793}
}
```
Our other projects: