Skip to content

LangChain alternatives: 7 open-source agent frameworks

Updated By Agent Radar7 min read

Short answer

LangChain alternatives compared: LangGraph, Pydantic AI, CrewAI, OpenAI Agents SDK, Agno, DSPy and Mastra, with licenses, versions and who each fits.

Top pick: LangGraph. LangChain Inc's low-level orchestration runtime for long-running, stateful agents. It can be used without LangChain, so it is the smallest step away.

Quick comparison

LangChain alternatives: 7 open-source agent frameworks: quick comparison
PickLicensePricingSource
1.LangGraphMITNot statedGitHub
2.Pydantic AIMITNot statedGitHub
3.CrewAIMITNot statedGitHub
4.OpenAI Agents SDKMITNot statedGitHub
5.AgnoApache-2.0Not statedGitHub
6.DSPyMITNot statedGitHub
7.MastraApache-2.0 (ee/ directories under a separate license)Not statedGitHub

If you want to stay close to LangChain but need reliable long-running agents, move to LangGraph. If you want less framework and more plain, typed Python, pick Pydantic AI. For teams of role-based agents, CrewAI; for a small API with handoffs and tracing, the OpenAI Agents SDK; for agents served as an API, Agno; for pipelines you can score and optimize, DSPy; and for TypeScript, Mastra. All seven are open source. Versions and licenses checked 2026-10-29.

Quick comparison

FrameworkLanguageLicenseLatest release (checked 2026-10-29)GitHub starsBest for
LangGraphPythonMIT1.2.18, Oct 26~44kDurable, stateful workflows
Pydantic AIPython 3.11+MIT2.63.0, Oct 28~21kTyped agents, structured output
CrewAIPython 3.10-3.13MIT1.15.33, Oct 28~60kRole-based multi-agent crews
OpenAI Agents SDKPython, JSMIT0.24.0, Oct 15~30kSmall API, handoffs, tracing
AgnoPython 3.9+Apache-2.03.1.11, Oct 27~43kAgents served over REST and MCP
DSPyPythonMIT3.4.1, Oct 12~39kOptimized, metric-driven pipelines
MastraTypeScriptApache-2.0, ee/ separate@mastra/core 1.80.0~29kTypeScript agents and workflows

For reference, LangChain itself has about 149k stars, langchain 1.4.7 on PyPI (October 21) and langchain-core 1.7.1 (October 28).

Why people look for a LangChain alternative

The usual reasons are abstraction weight, stream and API changes between versions, and wanting either more control (a graph runtime) or less framework (typed functions). The latest core release is an example of the second: langchain-core 1.7 (see the LangChain hub) changed how streamed tool-call arguments arrive. That is a reasonable change, but code reading raw stream events has to adapt.

The alternatives

1. LangGraph: stay in the ecosystem, gain control

LangGraph describes itself as a low-level orchestration framework for long-running, stateful agents. Durable execution resumes an agent from where it failed, and interrupts let a person inspect and edit state mid-run. The README says it can be used without LangChain, which makes it the lowest-risk move. See LangGraph vs Google ADK for a head-to-head.

2. Pydantic AI: less framework, typed end to end

Pydantic AI uses type hints to define tool schemas and validate model output, so an agent reads like normal Python. It is model-agnostic and releases often. It is the pick if LangChain's chains and runnables feel like overhead. Compare it in Pydantic AI vs LangChain.

3. CrewAI: teams of agents with roles

CrewAI's README answers the dependency question directly: it is a standalone framework with its own primitives for agents, tasks, crews, flows and tools. It suits processes that split into roles, such as research, draft and review. Head-to-head: LangChain vs CrewAI.

4. OpenAI Agents SDK: a small API

The SDK is a lightweight framework for multi-agent workflows with handoffs, guardrails and tracing. Its README says it is provider-agnostic and supports the OpenAI Responses and Chat Completions APIs plus 100+ other LLMs. It is still pre-1.0. More options in OpenAI Agents alternatives.

5. Agno: agents as a service

Agno puts the serving layer in the framework: agents, teams and workflows are exposed through a REST API and an MCP server. Version 3.1.11 (October 27) lets Claude and Codex harness agents join teams and workflow steps. See Agno vs LangChain.

6. DSPy: stop hand-writing prompts

DSPy replaces prompt strings with declared signatures and modules, then uses optimizers to tune them against a metric. It is a different way of working, best when you have examples to score against. Compare in DSPy vs LangChain.

7. Mastra: the TypeScript route

Mastra is a TypeScript framework for agents and AI applications, with agents, workflows and the AgentController loop in @mastra/core. Its license file puts most code under Apache-2.0 and anything in ee/ directories under a separate enterprise license, so check which packages you use.

Who should not switch

Stay on LangChain if you depend on its integration packages for many model providers, loaders and vector stores and the abstraction is not causing bugs. Of the options here, only LangGraph keeps that integration set within easy reach. Also hold off if your only problem is the 1.7 streaming change: pinning langchain-core<1.7 or reading tool-call-delta is cheaper than a rewrite.

How we chose

