A primary LLM decomposes a complex task into manageable subtasks, then orchestrates the workflow of specialized worker agents to achieve the overall objective. each worker is dedicated to a single, clearly defined subtask. These workers can take different forms:
- Agents that generate outputs in a precise, structured format.
- Agents with external tools to perform specific functions.
- Components operating with pre-defined heuristics, which may not rely on a LLM for intelligent behavior.
At the heart of this approach is the supervisor LLM, which holds a complete understanding of the entire process workflow. The supervisor acts as a semantic router, dynamically invoking and coordinating the specialized workers in order to achieve the main goal.
The agency’s core mission is to research and deliver refined, detailed market purchase reports for clients focused on the latest trends in electronics and technologies. Consequently, the agency maintains a closed-domain focus
-
Query Generator
An LLM dynamically generates a set of search queries based on the user's input. It leverages awareness of the current date to ensure that the queries remain relevant and timely.
-
Web Researcher
Using the Tavily search tool, this component executes the generated queries on the web. It retrieves a predefined number of search results for each query. Heuristics are applied to remove duplicates and refine the results, ensuring that the final set is both unique and human-readable.
-
Report Writer
An LLM takes the refined search results and composes a detailed report in markdown format. It also determines a context-appropriate file name that succinctly reflects the report's content.
-
Supervisor
The supervisor LLM has a comprehensive understanding of the capabilities of all worker agents. It orchestrates the complete workflow by dividing the main task into manageable subtasks and routing them to the appropriate components. Once all steps are completed, the supervisor utilizes a tool to save the final report to disk using the generated file name.
- Messages: Each worker contributes by recording the status of task completions or failures. The supervisor provides reasoning behind selecting the next worker.
- Queries: Search queries generated by the search query generator.
- Report Text: Markdown report produced by the writer.
- Report Filename: Proposed filename for the report.
- Error: Indicates whether an error has occurred.
- Agency specialization and rationale for operating in a closed domain.
- Supervisors are instructed to answer only questions related to the agency.
- Supervisors must manage workers by understanding the workflow and individual capabilities.
- Include today's date in the query generator to ensure timely results.
- Report writers should create clear, well-structured reports using proper Markdown formatting
🟩 User: I need to buy a laptop in Egypt with best cost for training ai models.
🟪 Supervisor: The user request is clear and falls within our scope. We need to generate relevant search queries to begin researching laptops in Egypt that are suitable for training AI models. We'll start by routing the task to the search_query_generator to create search queries tailored to these specifications.
🟦 Search Query Generator: Generated search 5 queries.
🟪 Supervisor: The search queries have been generated, and the next step in the workflow is to conduct research using these queries to gather market data, specs, and pricing information for laptops in Egypt suitable for AI model training. Therefore, routing to the researcher is the appropriate next step.
🟦 Researcher: Successfully completed research for provided search queries.
🟪 Supervisor: The researcher has completed the task and provided the necessary information. Now, it's time for the writer to utilize this research to create a comprehensive Markdown report to assist the client in making an informed laptop purchase decision.
🟦 Writer: Generated report. Suggested filename: AI_Laptops_Buying_Guide_Egypt_2025.md.
🟪 Supervisor: The writer has completed the report and suggests a filename for saving the document. The next step is to save this report to a Markdown file using the specified tool, following our workflow process.
🟧 Save file tool: Successfully saved report to ./results\AI_Laptops_Buying_Guide_Egypt_2025.md.
🟩 User: What is a python class?
🟪 Supervisor: The user request is not related to generating personalized electronics reports and therefore is outside the scope of our current workflow.
🟪 Supervisor: This inquiry is outside the scope of our electronics research agency.
