Deep Agents is a framework that simplifies the creation of complex artificial intelligence systems based on multi-agent architectures. The approach is based on dividing complex tasks among specialized agents, maximizing efficiency and resource management. ## Subagents: Specialization and Isolation Subagents solve the problem of context bloat, which occurs when an agent's context window fills up while performing a task. This can compromise performance, leading the agent into a state of inefficiency. Subagents operate in isolation, with their own context windows, preventing the main agent from being burdened by intermediate results and unnecessary tool calls. **When to use subagents:** * Preserve context in complex tasks. * Specialize agents for specific domains. * Use different models to optimize latency. * Parallelize task execution. The creation of subagents occurs through the definition of configuration dictionaries, passed to the `create_deep_agent()` function. It is essential to provide clear descriptions and detailed system prompts to guide the main agent in choosing the appropriate subagent. ## Skills: Progressive Disclosure of Capabilities Skills offer a model of progressive capability disclosure. Instead of providing the agent with a large set of tools right away, skills define specialized capabilities in SKILL.md files. The agent views the names and descriptions of the skills, loading the complete instructions only when needed. **Configuring skills:** Skills use the agentskills.io specification, with SKILL.md files containing YAML metadata and a main body. Adding skills to the agent is done via the `skills` argument of the `create_deep_agent` function, specifying the path to the filesystem containing the SKILL.md files. ## Choosing the Right Pattern The choice between subagents and skills depends on the specific needs of the project. Subagents are ideal for delegating complex tasks and preserving context, while skills are suitable for reusing procedures and sharing capabilities across multiple agents. In many cases, a hybrid approach that combines both models can offer the best results. Deep Agents provides the necessary abstractions to create sophisticated multi-agent systems, simplifying context management and capability disclosure.