LangChain Configuration and Error Classes |
RunnableConfig Configuration Options
| Field |
Type |
Description |
| configurable |
dict |
Runtime configuration. Most commonly used: thread_id for Checkpointer |
| recursion_limit |
int |
Maximum recursion depth (default: 9999) |
| metadata |
dict |
Additional metadata |
| tags |
list |
List of tags for filtering and grouping tracing |
| callbacks |
list |
Callback handlers |
Example
config = {
"configurable": {"thread_id": "user-001"},
"metadata": {"source": "web"},
"tags": ["production", "chat"],
}
result = agent.invoke(inputs, config=config)
Checkpointer Implementation Classes
| Class |
Import Path |
Persistence |
| InMemorySaver |
langgraph.checkpoint.memory |
No |
| SqliteSaver |
langgraph.checkpoint.sqlite |
Yes |
| PostgresSaver |
langgraph.checkpoint.postgres |
Yes |
Examples
# In-memory
from langgraph.checkpoint.memory import InMemorySaver
checkpointer = InMemorySaver()
# SQLite
from langgraph.checkpoint.sqlite import SqliteSaver
checkpointer = SqliteSaver.from_conn_string("checkpoints.db")
# PostgreSQL
# from langgraph.checkpoint.postgres import PostgresSaver
# checkpointer = PostgresSaver.from_conn_string("postgresql://...")
Store Implementation Classes
| Class |
Import Path |
Persistence |
| InMemoryStore |
langgraph.store.memory |
No |
| PostgresStore |
langgraph.store.postgres |
Yes |
Examples
from langgraph.store.memory import InMemoryStore
store = InMemoryStore()
store.put(("namespace",), "key", {"data": "value"})
item = store.get(("namespace",), "key")
items = store.search(("namespace",))
store.delete(("namespace",), "key")
Common Exception Classes
| Exception |
Source |
Description |
| ToolException |
langchain.tools |
Exception within a tool. Agent can catch and re-decide |
| ImportError |
Python built-in |
Missing dependency package. Error message will suggest installation command |
| ValueError |
Python built-in |
Parameter validation failure or configuration error |
| NotImplementedError |
Python built-in |
Middleware method not implemented (e.g., only synchronous defined but asynchronous called) |
| StructuredOutputError |
langchain.agents.structured_output |
Structured output-related errors (format mismatch, multiple outputs, etc.) |
| StructuredOutputValidationError |
langchain.agents.structured_output |
Structured output validation failure |
| MultipleStructuredOutputsError |
langchain.agents.structured_output |
Model returned multiple structured outputs |
| TimeoutError |
Python built-in / various SDKs |
Request timeout |
LaunchDarkly Configuration Checklist
| Check Item |
Command / Method |
| Python Version |
python --version (requires 3.10+) |
| LangChain Version |
python -c "import langchain; print(langchain.__version__)" |
| Dependency Installation |
pip list | grep langchain |
| API Key Configuration |
python -c "import os; from dotenv import load_dotenv; load_dotenv(); print(os.getenv('DEEPSEEK_API_KEY', 'NOT SET')[:10])" |
| Model Connectivity |
Send a simple request using init_chat_model() for testing |
This tutorialβs API reference is based on LangChain v1.3.0. As LangChain is still rapidly evolving, it is recommended to consult the latest official documentation when using it to obtain up-to-date API information.