中间件提供了一种更精细控制智能体内部行为的方式。中间件适用于以下场景: 通过将中间件传递给Documentation Index
Fetch the complete documentation index at: https://langchain-zh.cn/llms.txt
Use this file to discover all available pages before exploring further.
create_agent 来添加:
智能体循环
核心智能体循环包括调用模型、让其选择要执行的工具,并在其不再调用工具时结束:

更多资源
内置中间件
探索常见用例的内置中间件。
自定义中间件
使用钩子和装饰器构建自定义中间件。
中间件 API 参考
完整的中间件 API 参考。
测试智能体
使用 LangSmith 测试您的智能体。
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

