DeepAgents core understandings and developement of advanced ai agents. With memory, skill, tools, subagents, multiagents flow etc.
uv init deepagents//Initialize the Projectcd deepagentsuv venv// Lock and Setup the Environmentuv run main.py//run the project (optional - make sure correct setup is done)
- Now, from the correct path:
- Create a requirements.txt file with correct module and other requirements.
uv add -r requirements.txt//migrate the requirements.uv pip install -r requirements.txt//install the dependencies and required modules/lib.
For CompositeStore and StoreBackend : to maintain chat history and memory across different threads in persistence manner.
A deep agent can create subagents to delegate work. You can specify custom subagents in the subagents parameter. Subagents are useful for context quarantine (keeping the main agent’s context clean) and for providing specialized instructions.
Subagents solve the context bloat problem. When agents use tools with large outputs (web search, file reads, database queries), the context window fills up quickly with intermediate results. Subagents isolate this detailed work—the main agent receives only the final result, not the dozens of tool calls that produced it.
-
Async subagents let a supervisor agent launch background tasks that return immediately, so the supervisor can continue interacting with the user while subagents work concurrently. The supervisor can check progress, send follow-up instructions, or cancel tasks at any point.
-
Use async subagents when tasks are long-running, parallelizable, or need mid-flight steering.
-
The AsyncSubAgentMiddleware which is included in the default middleware stack when async subagents are configured, gives the supervisor five tools:

-
The supervisor’s LLM calls these tools like any other tool. The middleware handles thread creation, run management, and state persistence automatically.
For a detailed walkthrough of building and running Async Subagents with DeepAgents and LangGraph, see:
- 🚀 Introduction to Async Subagents
- 🏗️ Architecture and execution flow
- 📁 Recommended project structure
- ⚙️ Step-by-step setup and installation
▶️ Running the LangGraph runtime- 🤖 Integrating Ollama with DeepAgents
- 🔗 Understanding
graph_idandlanggraph.json - 🧩 Creating and registering subagent graphs
- 📨 Invoking the supervisor and launching background tasks
- 🐞 Common errors and troubleshooting
- ✅ Best practices for production-ready implementations
- 🎯 End-to-end example from setup to execution
Observability/Tracing with Langsmith and Logfire, see:






