LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Configuration
  • 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

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsConfigurationTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsmiddlewareSummarizationMiddlewareOptions
Interface●Since v1.6

SummarizationMiddlewareOptions

Options for the summarization middleware.

Copy
interface SummarizationMiddlewareOptions

Properties

property
backend: BackendProtocol | BackendFactory | (config: __type) => StateBackend

Backend instance or factory (default: StateBackend)

property
historyPathPrefix: string

Path prefix for storing conversation history. Defaults to "/conversation_history".

property
keep: ContextSize

Context retention policy after summarization. Defaults to keeping last 20 messages.

property
model: string | BaseLanguageModel<any, BaseLanguageModelCallOptions> | BaseChatModel<BaseChatModelCallOptions, AIMessageChunk<MessageStructure<MessageToolSet>>>

The model for the agent. Defaults to defaultModel

property
summaryPrompt: string

Prompt template for generating summaries.

property
trigger: ContextSize | ContextSize[]

Threshold(s) that trigger summarization. Can be a single ContextSize or an array for multiple triggers.

property
trimTokensToSummarize: number

Max tokens to include when generating summary. Defaults to 4000.

property
truncateArgsSettings: TruncateArgsSettings

Settings for truncating large tool arguments in old messages. If not provided, argument truncation is disabled.

View source on GitHub