-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Revisit memory middleware cache boundaries across model providers #6522
Copy link
Copy link
Open
Labels
org:internalIssue or pull request created by a member of the `langchain-ai` GitHub organization.Issue or pull request created by a member of the `langchain-ai` GitHub organization.package:deepagentsChanges related to the `deepagents` SDK and agent harness.Changes related to the `deepagents` SDK and agent harness.priority:backlogNot currently planned/prioritized work, often affecting a limited feature or set of users.Not currently planned/prioritized work, often affecting a limited feature or set of users.topic:memoryAgent memory and persistent context.Agent memory and persistent context.topic:middlewareMiddleware behavior and composition.Middleware behavior and composition.topic:performancePerformance, resource usage, and cost optimization.Performance, resource usage, and cost optimization.
Description
Activity
Metadata
Metadata
Assignees
Labels
org:internalIssue or pull request created by a member of the `langchain-ai` GitHub organization.Issue or pull request created by a member of the `langchain-ai` GitHub organization.package:deepagentsChanges related to the `deepagents` SDK and agent harness.Changes related to the `deepagents` SDK and agent harness.priority:backlogNot currently planned/prioritized work, often affecting a limited feature or set of users.Not currently planned/prioritized work, often affecting a limited feature or set of users.topic:memoryAgent memory and persistent context.Agent memory and persistent context.topic:middlewareMiddleware behavior and composition.Middleware behavior and composition.topic:performancePerformance, resource usage, and cost optimization.Performance, resource usage, and cost optimization.
Filed on behalf of Sydney Runkle (@sydney-runkle), at her request, following a discussion with the Managed Deep Agents (MDA) team.
Area
Issue Content
Revisit the prompt-cache boundary in
MemoryMiddlewareand how it composes with provider-aware prompt caching. MDA's proposed memory middleware copies Deep Agents' Anthropic-only cache-control logic and emits ordinary text for other providers. That avoids sending Anthropic markers to unsupported providers, but does not settle caching behavior for the other models developers can select.MDA has shared agent memory and private user memory, with per-run
allowcallbacks deciding which layers are mounted. Its proposed loader refreshes content before each model call and injects it into the request without checkpointing amemory_contentsfield. Content can therefore differ between callers/runs and after writes within a run.Questions / desired outcome
Related work