Legion ADK - Autonomous Research Intelligence
🏛️ AI research team that delivers professional documents in minutes ⚔️
Built with Google Cloud • Gemini AI • Python • FastAPI
🏛️ Inspiration
Roman legions conquered the world through specialization—each soldier had a distinct role that made the unit unstoppable. We applied this principle to AI research: instead of one general-purpose AI, we built four specialized agents working as a coordinated team. CONSUL plans the mission, CENTURION gathers intelligence, AUGUR analyzes findings, and SCRIBE creates deliverables. This division of labor makes Legion far more effective than traditional research tools.
⚔️ What it does
Legion transforms research requests into professional Google Workspace documents automatically. You describe what you need to research, and Legion:
- Plans the research mission and generates strategic questions
- Collects data from multiple web sources with citations
- Analyzes findings to identify patterns and insights
- Creates polished Google Docs, Sheets, and Slides directly in your account
Real-world use cases include market research, competitive analysis, due diligence, and academic literature reviews. Everything is delivered with proper citations and professional formatting ready for presentations or client meetings.
🏗️ How we built it
Technology Stack:
- Backend: Python + FastAPI for agent orchestration
- Frontend: React + Vite for the web interface
- AI: Google Gemini Pro for natural language processing
- Research: Sonar API for comprehensive web search
- Integration: Google Workspace APIs for document creation
- Real-time: WebSocket streaming for live progress updates
Architecture: We implemented an Agent-to-Agent (A2A) communication protocol enabling seamless collaboration between specialized AI agents. Each agent has distinct capabilities but can hand off context and build upon each other's work. The system uses distributed state management to coordinate parallel research operations across multiple questions.
⚡ Challenges we ran into
Agent Coordination: Getting four independent AI agents to collaborate effectively required building a sophisticated communication protocol with structured task definitions and response formats.
API Rate Limiting: Sonar and Google Workspace APIs have strict limits. With 8 research questions running in parallel, we frequently hit bottlenecks. We solved this with intelligent request batching and exponential backoff strategies.
Citation Management: Ensuring every insight could be traced back to its source while maintaining readability required building a dual-layer citation system with inline references and comprehensive bibliographies.
Google Workspace Integration: Creating professional documents programmatically proved complex. Google's APIs require specific formatting structures, and maintaining styling while dynamically inserting content required deep understanding of their document object model.
🏆 Accomplishments that we're proud of
Autonomous End-to-End Research: Legion takes a simple request and delivers publication-ready documents without human intervention. During development, it completed over 200 research missions with consistent quality.
50x Speed Improvement: Traditional comprehensive research takes 2-5 days. Legion delivers equivalent depth and quality in 15-30 minutes.
Direct Google Integration: Documents appear natively in users' Google Drive—no downloads, imports, or formatting issues. Everything is ready for immediate use.
Real-time Transparency: Users can watch their AI research team work through WebSocket streaming, seeing messages like "CENTURION collecting market sizing data" in real-time.
📚 What we learned
Specialization Beats Generalization: Four focused AI agents outperform one general-purpose AI. Each agent developed distinct personality traits that enhanced their specific function.
User Experience Trumps Features: Researchers care more about deliverable quality than technical capabilities. Our Google Workspace integration proved more valuable than advanced analytics features.
Real-time Feedback Builds Trust: Showing progress significantly improved user confidence even when total processing time remained the same.
Citation Standards Matter: Academic research requires different formats than business intelligence. Building flexible citation systems that adapt to context was essential for broad adoption.
🚀 What's next for Legion
User Data Integration: We're adding the ability for Legion to access and analyze your company's internal data (documents, emails, databases, CRM systems) alongside web research. This enables true comparative analysis—imagine asking "How does our Q4 performance compare to industry benchmarks?" and getting insights that blend your internal metrics with external market data.
Expanded Agent Capabilities:
- LEGATE for technical and scientific research with deep domain expertise
- PRAETOR for competitive intelligence and strategic market positioning
Enterprise Features:
- Slack integration for seamless research deployment
- Multi-user collaboration on research campaigns
- Industry-specific research templates and frameworks
- Custom data source integrations (Salesforce, HubSpot, internal databases)
The user data integration will transform Legion from a web research tool into a comprehensive business intelligence platform that understands your organization's unique context.
🛠️ Tech Stack
- Languages: Python, JavaScript/TypeScript, HTML/CSS
- Frontend: React with Vite
- Backend: FastAPI with Python
- Cloud: Google Cloud Platform with Firestore
- APIs: Google Gemini Pro, Sonar Search, Google Workspace
Legion ADK - Where Roman precision meets modern AI

Log in or sign up for Devpost to join the conversation.