This project implements a sophisticated multi-agent research system based on the concepts described in Anthropic's article: Building a Multi-Agent Research System. The system leverages the power of coordinated AI agents to handle deep and complex research queries that require multiple perspectives and iterative investigation. Overview The system is built around a **Lead Research Agent** that orchestrates the entire research process. This lead agent has access to a powerful deployAgent tool that can dynamically create specialized **Research Subagents** to handle specific aspects of complex queries. The lead agent can deploy multiple subagents simultaneously and can choose to deploy additional subagents after each iteration based on the evolving needs of the research task. This multi-agent architecture enables the system to: - Break down complex queries into manageable sub-tasks - Perform parallel research across multiple domains - Iterate and refine research based on intermediate findings - Synthesize results from multiple specialized agents Architecture System Components Lead Research Agent The **Lead Research Agent** is the orchestrator of the entire system. It: - **Analyzes** incoming complex queries and determines the best approach - **Deploys** multiple subagents using the deployAgent tool - **Coordinates** parallel research activities - **Synthesizes** results from all subagents into comprehensive answers - **Iterates** by deploying additional subagents based on intermediate findings - **Manages** conversation history and compresses it when needed (>20 messages) **Key Features:** - Uses Gemini Pro model for advanced reasoning - Supports up to 50 iterations for complex tasks - Parallel tool execution capabilities - Dynamic subagent deployment and management Research Subagents **Research Subagents** are specialized agents created by the lead agent to handle specific research tasks. Each subagent: - **Focuses** on a specific aspect of the research query - **Searches** the web using natural language queries - **Fetches** detailed content from specific URLs - **Reports** findings back to the lead agent **Key Features:** - Uses Gemini Flash model for efficient processing - Optimized for focused research tasks (30 iterations max) - Equipped with web search and content fetching tools - Unique identification for tracking and coordination Agent Workflow 1. **Query Reception**: Complex research query received via MCP or REST API 2. **Analysis**: Lead agent analyzes the query and creates research strategy 3. **Deployment**: Lead agent deploys initial set of subagents with specific tasks 4. **Parallel Research**: Multiple subagents work simultaneously on different aspects 5. **Progress Evaluation**: Lead agent evaluates intermediate results 6. **Iterative Deployment**: Additional subagents deployed if needed 7. **Synthesis**: Lead agent combines all findings into comprehensive answer 8. **Response**: Final research results returned to client Technology Stack Koog Framework This implementation is built using the Koog AI Framework, a Kotlin-based framework for building sophisticated AI agent systems. Koog provides: - **Agent Management**: Core agent lifecycle and execution management