Type: url

Original: https://blog.langchain.com/agent-middleware

Status: generated

Summary

This September 2025 LangChain blog post argues that agent frameworks sharing the simple model-prompt-tools loop fail in production because they give developers too little control over context engineering, and recounts the parameters LangChain added over two years (dynamic prompts, pre- and post-model hooks, dynamic model selection) before they became hard to coordinate. It introduces Middleware in LangChain 1.0 as the replacement: composable units with before_model, after_model and modify_model_request hooks that run like web-server middleware, shipped initially as human-in-the-loop, summarization and Anthropic prompt caching implementations.

Generated pages