๐— ๐—ถ๐—ฑ๐—ฑ๐—น๐—ฒ๐˜„๐—ฎ๐—ฟ๐—ฒ ๐—ถ๐—ป ๐——๐—ฒ๐—ฒ๐—ฝ๐—”๐—ด๐—ฒ๐—ป๐˜๐˜€

Middleware sits between parts of your agent system. It manages the flow of information.

In Deep Agents, middleware works between the user request, the model, and tool execution.

You use different types of middleware for different jobs:

Not all middleware verify data. Some track progress. Others log activity.

The framework adds some middleware automatically. Use create_deep_agent() and you get TodoListMiddleware and PatchToolCallsMiddleware.

TodoListMiddleware creates a plan. Ask for the weather of the most popular city in India. The middleware makes a list:

Tool outputs go to the agent state. The middleware only tracks progress.

Some middleware come by default. You add others based on your needs.

Source: https://dev.to/uma_baleboyina_1cb374cc73/middleware-in-deepagents-3la0 Optional learning community: https://t.me/GyaanSetuAi