Skip to main content
Browse available middleware or contribute your own to the ecosystem. Learn more about how middleware works in the middleware overview.

Share your middleware

Middleware enables context engineering, harness customization, and runtime safety controls. It is a useful extension point in LangChain and we love highlighting what the community builds with it:

Add an official integration

Follow the contributing guide to build and publish a middleware package.

Share a community middleware

Open a PR to the docs repo to add your middleware to the table below.

Official integrations

ProviderMiddleware availableSource
AnthropicPrompt caching, bash tool, text editor, memory, and file searchlangchain-ai/langchain
AWSPrompt cachinglangchain-ai/langchain-aws
OpenAIContent moderationlangchain-ai/langchain

Community integrations

MiddlewareDescriptionSource
Cisco AI DefenseRuntime security inspectioncisco-ai-defense/ai-defense-langchain-middleware
compact-middlewareClaude Code’s compaction engine as LangChain middleware. Multi-level context compaction for long-running agents.emanueleielo/compact-middleware