Skip to content

LangChain / LangGraph connector: targeted version and verified APIs

Packages: langchain and langgraph (published by LangChain). Targeted: langchain 1.5.2, langgraph 1.2 (extra credencestack[langchain]: langchain>=1.0, langgraph>=1.0). Checked against the installed source on 2026-11-22.

APIs used

Need API Where
Agent langchain.agents.create_agent(model, tools, system_prompt=, middleware=, checkpointer=) returns a compiled LangGraph graph langchain/agents
Native tools langchain_core.tools.StructuredTool.from_function(...); failures raise ToolException so the model sees an error langchain_core/tools
Events a BaseCallbackHandler (on_llm_end) records each model response with token usage langchain_core/callbacks
Human in the loop HumanInTheLoopMiddleware(interrupt_on={tool: {"allowed_decisions": [...], "when": fn}}); the graph returns __interrupt__; resume with Command(resume={"decisions": [...]}) langchain/agents/middleware, langgraph.types
Stop AgentMiddleware with before_model (@hook_config(can_jump_to=["end"])) and wrap_tool_call: CredenceStack's SuspensionMiddleware credencestack.connectors.langchain
Budget ToolCallLimitMiddleware(run_limit=, exit_behavior="end") langchain/agents/middleware
Checkpoints langgraph.checkpoint.memory.InMemorySaver, required for interrupts langgraph/checkpoint
Offline model credencestack.agents.scripted_model.ScriptedChatModel, a BaseChatModel replaying a scripted policy this package

Notes

  • Suspension depends on the agent: suspend() returns True only when the factory installs SuspensionMiddleware. Without it the connector reports suspension unsupported.
  • Models come from init_chat_model strings (provider:model) or a chat-model instance.