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.

Open-source agent frameworks
FrameworkLicenceLanguageGitHub starsNotes
LangGraphMITPython43,309Low-level orchestration for long-running, stateful agents, with durable execution and human-in-the-loop.
CrewAIMITPython59,733Orchestrates role-playing agents that work together as a crew.
Microsoft Agent FrameworkMITPython, .NET14,140Microsoft's successor to AutoGen for agents and multi-agent workflows.
AutoGenMITPython61,421In maintenance mode: bug fixes and security patches only. Code MIT, docs CC-BY-4.0.
smolagentsApache-2.0Python29,857A barebones library for agents that think in code.
HaystackApache-2.0Python26,745Modular pipelines and agent workflows for applications built on your own content.
Pydantic AIMITPython20,635Typed inputs and outputs end to end, from the Pydantic team.
AgnoApache-2.0Python42,747Build, run and manage agent platforms.
MastraApache-2.0TypeScript28,833TypeScript 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

  1. Pick the language your team already writes, Python or TypeScript.
  2. Filter by licence. MIT and Apache-2.0 both allow commercial use; check any extra terms noted.
  3. Shortlist two frameworks and build the same small task in each, such as answering an order-status question with one tool.
  4. Keep the one whose code you could still read and debug six months from now.

Tips

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.

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.

More in Guides

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.

Product

Who It's For

Features

Resources

Company

View Sitemap