What are AI agents?
AI agents are generative AI tools that can autonomously perform tasks given natural language prompting.
The most well-known AI agent is Devin, a software engineering AI agent that shocked the developer world with its slick UI and sophisticated reasoning. Given a task, Devin develops a plan of action, reads docs on the Internet, adds debug statements, and deploys its code to a website, much like a professional software engineer would do.
Devin has even been spotted asking questions in our Modal Slack community. Devin also occasionally makes contributions to our examples repo.
Devin is proprietary software built by Cognition AI, so naturally many developers have started building and exploring open-source alternatives. In this guide, we’ll highlight a few of the most popular open-source AI agents.
Open-source AI agents
OpenHands
Formerly known as OpenDevin, OpenHands is arguably the most popular open-source AI agent today. They provide a convenient Docker command to try it out locally as well a headless mode for scripting. The experience overall feels very Devin-like.
Here’s a screenshot of me running OpenHands locally and asking it to build me a simple calculator app:
OpenHands runs all generated code in an isolated Docker container. They recently just raised a seed round, presumably to help them build out their hosted solution, which is currently in waitlist.
SWE-agent
SWE-agent is a product of the Princeton NLP department and the authors of SWE-bench, an AI agent evaluation framework based on resolving Github issues from 12 popular Python repositories. SWE-agent is their attempt at building an AI agent that can solve the benchmark.
Here’s a screenshot of me running the SWE-agent locally and pointing it at a simple Github issue to fix (resolving a missing colon):
Compared to OpenHands, SWE-agent is less a general AI agent and more specifically optimized to resolving specific Github issues; it doesn’t appear to accept generic prompts. At this point in time, the project overall seems to be more research-focused, and it’s unclear if companies are successfully using SWE-agent in production.
Aider
Aider’s AI agent works directly from the terminal, unlike the other examples that have a frontend with IDE, browser, and terminal. As a result, it’s a lot easier to install and get started with; you just run pip install aider-chat
, add your LLM API keys, and start chatting with the LLM right away.
Here’s an example of me asking Aider to build a simple calculator app:
One downside of Aider is it executes code directly on your computer. Generated code has no safety guarantees, so you’d ideally want to run it in an isolated sandbox environment.
smol-developer
smol developer is one of the first open-source AI agents that created a lot of buzz around May 2023. Similar to Aider, it functions as a code generation tool you trigger from the terminal, but it doesn’t actually execute any of the code automatically. A “human in the loop” is still required to debug and run the generatd code.
We built a tool called devlooper which extends smol developer by iteratively generating and testing code safely in our Sandbox primitive.
In this GIF, devlooper takes 11 iterations to create a Python library that generates voronoi diagrams:
Devika
Devika is another popular open-source alternative, with its express purpose stated as an “open-source alternative to Devin”. Compared to the other AI agents, I personally found this a bit more difficult to set up and seems to be in more of an experimental development stage.
Conclusion
Open-source has quickly been catching up to Devin since the excitement around its release as developers explore alternatives. OpenHands seems to be the most promising to check out, but there are many to consider.
Arguably the biggest challenge with running open-source AI agents is finding the right isolated runtime to safely run generated code. This is a great use case for our Sandbox primitive that allows you to define containers at runtime and run arbitrary code inside of them. We’re following the AI agent space closely, so let us know in our Slack which AI agents you’ve been trying out!