Skip to main content

micro-swe-agent banner

The 100 line AI agent that solves GitHub issues & more

Docs Slack PyPI - Version

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 65% 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: Codecov
  • 🎓 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 out subprocess.run with docker 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).
Should I use SWE-agent or micro-SWE-agent?

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

You should use micro-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

What you get with both

  • Excellent performance on SWE-Bench
  • A trajectory browser
Simple UI (micro) Visual UI (micro -v)

micro

microv

Batch inference Trajectory browser

swebench

inspector

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]

Alternative: Install in current environment

pip install micro-swe-agent && micro [-v]

Alternative: 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:

👀 More agentic AI

SWE-agent    SWE-ReX    SWE-bench    SWE-smith    sb-cli

Metadata

Release files for micro-swe-agent 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for micro-swe-agent 1.0.2
File Size Uploaded
micro_swe_agent-1.0.2.tar.gz 37.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for micro-swe-agent 1.0.2
File Interpreter ABI Platform
micro_swe_agent-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 89.6 kB

Release files / micro_swe_agent-1.0.2.tar.gz

Download URL micro_swe_agent-1.0.2.tar.gz
Size 37.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7066b3a4d6fce57af583c6d31df727a32136690ea1647d16d66bfa785d54f4ad
BLAKE2b-256 checksum
How to use checksums
1a1922adbc2e750e5c75a1eaa233a27e6b6e8ffe4e6f5a96ae3c515d90203ca2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / micro_swe_agent-1.0.2-py3-none-any.whl

Download URL micro_swe_agent-1.0.2-py3-none-any.whl
Size 52.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c551b53f7d3641ec190611e3b10c5a3ac72598f67b1db2571f96a6345265e8a
BLAKE2b-256 checksum
How to use checksums
dbada2cf8fee7ac4fac711d3e66b4144ba5c99b2460a77f528adaf623e25f36f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page