Hierarchical Tasks Agent
This workflow uses a hierarchical team of AI agents (CrewAI) for complex research. A Manager delegates to an Investigator and an Editor to ensure a reliable and verified response.
+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
đź§© Overview
The workflow orchestrates a hierarchical team of AI agents to handle user queries, automatically delegating tasks, researching online, and validating results. By combining a manager, a researcher, and an editor agent, the system delivers a concise, trustworthy answer that balances quick responses with rigorous fact‑checking. The approach simplifies complex knowledge‑retrieval tasks while ensuring quality control throughout the process.
⚙️ Main Features
- A hierarchical crew of agents is automatically assembled to address the user’s request.
- A manager agent evaluates the question and determines the required level of assistance.
- A researcher agent performs web searches to gather up‑to‑date information.
- An editor agent reviews the gathered data for bias or misinformation.
- The crew’s outputs are consolidated by a manager language model into a single, polished response.
- The final answer is presented directly in the chat interface for immediate user consumption.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Chat Input | Captures the user’s question and initial context. | User message | Structured message payload |
| Prompt | Builds a prompt for task creation from the user message. | Structured message payload | Prompt message |
| Hierarchical Task | Translates the prompt into a task description for the crew. | Prompt message | Task description |
| Manager Agent | Decides task delegation and coordinates other agents. | Task description | Manager agent instance (with Ollama Turbo model) |
| Research Agent | Conducts web searches to gather relevant data. | Task description | Search results data |
| Editor Agent | Validates and corrects the researcher’s output. | Search results data | Reviewed content |
| OpenAI Model | Provides a high‑quality manager language model for the crew. | Manager agent instance | Manager language model |
| Hierarchical Crew | Orchestrates the manager, researcher, and editor agents, then compiles their outputs. | Manager agent, Research Agent, Editor Agent, Manager LLM | Final answer message |
| Chat Output | Displays the final, validated response to the user. | Final answer message | Rendered chat message |
đź§ Notes
- The system relies on the OpenAI GPT‑4.1 model as the manager’s language engine, ensuring robust reasoning.
- Web‑search capability is delivered via the Ollama Cloud web‑search tool, enabling real‑time information retrieval.
- Each agent operates with its own language model instance, providing specialized expertise and reducing cross‑talk.
- The crew’s hierarchy guarantees that all responses are vetted by an editor, mitigating the risk of biased or incorrect information.
- The workflow is fully automated; no manual intervention is required once the user submits a query.