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[str] | List of tags for filtering and grouping traces |
| callbacks | list[BaseCallbackHandler] | Callback handlers |
Example
config = {
"configurable": {"thread_id": "user-001"},
"metadata": {"source": "web"},
"tags": ["production", "chat"],
}
result = agent.invoke(inputs, config=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 |
Example
# 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://...")
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 |
Example
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")
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 inside a tool. The Agent can catch it and re-decide |
| ImportError | Python built-in | Missing dependency package. The error message will suggest the 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 called asynchronously) |
| StructuredOutputError | langchain.agents.structured_output | Errors related to structured output (format mismatch, multiple outputs, etc.) |
| StructuredOutputValidationError | langchain.agents.structured_output | Structured output validation failure |
| MultipleStructuredOutputsError | langchain.agents.structured_output | The 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 | Use init_chat_model() to send a simple request for testing |
Other extensionsThis tutorial's API reference is based on LangChain v1.3.0. Since LangChain is still developing rapidly, it is recommended to consult the latest official documentation for the most up-to-date API information.