惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园_首页
Vercel News
Vercel News
Last Week in AI
Last Week in AI
罗磊的独立博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
IT之家
IT之家
美团技术团队
U
Unit 42
Google DeepMind News
Google DeepMind News
P
Proofpoint News Feed
J
Java Code Geeks
V
V2EX
量子位
腾讯CDC
S
SegmentFault 最新的问题
The GitHub Blog
The GitHub Blog
G
Google Developers Blog
D
DataBreaches.Net
雷峰网
雷峰网
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 聂微东
L
LangChain Blog
C
Check Point Blog

LangChain Forum - Latest posts

Prompt_cache_retention: '24h' supported in langchain agents and where to provide it, inside invoke or while creating client? Could RAG pipelines realistically cause deployment timeouts, is Render suitable for first-time RAG deployments? How do I use langchain_postgres' init_vectorstore_table correctly? Proposal: Graph-wide default error handler for StateGraph (fallback for nodes without error_handler) Support timedelta for CachePolicy.ttl, consistent with TimeoutPolicy Question about LangSmith Trace Search via API How to cancel a run correct !! Anyone confirms this issue that deepagent ui streaming is disturb by update in deepagent or bug issue Would pre-inference routing help long-context agent workflows? Best Stack for Building AI Applications Question about LangSmith Trace Search Seeking help regarding the connection between Websocket and tool calls Tool invocation error with empty error message when using `InjectedState` + `Command` return in async tool How to use @langchain/react FileSystem middleware Using ChatSnowflake with agents Built llmsessioncontract on AgentMiddleware: runtime enforcement of tool-call protocols — feedback wanted DeltaChannelHistory not found in langgraph-api:3.12 Improving citation accuracy and reducing hallucinations in custom Parent-Child RAG pipeline (Gemma3:4B + FAISS+BM25 + Cross-encoder reranker) Metadata filter not filtering for alerts Connecting the Slack integration fails with invalid_team_for_non_distributed_app Trouble understanding and editing experiment summary evaluators feedbacks SSL certificate error from httpx with LangGraph server WikipediaLoader endup in JSONDecodeError Human-in-the-loop approval dashboard for LangGraph agents — open source, free to deploy Should interrupt() be split into two primitives — one for human input, one for s2s data fetching? How are people handling data governance across agent handoffs in production? Feature Request: @task metadata Research: Friction Points in Agentic Commerce Transactions How should I provide an agent to a LangGraph server?
How do ContextEditingMiddleware and SummarizationMiddlewa...
rushant001 · 2026-04-20 · via LangChain Forum - Latest posts
Hi everyone, I’m using ContextEditingMiddleware and SummarizationMiddleware together in create_agent , and I’d like to understand the exact execution semantics when they’re combined. The docs describe each one individually but don’t explain how they interact. My code: agent_executor = create_agent( model=self.llm_service.llm, tools=self.tools, system_prompt=system_prompt, middleware=[ # Layer 1: clean up old tool results (lightweight, no LLM call) ContextEditingMiddleware( edits=[ ClearToolUsesEdit( trigger=self.clear_trigger, keep=self.clear_tool_keep, ), ], ), # Layer 2: summarization (heavier, uses a cheap LLM) SummarizationMiddleware( model=LLMService(model_name=self.summary_model_name).llm, trigger=self.summary_trigger, keep=self.summary_keep, trim_tokens_to_summarize=self.summary_trim_tokens, ), ], ) Questions I’d love help with: Execution order — Which one runs first? Does the order in the middleware=[] list matter, or is it determined by hook type ( before_model vs wrap_model_call )? Data flow — Does one middleware’s output feed into the other? Does the cleanup affect what the summary LLM sees? Does the summary output become the input that cleanup operates on? Both triggered at once — If the conversation exceeds both thresholds in the same call: Do both run? Which result reaches the main LLM? Are the effects combined, or does one override the other? State vs request — I noticed SummarizationMiddleware uses before_model and ContextEditingMiddleware uses wrap_model_call . Does that mean summarization persistently modifies state["messages"] while context editing only modifies the per-call request? What are the multi-turn implications? Recommended pattern — Is the “cheap cleanup first, summarization as fallback” pattern (often suggested in community tutorials) actually supported by this combination, or does it require custom middleware? A concrete walkthrough showing the message list before and after each middleware runs — especially for the “both triggered” case — would be really helpful. Using langchain 1.2.15 . Thanks! 1 post - 1 participant Read full topic