Why I Don’t Use LangChain (And What I Use Instead)
LangChain is popular. It solves a real problem — orchestrating multiple LLM calls in a sequence. But popularity and usefulness aren’t the same. For production systems, I avoid it. Here’s why, and what I use instead.
What LangChain Does
LangChain abstracts over LLMs and their APIs. It gives you a unified interface for Claude, GPT, Llama, etc., “chains” for multi-step sequences, “agents” for agentic workflows, memory management, prompt templating, and document loaders.
In theory, this is great. In practice, it’s a problem.
Problem 1: Abstraction Leakage
LangChain abstracts over APIs that aren’t actually the same. Claude and GPT have different input/output formats, pricing models, token limits, features (structured outputs, vision, tool use), and error handling.
When you use LangChain, you’re forced to fit every model into the same interface. That means:
- You can’t use model-specific features efficiently.
- You spend time learning the abstraction, not the actual API.
- When the abstraction leaks (and it will), you’re debugging a layer of indirection instead of understanding the real problem.
Example: Claude has structured outputs. GPT doesn’t (yet). LangChain doesn’t surface this well, so you end up manually handling the difference.
Problem 2: It Hides Complexity Instead of Managing It
The job of a framework is to manage complexity. LangChain tries to hide it.
Real example: I need to call Claude twice in sequence, with the second call depending on the first’s output. What does that actually look like?
With LangChain
Looks simple. But what’s actually happening? What errors can occur? How do you debug it?
With direct API calls
It’s longer. But it’s explicit. I can see exactly what’s happening. I can add error handling exactly where I need it. I can inspect intermediate values. If something breaks, I know where.
Problem 3: Debugging a Multilayer Abstraction is Hell
I have a production job failing. LangChain says “error in chain execution.” Where’s the error?
- Is it the prompt template?
- Is it the API call?
- Is it parsing the response?
- Is it the conditional logic?
With LangChain, you dig through layers of framework code to find out. With direct API calls, you print the response and see it immediately.
At 2am, when a job is failing and you need to fix it now, layers of abstraction become layers of pain.
Problem 4: You Pay the Cost Without Reaping the Benefit
LangChain adds overhead. Each call goes through an abstraction wrapper, request serialization, the API call, response deserialization, and type parsing.
And what do you get? The option to swap Claude for GPT without rewriting code. In practice, you pick an LLM and stick with it. The abstraction cost wasn’t worth it.
When LangChain Actually Makes Sense
- Prototyping quickly when you don’t know which model you’ll use.
- Learning about LLM concepts (agents, chains, memory).
- Building demos that need to “just work.”
It’s useful for exploration. For production, it gets in the way.
What I Use Instead
For Orchestration: Explicit Python
Explicit. Debuggable. Testable.
For Prompt Templates: f-strings
Simple. Clear. No special syntax.
For Agentic Workflows: Explicit Loop
You see exactly what’s happening. The agent loop is explicit. Debugging is straightforward.
The Trade-Off
LangChain buys you abstraction over models and built-in features (memory, prompt templates, etc.). You pay with complexity hiding, debugging difficulty, slower and less direct code, and vendor lock-in — not just to the LLM, but to LangChain’s patterns themselves.
For small scripts and prototypes, the trade-off isn’t worth it. Direct API calls are cleaner. For large, complex systems, you might want abstraction. But even then, I’d build a thin, custom layer over the API rather than use LangChain.
My Stack for Production AI
- Anthropic SDK — direct API calls.
- Pydantic — data validation.
- Asyncio — concurrency.
- pytest — testing.
- Custom orchestration — explicit Python logic.
No frameworks. No hidden layers. Just code. It’s more lines than LangChain, but every line does exactly what I expect.
Get the free AI Readiness Checklist
15 questions to diagnose your team’s AI readiness, where you’ll see ROI fastest, and what to tackle first.
No spam. Unsubscribe anytime.
Ready to build AI that actually works?
Let’s talk about how SRE discipline transforms AI from a risky experiment into a reliable business system.
Book Your Free Discovery Call