LangChain — every error, fix, and pattern
The complete developer reference for LangChain — 15 deep fix guides covering the errors that come up in real applications, from RunnableSequence shape mismatches to agent loops to with_structured_output parity across providers. All code tested against LangChain 0.3+, verified 2026.
What is LangChain?
LangChain is the most widely-used open-source framework for building applications on top of LLMs. It provides composable primitives — Runnable, prompt templates, chat models, retrievers, agents, memory, and structured output — that plug into any supported provider (OpenAI, Anthropic, Google, Bedrock, and dozens more) through a uniform API.
This hub focuses on the errors, gotchas, and migration issues that come up in production LangChain code — not the tutorial content. Every guide has real error messages, ranked causes, three tested fixes with working code, and prevention checklists.
Browse by category
Every LangChain error we've documented, grouped into the six categories that matter for troubleshooting.
LCEL & Runnables
Chain composition, streaming, and shape errors in the core Runnable API.
Agents & Tool Calling
Tool-calling agents, ReAct fallbacks, and the loops that eat cost.
Memory & Chat History
Per-session persistence with the modern LCEL-native pattern.
Retrieval & RAG
Vector retrieval configuration, document splitting, and hit-rate tuning.
Structured Output & Packaging
Typed responses and the package version discipline that keeps them working.
Observability & Deployment
LangSmith tracing and LangServe deployment errors.
All 15 LangChain errors
The complete list — sorted by page number. Each fix guide includes real error messages, root causes ranked by frequency, three tested fixes with working Python code, a seven-item prevention checklist, and five FAQs.
-
#91
RunnableSequence input schema mismatchn/aLCEL & Runnables
-
#92
RunnableParallel dict shape confusionn/aLCEL & Runnables
-
#93
.stream() returning full output at oncen/aLCEL & Runnables
-
#94
create_tool_calling_agent schema errorsn/aAgents & Tool Calling
-
#95
AgentExecutor infinite loop (cost blowup)n/aAgents & Tool Calling
-
#96
bind_tools schema mismatch across providersn/aAgents & Tool Calling
-
#97
ReAct agent "Could not parse LLM output"n/aAgents & Tool Calling
-
#98
RunnableWithMessageHistory session_id and config errorsn/aMemory & Chat History
-
#99
Deprecated memory classes migrationn/aMemory & Chat History
-
#100
VectorStoreRetriever score, MMR, and filter failuresn/aRetrieval & RAG
-
#101
Document splitter chunk_size and overlapn/aRetrieval & RAG
-
#102
with_structured_output Pydantic and method errorsn/aStructured Output & Packaging
-
#103
Provider package version driftn/aStructured Output & Packaging
-
#104
LangSmith tracing not appearing in dashboardn/aObservability & Deployment
-
#105
LangServe deployment errorsn/aObservability & Deployment
LangChain package catalog (2026)
LangChain is not one package — it is a family of independently versioned packages. Understanding which one your import comes from is essential for debugging and upgrades.
| Package | Kind | Purpose | Install |
|---|---|---|---|
langchain-core | Foundation | Runnables, prompts, messages, output parsers | Required |
langchain | Higher-level | Agents, retrievers, chains (deprecated) | Common |
langchain-community | Community | Legacy integrations; vector stores, history backends | Optional |
langchain-openai | Provider | OpenAI + Azure OpenAI chat and embeddings | Per-provider |
langchain-anthropic | Provider | Claude chat models on Anthropic API | Per-provider |
langchain-google-genai | Provider | Google Gemini via Generative AI API | Per-provider |
langchain-google-vertexai | Provider | Vertex AI (including Claude on Vertex) | Per-provider |
langchain-aws | Provider | AWS Bedrock, DynamoDB history | Per-provider |
langgraph | Framework | Stateful agent workflows (separate SDK) | For agents |
langsmith | Observability | Tracing + evals (separate SDK) | Recommended |
langserve | Deployment | FastAPI wrapper for LCEL chains | Optional |
For version compatibility across the family, see the version drift page.
Core patterns to know
Six patterns that come up in almost every LangChain codebase — and where each one goes wrong.
- LCEL composition with the
|operator. Shape errors between steps are the most common issue. See RunnableSequence input mismatch. - Tool-calling agents with
create_tool_calling_agent. Schema and iteration limits matter. See tool schema errors and infinite loops. - Message history with
RunnableWithMessageHistory. The modern replacement for legacy memory classes. See migration guide. - RAG retrieval with
VectorStoreRetrieverand document splitters. Configuration and chunking dominate quality. See retriever failures. - Structured output with
with_structured_output. Provider-specific methods matter. See structured output errors. - Streaming across the full chain. Every step must support streaming. See streaming not chunking.
Get the weekly AI-error digest
New fixes, framework updates, and one deep tutorial — every Tuesday. 8,400+ engineers.