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.
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. |
Stripped of any framework, an agent is this loop. The model client is left abstract so you can plug in any provider.
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."
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.
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.
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.
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.
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.
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.
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.
Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.
We.Inc is an AI-powered website builder you can resell under your own brand. Launch a branded client dashboard, bill on Stripe Connect, and deliver AI-generated websites in minutes. White-label plans start at $99 a month for 25 client sites, with a 7-day free trial and no per-site fees.