OpenAI middleware | Content moderation | langchain-ai/langchain |  |
Anthropic middleware | Prompt caching, bash tool, text editor, memory, and file search | langchain-ai/langchain |  |
AWS middleware | Prompt caching and AgentCore Payments | langchain-ai/langchain-aws, aws/bedrock-agentcore-sdk-python |  |
Microsoft Foundry middleware | Text moderation, image moderation, prompt shield, protected material, and groundedness | langchain-ai/langchain-azure |  |
CopilotKit | CopilotKit middleware and FastAPI bridge for Deep Agents, create_agent graphs, AG-UI, and the React and runtime clients | CopilotKit/CopilotKit |  |
compact-middleware | Claude Code’s compaction engine as LangChain middleware. Multi-level context compaction for long-running agents. | emanueleielo/compact-middleware |  |
Cisco AI Defense | Runtime security inspection | cisco-ai-defense/ai-defense-langchain-middleware |  |
langchain-collapse | Preventive context management. Collapses consecutive tool-call groups before they fill the context window. | johanity/langchain-collapse |  |
langchain-task-steering | Implicit state-machine middleware for ordered task pipelines with per-task tool scoping, dynamic prompt injection, and composable completion validation. | edvinhallvaxhiu/langchain-task-steering |  |
advisor-middleware | Claude Code’s advisor pattern as LangChain middleware. Pairs a fast executor model with a powerful advisor model that intervenes only on critical decisions. | emanueleielo/advisor-middleware |  |
langchain-router | Phase-based model routing. Routes execution turns to a fast model, keeps the primary for planning and recovery. | johanity/langchain-router |  |
text2sql-framework | Replaces RAG with recursive tool use — the agent explores, writes, tests, and self-corrects using one execute_sql tool. | Text2SqlAgent/text2sql-framework |  |
NoPII | Runtime PII tokenization. Detects personal data in outbound prompts, replaces it with deterministic vault tokens before the request reaches the LLM, and restores the original values in the response. | Enigma-Vault/NoPII |  |
OWASP Agent Memory Guard | Runtime defense against AI agent memory poisoning (OWASP ASI06). Scans messages, model responses, and tool outputs locally with block, warn, and strip modes. | OWASP/www-project-agent-memory-guard |  |
DNS-AID | DNS-based agent discovery via the DNS-AID protocol. Auto-publishes agents on startup, auto-unpublishes on shutdown, and provides discovery tools. | IngmarVG-IB/langchain-dns-aid |  |
eager-tools | Reduces agent wall-clock latency by dispatching each tool call the moment its streaming block closes, overlapping tool execution with LLM generation. | cloudthinker-ai/eager-tools | N/A |
langgraph-state-machine | Section-based flow control for LangGraph React agents. Divides conversations into discrete phases with scoped tools, prompts, auto-transitions, branching, and optional per-section LLM override. | mahmoud661/langgraph-state-machine | N/A |