We picked open-source, actively released agent frameworks that cover the same job as LangChain's agent layer, and read each project's GitHub repository metadata, README and the PyPI or npm registry on 2026-10-29. Stars are rounded GitHub API counts. We did not benchmark the frameworks or build the same agent in each. Ranks reflect how directly each one replaces LangChain for a typical Python agent project, not overall quality.

Limitations

Release numbers change weekly for most of these projects. Hosted products such as LangSmith, CrewAI's platform or Agno's platform are not compared here, and none of the sources contain a neutral performance benchmark across frameworks.

Related: LangChain hub, frameworks category, Pydantic AI vs LangGraph, Agno vs CrewAI, Agno vs LangGraph, Agno vs Pydantic AI, Pydantic AI vs CrewAI and DSPy vs LangGraph.

The picks

  1. Rank 1

    LangGraph

    MITOpen source

    LangChain Inc's low-level orchestration runtime for long-running, stateful agents. It can be used without LangChain, so it is the smallest step away.

    Pros

    • Durable execution: agents resume from where they failed
    • Human-in-the-loop interrupts to inspect and edit state
    • Usable standalone or with LangChain integrations

    Cons

    • Low level: you design the graph, nodes and state yourself
    • Same company and ecosystem, so not a clean break from LangChain
  2. Rank 2

    Pydantic AI

    MITOpen source

    A model-agnostic Python framework from the Pydantic team, built around typed agents, typed tool calls and validated structured output.

    Pros

    • Type hints drive tool schemas and output validation
    • Fast release cadence: 2.63.0 on October 28, 2026
    • Feels like ordinary Python rather than a chain abstraction

    Cons

    • Requires Python 3.11 or later
    • Fewer prebuilt document loaders and vector store wrappers than LangChain
  3. Rank 3

    CrewAI

    MITOpen source

    A standalone Python framework for teams of role-based agents, with its own primitives for agents, tasks, crews and flows.

    Pros

    • The README states it is standalone, with no LangChain dependency in its core primitives
    • Crews and flows map well to multi-step business processes
    • Largest community of the Python frameworks here by GitHub stars (about 60k)

    Cons

    • Role-play abstraction is more opinionated than a plain agent loop
    • PyPI caps Python below 3.14
  4. Rank 4

    OpenAI Agents SDK

    MITOpen source

    OpenAI's lightweight multi-agent framework. Despite the name, the README says it is provider-agnostic and supports 100+ other LLMs.

    Pros

    • Small API: agents, handoffs, guardrails and tracing
    • Python and JavaScript SDKs
    • Pairs with the hosted Agents API if you want OpenAI to run the loop

    Cons

    • Still pre-1.0: 0.24.0 on PyPI as of October 29, 2026
    • Best-documented paths assume OpenAI models
  5. Rank 5

    Agno

    Apache-2.0Open source

    An Apache-2.0 agent framework and service layer that exposes agents, teams and workflows through a REST API and an MCP server.

    Pros

    • Serving built in, not bolted on
    • Teams and workflow steps, including Claude and Codex harness agents since 3.1.11
    • Widest Python range here: 3.9 and up

    Cons

    • Platform pitch means more surface than a plain library
    • Frequent releases to track
  6. Rank 6

    DSPy

    MITOpen source

    Stanford NLP's framework for programming, not prompting, language models: you declare modules and signatures, and optimizers tune prompts or weights against a metric.

    Pros

    • Optimizers replace hand-tuned prompts
    • Strong fit for pipelines you can score with a metric
    • MIT, about 39k GitHub stars

    Cons

    • Different mental model; not a drop-in for LangChain agents
    • Needs evaluation data to get the most out of it
  7. Rank 7

    Mastra

    Apache-2.0 (ee/ directories under a separate license)Open source

    A TypeScript framework for AI applications and agents, for teams leaving LangChain.js rather than the Python package.

    Pros

    • TypeScript first, not a port of a Python library
    • Agents, workflows and the AgentController loop in @mastra/core
    • @mastra/core 1.80.0 is on npm as of October 29, 2026

    Cons

    • No Python SDK
    • Code under ee/ directories uses a separate enterprise license

Questions

What is the best LangChain alternative for Python?

For most Python teams, Pydantic AI if you want typed agents with less abstraction, or LangGraph if you need durable, stateful workflows and want to keep LangChain integrations available. CrewAI fits multi-agent business processes.

Is there a LangChain alternative without the LangChain dependency?

Yes. Pydantic AI, CrewAI, the OpenAI Agents SDK, Agno, DSPy and Mastra are separate projects. The CrewAI README states it is a standalone framework with its own primitives. LangGraph is from the same company but can be used standalone.

What is a LangChain alternative for TypeScript?

Mastra is the TypeScript option on this list. The OpenAI Agents SDK also ships a JavaScript package, @openai/agents.

Are these LangChain alternatives free and open source?

Yes. The GitHub API reports MIT for LangGraph, Pydantic AI, CrewAI, the OpenAI Agents SDK and DSPy, and Apache-2.0 for Agno. Mastra's license file puts most code under Apache-2.0 and ee/ directories under a separate license. Model and hosting costs are separate.

Should I leave LangChain at all?

Not necessarily. LangChain's create_agent and provider packages are actively maintained; langchain-core 1.7.1 shipped on October 28, 2026. Switch if the abstraction gets in your way, not because of age.

More guides

View all