7 LangChain alternatives worth a look
Checked 29 November 2026 against each product's own site and pricing page.
LangChain is the MIT-licensed framework most people meet first when they start wiring LLMs into an app. It gives you model wrappers, tool calling, retrievers and an agent helper, create_agent, which its own docs describe as a minimal agent harness built on LangGraph. That layering is the main reason teams shop around. To understand what your agent is doing you often end up reading two libraries, and the docs point anyone with advanced needs down to LangGraph, the lower-level orchestration framework. Developers who only need a typed call to a model, a retrieval pipeline over their own documents, or an agent in TypeScript frequently find a smaller library easier to debug and upgrade. Others want a framework whose abstractions match one job, such as retrieval or prompt optimisation, rather than a general toolkit. None of this makes LangChain a bad choice: the project is very active, with commits landing daily on GitHub in November 2026. It just isn't the only sensible starting point.
How we picked these
We looked for open source LLM application frameworks with commits in November 2026 and a licence we could confirm on GitHub. Each pick had to cover a real slice of what people use LangChain for: agents, retrieval, structured output or pipelines. We favoured libraries with a smaller surface area or a clearer idea of what they are for, and we checked each project's own docs rather than third-party roundups. We did not run benchmarks, so nothing here ranks speed or accuracy.

1. LlamaIndex
Apps where retrieval over your own documents is the core of the product.
Pricing: Open source (MIT); LlamaIndex also sells hosted document parsing and indexing services, priced separately.
Why pick it
- Ingestion, chunking, indexing and query engines are first-class concepts rather than add-ons
- Large catalogue of data loaders and vector store integrations
- Python and TypeScript packages
Watch out for
- Agent and workflow features feel secondary next to its retrieval focus
- Similar breadth to LangChain, so the learning curve is not much smaller

2. LangGraph
Teams who like the LangChain ecosystem but want explicit control over agent state and steps.
Pricing: Open source (MIT); LangChain's hosted deployment and tracing products are paid add-ons.
Why pick it
- Agents are graphs you define yourself, so control flow is visible in code
- Supports pausing for human review and resuming from saved state
- LangChain's own docs recommend it for advanced, partly deterministic workflows
Watch out for
- More code to write than a one-line agent helper
- Still part of the same ecosystem, so it doesn't help if you're leaving because of LangChain itself
3. Pydantic AI
Python developers who want typed agents and validated structured output with little ceremony.
Pricing: Open source (MIT).
Why pick it
- Built by the Pydantic team, so outputs are validated against models you already write
- Dependency injection for tools makes agents easy to test
- Small API that reads like ordinary Python
Watch out for
- Fewer ready-made retrievers and loaders than LangChain
- Python only
4. Haystack
Production search and RAG pipelines that need to be explicit and reviewable.
Pricing: Open source (Apache-2.0); deepset sells a commercial platform on top.
Why pick it
- Pipelines are built from typed components with declared inputs and outputs
- Pipelines can be serialised, which helps with review and deployment
- Maintained by deepset with an Apache-2.0 licence
Watch out for
- Smaller community and fewer third-party examples than LangChain
- Python only
5. DSPy
Researchers and teams who would rather optimise prompts against a metric than hand-tune them.
Pricing: Open source (MIT).
Why pick it
- You declare signatures and modules, and optimisers tune the prompts for you
- Comes out of Stanford NLP and is actively maintained
- Good fit when you have an evaluation set
Watch out for
- A different mental model that takes time to learn
- Less suited to quick glue code or simple chat features
6. Mastra
TypeScript teams building agents and workflows inside a Node or Next.js codebase.
Pricing: Open source (Apache-2.0 core; code in ee/ directories is under a separate enterprise licence).
Why pick it
- TypeScript-first, with agents, workflows, memory and RAG in one package
- Very active repository, with commits in late November 2026
Watch out for
- Some features sit under an enterprise licence, so check the ee/ terms before relying on them
- Younger project, so expect API changes
7. OpenAI Agents SDK
Developers who want a thin agent loop with handoffs and guardrails and little else.
Pricing: Open source (MIT); you pay your model provider for usage.
Why pick it
- Very small set of concepts: agents, tools, handoffs, guardrails
- Built-in tracing
- Maintained by OpenAI with frequent commits
Watch out for
- No retrieval layer of its own
- Defaults and docs lean towards OpenAI models
Which one should you pick?
If your app is mostly about answering questions from your own documents, start with LlamaIndex, or Haystack if you want pipelines that a reviewer can read top to bottom. If you're happy in the LangChain world but tired of not knowing what the agent helper does, drop down to LangGraph and own the graph yourself. Python developers who mainly need structured, validated output should try Pydantic AI first; it covers a surprising amount with very little code. TypeScript teams have a natural home in Mastra, as long as they read the enterprise licence terms. Pick DSPy when you have an evaluation set and want prompts tuned against it. For a quick agent prototype with tool calls and handoffs, the OpenAI Agents SDK is the lightest option here.
Sources
- https://docs.langchain.com/oss/python/langchain/overview
- https://github.com/langchain-ai/langchain
- https://github.com/langchain-ai/langgraph
- https://github.com/run-llama/llama_index
- https://github.com/deepset-ai/haystack
- https://github.com/pydantic/pydantic-ai
- https://github.com/stanfordnlp/dspy
- https://github.com/mastra-ai/mastra
- https://github.com/openai/openai-agents-python
- https://ai.pydantic.dev
- https://dspy.ai
- https://mastra.ai
More alternatives pages
What changed in AI dev tools, once a month
Renames, shutdowns, pricing changes and new MCP setups, each with a source.