Skip to main content

Nano SWE Agent - A simple AI software engineering agent

Project description

micro-swe-agent banner

The 100 line AI agent that solves GitHub issues & more

Docs Slack

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: 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).
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!

(This will get simpler once we publish to PyPI)

pip install pipx
pipx run --spec git+ssh://git@github.com/SWE-agent/micro-swe-agent micro [-v]

Read more in our documentation:

👀 More agentic AI

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

micro_swe_agent-1.0.0.dev4.tar.gz (37.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

micro_swe_agent-1.0.0.dev4-py3-none-any.whl (52.7 kB view details)

Uploaded Python 3

File details

Details for the file micro_swe_agent-1.0.0.dev4.tar.gz.

File metadata

  • Download URL: micro_swe_agent-1.0.0.dev4.tar.gz
  • Upload date:
  • Size: 37.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for micro_swe_agent-1.0.0.dev4.tar.gz
Algorithm Hash digest
SHA256 96f7e9c5a1916c6748b635afc8949f54cbfa7c5108450650be8e6e926a3ab1d9
MD5 d23b2e36b6c34d334fbb516a9b33e887
BLAKE2b-256 3851c7323850c9ad39ead695e7e3509ae43adf9ba84583b54e4c3d845f185b1e

See more details on using hashes here.

File details

Details for the file micro_swe_agent-1.0.0.dev4-py3-none-any.whl.

File metadata

File hashes

Hashes for micro_swe_agent-1.0.0.dev4-py3-none-any.whl
Algorithm Hash digest
SHA256 cf78381fca825b7adcfac7cffc32bdf9f598cbf5f999e1141b97919ca63e7db5
MD5 c677d0e7f4f1b9f5ab96759f144f379b
BLAKE2b-256 510411c74313cc1efb530195efc8341d774826e60b45c7880266baeabb120677

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page