Agente de tareas jerárquicas
Este flujo usa un equipo jerárquico de agentes de IA (CrewAI) para investigación compleja. Un Gerente delega a un Investigador y un Editor para asegurar una respuesta fiable y verificada.
+3
graph TD
%%{init: {'theme': 'mc','layout': 'elk'}}%%
ChatOutput-1ki92[<div><img src="/_astro/messages-square.BaSDmT6g.svg" style="height: 20px !important;width: 20px !important"/></div>Chat Output]
style ChatOutput-1ki92 stroke:#a170ff
Prompt-1d7fs[<div><img src="/_astro/square-terminal.BMOXc-nZ.svg" style="height: 20px !important;width: 20px !important"/></div>Prompt]
style Prompt-1d7fs stroke:#a170ff
ChatInput-niave[<div><img src="/_astro/messages-square.BaSDmT6g.svg" style="height: 20px !important;width: 20px !important"/></div>Chat Input]
style ChatInput-niave stroke:#a170ff
CrewAIAgent-4hpce[<div><img src="/_astro/crewai.CIO1Tb4h.svg" style="height: 20px !important;width: 20px !important"/></div>Editor Agent]
style CrewAIAgent-4hpce stroke:#a170ff
CrewAIAgent-azzrz[<div><img src="/_astro/crewai.CIO1Tb4h.svg" style="height: 20px !important;width: 20px !important"/></div>Manager Agent]
style CrewAIAgent-azzrz stroke:#a170ff
CrewAIAgent-syb3i[<div><img src="/_astro/crewai.CIO1Tb4h.svg" style="height: 20px !important;width: 20px !important"/></div>Research Agent]
style CrewAIAgent-syb3i stroke:#a170ff
HierarchicalTask-na6d4[<div><img src="/_astro/crewai.CIO1Tb4h.svg" style="height: 20px !important;width: 20px !important"/></div>Hierarchical Task]
style HierarchicalTask-na6d4 stroke:#a170ff
HierarchicalCrew-zc0xb[<div><img src="/_astro/crewai.CIO1Tb4h.svg" style="height: 20px !important;width: 20px !important"/></div>Crew]
style HierarchicalCrew-zc0xb stroke:#a170ff
OpenAIModel-dkg5c[<div><img src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>LLM]
style OpenAIModel-dkg5c stroke:#a170ff
OllamaWebSearch-4f66r[<div><img src="/_astro/Ollama.D_3DT10O.svg" style="height: 20px !important;width: 20px !important"/></div>Ollama Web Search]
style OllamaWebSearch-4f66r stroke:#a170ff
OllamaTurboModel-wbjnr[<div><img src="/_astro/Ollama.D_3DT10O.svg" style="height: 20px !important;width: 20px !important"/></div>Ollama Cloud]
style OllamaTurboModel-wbjnr stroke:#a170ff
OllamaTurboModel-lz82z[<div><img src="/_astro/Ollama.D_3DT10O.svg" style="height: 20px !important;width: 20px !important"/></div>Ollama Cloud2]
style OllamaTurboModel-lz82z stroke:#a170ff
OllamaTurboModel-q40bu[<div><img src="/_astro/Ollama.D_3DT10O.svg" style="height: 20px !important;width: 20px !important"/></div>Ollama Cloud3]
style OllamaTurboModel-q40bu stroke:#a170ff
Prompt-1d7fs -.- HierarchicalTask-na6d4
linkStyle 0 stroke:#a170ff
HierarchicalTask-na6d4 -.- HierarchicalCrew-zc0xb
linkStyle 1 stroke:#a170ff
CrewAIAgent-syb3i -.- HierarchicalCrew-zc0xb
linkStyle 2 stroke:#a170ff
CrewAIAgent-4hpce -.- HierarchicalCrew-zc0xb
linkStyle 3 stroke:#a170ff
OpenAIModel-dkg5c -.- HierarchicalCrew-zc0xb
linkStyle 4 stroke:#a170ff
CrewAIAgent-azzrz -.- HierarchicalCrew-zc0xb
linkStyle 5 stroke:#a170ff
HierarchicalCrew-zc0xb -.- ChatOutput-1ki92
linkStyle 6 stroke:#a170ff
OllamaWebSearch-4f66r -.- CrewAIAgent-syb3i
linkStyle 7 stroke:#a170ff
OllamaTurboModel-wbjnr -.- CrewAIAgent-syb3i
linkStyle 8 stroke:#a170ff
OllamaTurboModel-lz82z -.- CrewAIAgent-4hpce
linkStyle 9 stroke:#a170ff
OllamaTurboModel-q40bu -.- CrewAIAgent-azzrz
linkStyle 10 stroke:#a170ff
ChatInput-niave -.- Prompt-1d7fs
linkStyle 11 stroke:#a170ff
Agente de tareas jerárquicas (Hierarchical Task Agent)
🧩 Overview
This workflow implements a hierarchical, multi-agent AI system designed to handle complex user queries with integrated quality control. It functions as an intelligent assistant where a central manager agent evaluates incoming questions, delegates specialized tasks to research and editor agents when necessary, and consolidates their findings to deliver a reliable and validated final answer. This structure automates the process of gathering, verifying, and synthesizing information from the web.
⚙️ Main Features
- Employs a hierarchical crew of specialized AI agents (Manager, Researcher, Editor) to decompose and solve complex tasks.
- Integrates a web search tool, allowing the research agent to gather real-time information from the internet.
- Includes a dedicated editorial review step to check gathered information for biases or misleading data.
- Uses a structured prompt to frame the user's query as a clear task for the agent team.
- Delivers the final, consolidated response directly to a chat interface.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Chat Input | Captures the initial user query from the interface. | User's text input | User's query as a structured message |
| Prompt | Formats the user's query into a clear instruction for the agent team. | User's query | A structured task description |
| Hierarchical Task | Defines the core task to be executed by the agent crew, including the expected output format. | Task description from the prompt | A formalized task object for the crew |
| Research Agent | A specialized agent responsible for searching the web to find information relevant to the user's query. | Language model, Web search tool | An agent configured for research |
| Editor Agent | A specialized agent responsible for reviewing the gathered information to detect biases or misleading data. | Language model | An agent configured for editorial review |
| Manager Agent | The central coordinator that can answer simple queries directly or delegate complex ones to the research and editor agents. | Language model | An agent configured for management and delegation |
| Ollama Web Search | Provides the research agent with the capability to perform live web searches. | Search query | A tool that can execute web searches |
| Ollama Cloud (Research) | The language model that powers the research agent's reasoning and tool use. | - | A language model instance for the research agent |
| Ollama Cloud (Editor) | The language model that powers the editor agent's critical review. | - | A language model instance for the editor agent |
| Ollama Cloud (Manager) | The language model that powers the manager agent's coordination and decision-making. | - | A language model instance for the manager agent |
| OpenAI Model | The language model used by the hierarchical crew's internal manager for orchestrating task delegation among agents. | - | A language model instance for crew orchestration |
| Crew | Orchestrates the collaboration between the manager, research, and editor agents to execute the defined task. | Manager agent, Research agent, Editor agent, Task, Manager language model | The final, consolidated answer from the agent team |
| Chat Output | Displays the final, validated answer from the crew to the user in the chat interface. | Final answer from the crew | Formatted message displayed to the user |
🧠 Notes
- The workflow is built on the CrewAI framework, which specializes in orchestrating collaborative multi-agent systems.
- The quality of the final output depends on the capabilities of the underlying language models (Ollama Cloud and OpenAI) and the accuracy of the web search results.
- The manager agent uses a hierarchical delegation strategy, meaning it decides whether to answer directly or involve specialized agents based on the complexity of the query.
- Proper API credentials for Ollama Cloud and OpenAI are required for the respective model components to function.
- The editorial review step adds a layer of verification but does not guarantee complete factual accuracy.