Public API

April 22, 2026 ยท View on GitHub

Top-level exports from langgraph_kit. These are the primary entry points for using the package.

Configuration

from langgraph_kit import AgentConfig, configure, get_config
ExportTypeDescription
AgentConfigdataclassFrozen configuration dataclass
configure(config)functionSet package-level config (call once at startup)
get_config()functionRead current config

LLM & Persistence

from langgraph_kit import build_llm, create_persistence
ExportTypeDescription
build_llm()functionCreate chat model from config (auto-detects provider)
create_persistence()async context managerYields (checkpointer, store) tuple

Agent Registry

from langgraph_kit import register, get, get_dispatcher, list_agents
ExportTypeDescription
register(id, graph, *, command_dispatcher)functionRegister a compiled graph
get(id)functionLook up graph by ID (raises KeyError)
get_dispatcher(id)functionLook up command dispatcher (returns None if absent)
list_agents()functionList all registered agents as [{"id": ..., "name": ...}]

Streaming

from langgraph_kit import stream_agent_events
ExportTypeDescription
stream_agent_events(graph, input, config, *, store)async generatorStream SSE events

Models

from langgraph_kit import ChatMessage, InvokeRequest, InvokeResponse
ExportTypeDescription
ChatMessageBaseModel{role, content}
InvokeRequestBaseModel{messages, thread_id, checkpoint_id}
InvokeResponseBaseModel{content, thread_id}

Observability

from langgraph_kit import UserInfo, build_agent_run_config
ExportTypeDescription
UserInfoProtocolProtocol with id and email attributes
build_agent_run_config(thread_id, *, user, tags, metadata)functionBuild LangGraph run config

Subpackage Imports

For advanced usage, import directly from subpackages:

# Core building blocks
from langgraph_kit.core.memory.persistent import PersistentMemoryManager
from langgraph_kit.core.memory.consolidation import MemoryConsolidator
from langgraph_kit.core.memory.shared import SharedMemoryManager
from langgraph_kit.core.tools.registry import ToolRegistry
from langgraph_kit.core.tools.capability import ToolCapability, ToolRisk
from langgraph_kit.core.tools.worktree import build_worktree_tools
from langgraph_kit.core.commands.dispatch import CommandDispatcher
from langgraph_kit.core.prompt_assembly.composer import PromptComposer
from langgraph_kit.core.context_management.pressure import PressureMonitor
from langgraph_kit.core.orchestration import GENERAL_WORKERS, CODING_WORKERS

# Graph builder factories (preferred over graphs._builder)
from langgraph_kit.core.graph_builder import (
    build_command_dispatcher,
    build_middleware_stack,
    register_standard_tools,
    register_tool,
)

# Agent graphs
from langgraph_kit.graphs import register_all
from langgraph_kit.graphs.echo_agent import build_graph
from langgraph_kit.graphs.reference_deep_agent import build_reference_deep_agent

# FastAPI integration
from langgraph_kit.contrib.fastapi import create_agent_router