Modules
LangEx — LangGraph for Elixir.
Data structure representing a saved graph execution snapshot.
Lossless JSON-safe encoding for checkpoint payloads.
Behaviour for checkpoint persistence backends.
In-memory LangEx.Checkpointer backend.
PostgreSQL-backed checkpointer using Ecto.
Redis-backed checkpointer using Redix.
Combines a state update with a routing directive.
Returned from node functions to both update state and control flow.
The :resume field is used to resume interrupted graphs.
Layered configuration resolution for LangEx.
Manages context window size by compacting older tool-call rounds.
Dependency-free text embedder using the hashing trick.
StateGraph builder.
A compiled, executable graph.
ETS-backed memoization for node results (the cache: node option).
Super-step execution engine inspired by Google's Pregel.
Retry configuration for the retry: node option.
State management with reducer support.
Streaming graph execution.
Pause graph execution and wait for external input.
Behaviour for LLM provider adapters.
Streaming Anthropic Claude adapter with tool use, thinking, and prompt caching.
Helper to create graph nodes that call an LLM.
Google Gemini chat adapter with function calling support.
OpenAI chat completions adapter with tool/function calling support.
Provider registry and model resolver for LLM chat models.
Retry-aware LLM wrapper with backoff, telemetry hooks, and fallback.
Chat message types for LLM interactions.
A message authored by the LLM, optionally carrying tool calls.
A message authored by the human user.
A deletion instruction consumed by LangEx.Message.add_messages/2.
A system prompt message.
The result of a tool call, correlated by tool_call_id.
A structured tool/function call requested by the LLM.
Pre-built state schema with a messages key using the add_messages reducer.
Composable hooks that wrap the model call inside LangEx.Prebuilt.agent/1.
Middleware that clears the contents of stale tool results.
Middleware that gates the agent's final answer against a rubric.
Middleware that replaces older history with an LLM-written summary.
Middleware that gives the agent an explicit planning tool.
Middleware that narrows a large tool set before the model call.
Migrations create and modify the database tables LangEx needs to function.
Structured failure of a graph node.
Raised when a node attempt exceeds its timeout.
Ready-made graph constructors for common agent shapes.
Builds a tool that transfers control from the current agent to another.
Builds a routable team-member agent for LangEx.Prebuilt.Swarm and
LangEx.Prebuilt.Supervisor.
A generate → critique → revise loop (the reflection / reflexion pattern).
Builds a hub-and-spoke team: a supervisor agent delegates to workers and workers report back to the supervisor.
Builds a peer-to-peer team of agents that hand control to one another.
Directs execution to a node with a custom state payload. Used for map-reduce patterns where the number of edges is dynamic.
Long-term key-value memory that outlives a single thread.
In-memory LangEx.Store backend.
PostgreSQL-backed LangEx.Store using Ecto.
Telemetry events emitted by LangEx.
Optional OpenTelemetry bridge for LangEx telemetry spans.
Run-tree correlation for telemetry spans.
Provider-agnostic tool/function definition for LLM tool calling.
Annotates tool results with error recovery guidance for the LLM.
Graph node for executing tool calls from AI messages.
Tool execution request passed to wrap_tool_call interceptors.