Core TypeScript type definitions for deep agents. These types are useful when building custom middleware, backends, or extending agent functionality.
The main types for working with deep agents:
DeepAgent - The compiled agent graph returned by createDeepAgentCreateDeepAgentParams - Configuration options for createDeepAgentMergedDeepAgentState - The agent's internal state shapeTypes for defining and working with subagents:
SubAgent - Configuration object for defining a subagentCompiledSubAgent - Wrapper for using a pre-compiled LangGraph as a subagentTypes for implementing custom backends:
BackendProtocol - Interface that all backends must implementBackendFactory - Factory function type for creating backendsFileData / FileInfo - File metadata typesEditResult / WriteResult - Operation result typesDeepAgent extends ReactAgent with additional subagent type information.
This type wraps ReactAgent but includes the DeepAgentTypeConfig which contains subagent types for type-safe streaming and deleg
Type bag that extends AgentTypeConfig with subagent type information.
This interface bundles all the generic type parameters used throughout the deep agent system including subagent types for type-sa
Default type configuration for deep agents. Used when no explicit type parameters are provided.
Configuration parameters for creating a Deep Agent Matches Python's create_deep_agent parameters
Specification for a declarative subagent.
When using createDeepAgent, subagents automatically receive a default middleware
stack (filesystemMiddleware, summarizationMiddleware, etc.) before any cus
Type definitions for pre-compiled agents.
Structured file listing info.
Minimal contract used across backends. Only "path" is required. Other fields are best-effort and may be absent depending on backend.
Result from backend edit operations.
Checkpoint backends populate filesUpdate with {file_path: file_data} for LangGraph state. External backends set filesUpdate to null (already persisted to disk/S3/
Result from backend write operations.
Checkpoint backends populate filesUpdate with {file_path: file_data} for LangGraph state. External backends set filesUpdate to null (already persisted to disk/S3
Combined state type including custom middleware and subagent middleware states
Union of v1 and v2 file data formats.
Backends may encounter either format when reading from state or store (v1 from legacy data, v2 from new writes). Use isFileDataV1 from utils for runtime discrimi
Factory function type for creating backend instances.
Backends receive BackendRuntime which contains the current state and runtime information, extracted from the execution context.