Open-Source AI Agent Frameworks, Compared
An open-source agent framework is a code library that handles the loop around a language model: deciding which tool to call, passing results back, keeping state and letting a person step in. LangGraph, CrewAI, smolagents, Haystack, Pydantic AI, Agno and Mastra are popular picks. Licence and language usually decide the choice before features do.
Updated
Building your own agent, rather than using a hosted builder, starts with picking a framework. The table below lists nine well-known open-source options with facts read from each project's GitHub page on October 15, 2026: the licence, the main language and the star count. Stars only show popularity, not quality, so use them as a rough signal. Filter by language or licence, or search by name.
Filter the frameworks
Stars and licences read from GitHub on October 15, 2026. Click a name to open its repository.
| Framework | Licence | Language | GitHub stars | Notes |
|---|---|---|---|---|
| LangGraph | MIT | Python | 43,309 | Low-level orchestration for long-running, stateful agents, with durable execution and human-in-the-loop. |
| CrewAI | MIT | Python | 59,733 | Orchestrates role-playing agents that work together as a crew. |
| Microsoft Agent Framework | MIT | Python, .NET | 14,140 | Microsoft's successor to AutoGen for agents and multi-agent workflows. |
| AutoGen | MIT | Python | 61,421 | In maintenance mode: bug fixes and security patches only. Code MIT, docs CC-BY-4.0. |
| smolagents | Apache-2.0 | Python | 29,857 | A barebones library for agents that think in code. |
| Haystack | Apache-2.0 | Python | 26,745 | Modular pipelines and agent workflows for applications built on your own content. |
| Pydantic AI | MIT | Python | 20,635 | Typed inputs and outputs end to end, from the Pydantic team. |
| Agno | Apache-2.0 | Python | 42,747 | Build, run and manage agent platforms. |
| Mastra | Apache-2.0 | TypeScript | 28,833 | TypeScript framework. Apache-2.0, except folders named ee, which have their own licence. |
The loop every framework wraps
Stripped of any framework, an agent is this loop. The model client is left abstract so you can plug in any provider.
A minimal agent loop in Python
The model either answers or asks for a tool. Tools are plain functions, and the loop stops after a set number of steps.
def order_status(order_id: str) -> str:
return {"1001": "shipped", "1002": "packing"}.get(order_id, "not found")
TOOLS = {"order_status": order_status}
def run_agent(ask_model, question: str, max_steps: int = 5) -> str:
history = [{"role": "user", "content": question}]
for _ in range(max_steps):
reply = ask_model(history, tools=list(TOOLS))
if reply.get("tool") is None:
return reply["text"]
result = TOOLS[reply["tool"]](**reply["args"])
history.append({"role": "tool", "name": reply["tool"], "content": result})
return "Stopped: too many steps. Passing to a person."
What separates them
LangGraph models an agent as a graph of steps with saved state, which suits long jobs that must resume after a failure. CrewAI and Microsoft Agent Framework focus on several agents with roles handing work to each other. smolagents has agents write small pieces of code as their actions. Haystack is built around modular pipelines, with agent workflows as one of the things those pipelines can run.
Pydantic AI leans on typed inputs and outputs, which helps catch mistakes early. Agno aims at running agents as a managed platform. Mastra is the TypeScript option here, handy if your website is already built in JavaScript.
What a framework will not do for you
None of them make an agent safe by default. You still decide which tools it gets, what data it can read and which actions need a human yes. You also still pay for the model calls and run the servers.
How it works
- Pick the language your team already writes, Python or TypeScript.
- Filter by licence. MIT and Apache-2.0 both allow commercial use; check any extra terms noted.
- Shortlist two frameworks and build the same small task in each, such as answering an order-status question with one tool.
- Keep the one whose code you could still read and debug six months from now.
Tips
- Check the last commit date and open issues, not just stars, before you depend on a project.
- Prefer frameworks that let a person approve risky actions; it matters more than clever planning.
- Keep your tools as plain functions so you can move them to another framework later.
- Read the licence file itself. Some projects carve out folders under different terms.
- Start with one agent and one tool. Add multi-agent setups only when one agent clearly falls short.
Frequently asked questions
Which open-source agent framework is best for beginners?
smolagents describes itself as a barebones library, which keeps the amount you need to learn small. CrewAI's crew-and-role idea is also easy to picture. Pick whichever matches the language you already know.
Is AutoGen still maintained?
Its README says AutoGen is in maintenance mode: no new features, community managed, with bug fixes and security patches only. Microsoft points new projects to Microsoft Agent Framework instead.
Are these frameworks free to use in a commercial product?
The ones listed here use MIT or Apache-2.0 for their main code, both of which allow commercial use. Mastra keeps folders named ee under a separate licence, and AutoGen's documentation is CC-BY-4.0 while its code is MIT. This is not legal advice; read each licence.
Do I need a framework at all?
Not always. A simple agent is a loop of model call, tool call and result. A framework earns its place once you need saved state, retries, approval steps or several agents working together.
How were the star counts measured?
We read each repository's stargazer count from the public GitHub API on October 15, 2026. They change daily, so treat them as a snapshot.
Related: How to build an AI agent, Self-hosted AI agent, No-code AI agent builder, What is an MCP server?, AI agent vs agentic AI.
Build your site free or see all free tools. On We.Inc you can build your site free, with no card and no trial needed to start. AI building is on paid plans from $19 a month.
More in Guides
- How to Optimize Images for a Website
- Order Confirmation Email Template
- Orphan Pages: How to Find and Fix Pages Nothing Links To
- PageSpeed Insights Explained: What Each Score Means and How to Fix It
- Parts of a Website: An Annotated Example (Anatomy of a Website) | How-to Guide
- Samples of Personal Websites: 6 Annotated Examples by Goal | How-to Guide
- Plain Language for Government Websites: Rules, Before-and-After Rewrites and a Review Checklist | How-to Guide
- Playwright MCP Server: Let an Assistant Drive a Real Browser
Product
Who It's For
- For Agencies
- For Freelancers
- For Hosting Providers
- For SaaS Platforms
- For Startups
- For Financial Services
- For Healthcare
Features
Resources
- Blog
- Help Center
- Free Business Tools
- Free UI Components
- Website Templates
- Template Collections
- Website Examples
- Guides
- Comparisons
- Alternatives
- Best Lists
- Reviews
- Pricing Guides
- Use Cases
- Glossary & Guides
- Integrations
- Developers
- Benchmark
- Windows App