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
JavaScriptdeepagentsmiddlewareMemoryMiddlewareOptions
Interface●Since v1.5

MemoryMiddlewareOptions

Copy
interface MemoryMiddlewareOptions

Properties

View source on GitHub
property
addCacheControl: boolean
property
backend: AnyBackendProtocol | BackendFactory | (config: __type) => StateBackend
property
sources: string[]

Options for the memory middleware.

Whether to add cache_control breakpoints to the memory content block. When true, the memory block is tagged with cache_control: { type: "ephemeral" } to enable prompt caching for providers that support it (e.g., Anthropic).

Backend instance or factory (default: StateBackend)

List of memory file paths to load (e.g., ["~/.deepagents/AGENTS.md", "./.deepagents/AGENTS.md"]). Display names are automatically derived from the paths. Sources are loaded in order.