Langchain Middleware

Guide on how to use LangChain's AgentMiddleware to add tools and inject system prompts into lc-agent agents, as opposed to registering tools via the @tool decorator. Use when adding tools that are tightly coupled with system prompt guidance (e.g. ask_user, write_todos), creating middleware that controls which agents receive specific tools, or injecting text blocks into agent system messages.

ydf0509 0878f1e 6.5 KB Updated

File contents

ydf0509/lc-agent/tree/main/.agents/skills/langchain-middleware commit 0878f1e5f8

Frequently asked questions

npx skillmds@latest add ydf0509/langchain-middleware