LangChain Configuration and Error Classes


RunnableConfig Configuration Options

FieldTypeDescription
configurabledictRuntime configuration. Most commonly used: thread_id for Checkpointer
recursion_limitintMaximum recursion depth (default 9999)
metadatadictAdditional metadata
tagslist[str]List of tags for filtering and grouping traces
callbackslist[BaseCallbackHandler]Callback handlers

Example

config = {
    "configurable": {"thread_id": "user-001"},
    "metadata": {"source": "web"},
    "tags": ["production", "chat"],
}
result = agent.invoke(inputs, config=config)

Checkpointer Implementation Classes

ClassImport pathPersistence
InMemorySaverlanggraph.checkpoint.memoryno
SqliteSaverlanggraph.checkpoint.sqliteYes
PostgresSaverlanggraph.checkpoint.postgresYes

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://...")

Store Implementation Classes

ClassImport pathPersistence
InMemoryStorelanggraph.store.memoryno
PostgresStorelanggraph.store.postgresYes

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")

Common Exception Classes

ExceptionSourceDescription
ToolExceptionlangchain.toolsException inside a tool. The Agent can catch it and re-decide
ImportErrorPython built-inMissing dependency package. The error message will suggest the installation command
ValueErrorPython built-inParameter validation failure or configuration error
NotImplementedErrorPython built-inMiddleware method not implemented (e.g., only synchronous defined but called asynchronously)
StructuredOutputErrorlangchain.agents.structured_outputErrors related to structured output (format mismatch, multiple outputs, etc.)
StructuredOutputValidationErrorlangchain.agents.structured_outputStructured output validation failure
MultipleStructuredOutputsErrorlangchain.agents.structured_outputThe model returned multiple structured outputs
TimeoutErrorPython built-in / various SDKsRequest timeout

LaunchDarkly Configuration Checklist

Check itemCommand/Method
Python versionpython --version (requires 3.10+)
langchain versionpython -c "import langchain; print(langchain.__version__)"
Dependency installationpip list | grep langchain
API Key configurationpython -c "import os; from dotenv import load_dotenv; load_dotenv(); print(os.getenv('DEEPSEEK_API_KEY', 'NOT SET')[:10])"
Model connectivityUse init_chat_model() to send a simple request for testing

This 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.

Other extensions