LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Types
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
  • Vitest
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsTypes

Types

Core TypeScript type definitions for deep agents. These types are useful when building custom middleware, backends, or extending agent functionality.

Agent Types

The main types for working with deep agents:

  • DeepAgent - The compiled agent graph returned by createDeepAgent
  • CreateDeepAgentParams - Configuration options for createDeepAgent
  • MergedDeepAgentState - The agent's internal state shape

Subagent Types

Types for defining and working with subagents:

  • SubAgent - Configuration object for defining a subagent
  • CompiledSubAgent - Wrapper for using a pre-compiled LangGraph as a subagent

Backend Types

Types for implementing custom backends:

  • BackendProtocol - Interface that all backends must implement
  • BackendFactory - Factory function type for creating backends
  • FileData / FileInfo - File metadata types
  • EditResult / WriteResult - Operation result types

API Reference

Interfaces

Interface

DeepAgent

DeepAgent 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

Interface

DeepAgentTypeConfig

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

Interface

DefaultDeepAgentTypeConfig

Default type configuration for deep agents. Used when no explicit type parameters are provided.

Interface

CreateDeepAgentParams

Configuration parameters for creating a Deep Agent Matches Python's create_deep_agent parameters

Interface

SubAgent

Specification for a declarative subagent.

When using createDeepAgent, subagents automatically receive a default middleware stack (filesystemMiddleware, summarizationMiddleware, etc.) before any cus

Interface

CompiledSubAgent

Type definitions for pre-compiled agents.

Interface

FileInfo

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.

Interface

EditResult

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/

Interface

WriteResult

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

Interface

BackendProtocol

deprecated

Types

Type

MergedDeepAgentState

Combined state type including custom middleware and subagent middleware states

Type

FileData

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

Type

BackendFactory

deprecated

Factory function type for creating backend instances.

Backends receive BackendRuntime which contains the current state and runtime information, extracted from the execution context.