Nano SWE Agent - A simple AI software engineering agent
Project description
In 2024, SWE-bench & SWE-agent helped kickstart the agentic AI for software revolution.
We now ask: What if SWE-agent was 100x smaller, and still worked nearly as well?
micro is for
- 🧪 Researchers who want to benchmark, fine-tune or RL without assumptions, bloat, or surprises
- 🧑💻 Hackers & power users 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 (+100 total for env, model, script) — no fancy dependencies!
- 💪 Powerful: Resolves XX% of GitHub issues in the SWE-bench verified benchmark.
- 🤗 Friendly: Comes with two convenient UIs that will turn this into your daily dev swiss army knife!
- 🍀 Environments: In addition to local envs, you can use docker, podman, singularity, apptainer, and more
- 🧪 Tested:
- 🎓 Cutting edge: Built by the Princeton & Stanford team behind SWE-bench and SWE-agent.
More motivation (for research)
SWE-agent 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, micro-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 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.
- 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 outsubprocess.runwithdocker exec) and to scale up effortlessly.
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.
More motivation (as a tool)
Some agents are overfitted research artifacts. Others are UI-heavy tools, highly optimized for a specific user experience. Both variants are hard to understand.
micro strives to be
- Simple enough to understand at a glance
- Convenient enough to use in daily workflows
- Flexible to extend
A hackable tool, not a black box.
Unlike other agents (including our own swe-agent), 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.
- Has a completely linear history — every step of the agent just appends to the messages and that's it.
- Executes actions with
subprocess.run— every action is completely independent (as opposed to keeping a stateful shell session running).
Simple UI (micro)
|
Visual UI (micro -v)
|
|
|
|
| Batch inference | Trajectory browser |
|
|
|
| Python bindings | More in the docs |
agent = DefaultAgent(
LitellmModel(model_name=...),
LocalEnvironment(),
)
agent.run("Write a sudoku game")
|
🔥 Let's get started!
- Install + run in virtual environment
pip install pipx && pipx ensurepath && pipx run micro-swe-agent [-v]
- Or install in current environment
pip install micro-swe-agent && micro [-v]
- Or install from source
git clone https://github.com/SWE-agent/micro-swe-agent.git
cd micro-swe-agent
pip install -e .
micro [-v]
Read more in our documentation:
- Quick start guide
- More on
microandmicro -v - Configuration
- Power up with the cookbook
- FAQ
- Contribute!
👀 More agentic AI
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file micro_swe_agent-1.0.0rc1.tar.gz.
File metadata
- Download URL: micro_swe_agent-1.0.0rc1.tar.gz
- Upload date:
- Size: 36.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
112442703fd14a54e9dae3e572080331be1f4254eacf452e856af4c2ed2cfb5c
|
|
| MD5 |
f5567568ff9089f3a26f702230c539b9
|
|
| BLAKE2b-256 |
47d1d10ef4801b2fdbbd26d01b8a98db5e945d106e100a1fe6a9b57cb2cad752
|
File details
Details for the file micro_swe_agent-1.0.0rc1-py3-none-any.whl.
File metadata
- Download URL: micro_swe_agent-1.0.0rc1-py3-none-any.whl
- Upload date:
- Size: 52.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ed89ed6e56334316f8c655be94564a4272f2238174c1c808f94dae3b293b9fe
|
|
| MD5 |
00bfe97667edadb172b04713b2745a92
|
|
| BLAKE2b-256 |
7fb5a8acca4f254091bcb8c257046f8e8b37b7cd11d75d87ddbfc072c994b0b4
|