Skip to content

Waqas01CP/Autonomous-Research-Concierge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autonomous Research Concierge

Gemini Powered ADK Python Docker License

A Multi-Agent System that bridges the gap between vague human intent and professional-grade research through autonomous orchestration.

This project is a submission for the Kaggle Agents Intensive Capstone.

🔗 Live Demo: Deployed on Railway


📖 Project Overview

The Autonomous Research Concierge is designed to solve the "garbage-in, garbage-out" problem inherent in standard LLM interactions. Instead of hallucinating answers to vague prompts, this system enforces a structured workflow: Clarify → Research → Refine → Deliver.

It acts as a personal research assistant that interviews you to understand your specific needs (audience, depth, focus) before triggering a team of specialized autonomous agents to conduct parallel research, draft content, and rigorously critique their own work until it meets quality standards.

Project Thumbnail


🧐 Problem Statement

Manual research is laborious. It requires opening dozens of tabs, synthesizing conflicting information, and formatting it manually—a process that can take hours. Furthermore, standard LLMs often fail at deep research because users rarely provide perfect prompts on the first try. A single "monolithic" agent trying to research, write, and edit simultaneously often suffers from context overload, leading to generic or hallucinated outputs.

💡 Solution Statement

The Autonomous Research Concierge solves this by decomposing the research process into a Multi-Agent System.

  • The Interviewer: A dedicated agent ensures requirements are clear before any work begins.
  • The Specialists: Three parallel researchers (Academic, Market, Technical) gather diverse data simultaneously, reducing hallucination by grounding answers in real-time web search.
  • The Editor: A refinement loop ensures the first draft is never the final draft. A Critic agent forces revisions until quality standards are met.

⚙️ Model Configuration

This system was designed and tested with a deliberate model split. The Critic role intentionally uses a more capable model than the worker agents — critique quality is the primary quality bottleneck in multi-agent research pipelines.

Role Designed & Tested On Current Live Deployment
Worker agents (researchers, drafter) gemini-2.5-flash gemini-2.5-flash
Critic & Formatter gemini-2.5-pro gemini-2.5-flash ⚠️

⚠️ Deployment Note: The live deployment runs all roles on gemini-2.5-flash due to free-tier API constraints — gemini-2.5-pro has no free quota via the Gemini API. Output quality is degraded from the intended design, particularly in critique depth, citation quality, and report formatting. The system will not perform as intended when the Critic is below gemini-2.5-pro. To restore intended performance, set critic_model in config.py to gemini-2.5-pro with a paid API key.

💡 Potential Upgrade: This system was built and validated on the Gemini 2.5 series. The newer Gemini 3 series (gemini-3-flash-preview for workers, gemini-3.1-pro-preview for critic) may produce better outputs given the significant benchmark improvements of the 3 series over 2.5. However, this has not been tested against the current agent instructions — behaviour may differ. Upgrade with caution and re-test locally before deploying.

To configure models, edit research_agent/config.py:

# Worker agents — free tier available
worker_model = Gemini(model="gemini-2.5-flash", ...)

# Critic & Formatter — requires paid API key for intended performance
critic_model = Gemini(model="gemini-2.5-pro", ...)

🏗️ Architecture & Component Breakdown

The core of the system is the AutonomousPipeline, an ecosystem of specialized agents powered by Google's Agent Development Kit. It is not a monolithic script but a modular assembly of distinct intelligences.

1. The Orchestrator: ResearchConcierge

  • File: research_agent/agent.py
  • Role: The front-desk interface.
  • Behavior: Configured with a strict system instruction to never answer research questions directly. Instead, it acts as a requirement gatherer, interviewing the user until it has sufficient variables (Topic, Focus, Audience) to invoke the pipeline tool.

2. The Bridge Tool: run_research_pipeline

  • File: research_agent/tools.py
  • Functionality: A custom function tool that bridges the conversational front-end with the autonomous back-end.
  • Key Feature: Session Isolation. This function explicitly instantiates a new InMemorySessionService() for every request. This ensures that the thousands of tokens generated by sub-agents (raw HTML, internal debates) never pollute the user's main chat context.

3. The Specialist Sub-Agents

Defined in research_agent/internal_agents.py, these agents execute the work:

  • IntentSynthesisAgent: A "Context Compressor" that takes the chat history and distills it into a single, high-fidelity "Master Research Directive."
  • SecurityGuardrailAgent: A deterministic BaseAgent class that scans the directive for malicious intent (e.g., hacking instructions) before allowing any web access.
  • TechBackgroundResearcher: Specializes in theoretical architecture, algorithms, and academic concepts.
  • ExistingSolutionsResearcher: Scans the market for competitors, SOTA papers, and benchmarks.
  • ToolsAndTechResearcher: Identifies practical frameworks, libraries, and tech stacks relevant to the topic.
  • DynamicCriticAgent: The quality gatekeeper. It compares the generated draft against the user's original intent and outputs structured critiques.

4. The Refinement Loop

  • Pattern: LoopAgent
  • Logic: The system utilizes a while loop logic controlled by the ReportValidationAgent. The drafting process continues iteratively until the Critic outputs an explicit "APPROVED" signal.
graph TD
    subgraph "User Interface"
        User
    end

    subgraph "Root Agent: The Research Concierge"
        Concierge[Research Concierge Agent]
        User -- "I want to research X" --> Concierge
        Concierge -- "Asks Clarifying Questions" --> User
        User -- "Provides Answers" --> Concierge
        Concierge -- "Calls Tool with ALL info" --> Tool(run_research_pipeline)
    end

    subgraph "Function Tool: The Autonomous Pipeline"
        Tool --> Security[Phase 1: SecurityGuardrail]
        Security --> Parallel
        
        subgraph "Phase 2: Parallel Research"
            Parallel[ResearchTeam]
            Parallel --> R1[TechBackgroundResearcher]
            Parallel --> R2[ExistingSolutionsResearcher]
            Parallel --> R3[ToolsAndTechResearcher]
        end

        R1 & R2 & R3 --> Findings(Raw Findings)
        Findings --> Loop

        subgraph "Phase 3: Refinement Loop"
            Loop --> Draft[DraftingAgent]
            Draft --> Critic[CriticAgent]
            Critic -- "Rejection" --> Draft
            Critic -- "Approval" --> Validator[Validator]
        end
        
        Validator --> Format[Phase 4: FormattingAgent]
    end
    
    Format --> Final[Final Polished Report]
    Final --> Concierge
Loading

🔄 Detailed Workflow

  1. Interview (Requirement Gathering): The Concierge Agent intercepts the user request. Instead of answering, it asks clarifying questions about Target Audience, Specific Focus, and Technical Depth.
  2. Context Synthesis: Once the user answers, an internal agent synthesizes the chat history into a "Master Research Directive."
  3. Security Check: A deterministic guardrail scans the directive for malicious intent (e.g., "how to hack") before allowing access to external tools.
  4. Parallel Research: The directive is sent to three specialist agents simultaneously:
    • TechBackgroundResearcher: Focuses on theory and architecture.
    • ExistingSolutionsResearcher: Scans for competitors and papers.
    • ToolsAndTechResearcher: Recommends practical stacks.
  5. Drafting & Critique: The gathered data is passed to a Drafting Agent. The result is immediately reviewed by a Critic Agent. If the Critic rejects it, the Drafter must rewrite it based on feedback.
  6. Final Polish: Once approved, a Formatting Agent applies Markdown styling and citations before delivering the final report to the user.

🛠️ Essential Tools & Concepts

1. Custom Tool: run_research_pipeline

This function is the bridge between the Chat and the Work. Crucially, it implements Session Isolation. It creates a fresh, temporary memory space for the sub-agents. This ensures that the thousands of tokens generated during research (raw HTML, internal debates) do not pollute the user's main chat context.

2. Built-in Tool: google_search

Used by all research sub-agents to ground their findings in real-time data, ensuring the report is current and not limited by the model's training cutoff.

3. Orchestration Patterns

  • Sequential Agents: Used for the main pipeline flow to ensure dependencies are met.
  • Parallel Agents: Used to run researchers simultaneously to reduce latency.
  • Loop Agents: Used for the Draft/Critique cycle to ensure quality control.

📂 Project Structure

Autonomous-Research-Concierge/
├── research_agent/
│   ├── agent.py            # Entry point. Defines the Concierge and App wrapper.
│   ├── internal_agents.py  # Definitions of all sub-agents (Researchers, Critic, Guardrails).
│   ├── tools.py            # The custom tool logic that bridges Chat and Work.
│   ├── config.py           # Model configurations and API setups.
│   └── __init__.py         # Package initialization.
├── main.py                 # Production entry point. FastAPI app via get_fast_api_app().
├── Dockerfile              # Container definition for Railway deployment.
├── .env                    # API Keys (Not uploaded to GitHub).
├── .gitignore              # Security rules.
├── requirements.txt        # Python dependencies.
├── LICENSE                 # Apache 2.0 License.
└── README.md               # This file.

🚀 Deployment

Production (Docker + Railway)

This project is containerised and deployed on Railway using Docker.

# Build the image locally
docker build -t arc .

# Run locally via Docker
docker run -e GOOGLE_API_KEY=your_key -p 8080:8080 arc

The main.py file uses get_fast_api_app() from the ADK library to serve the agent as a production FastAPI application. adk web is a development-only tool and is not used in the deployed container.

Environment variables (API keys) are injected at runtime via Railway's Variables tab — never stored in the image or repository.

Local Development

# 1. Clone and set up environment
git clone https://github.com/Waqas01CP/Autonomous-Research-Concierge.git
cd Autonomous-Research-Concierge
python -m venv venv

# Windows
.\venv\Scripts\activate
# macOS/Linux
source venv/bin/activate

# 2. Install dependencies
pip install -r requirements.txt

# 3. Configure credentials
# Create .env in root directory:
# GOOGLE_API_KEY=your_actual_gemini_api_key_here

# 4. Run development server
adk web

Open your browser at http://127.0.0.1:8000

Note: Run adk web from the root folder containing the research_agent directory.


💎 Value Statement

This agent reduces the time required for deep technical research by 90%. Instead of spending hours searching, reading, and summarizing, a user can simply answer three clarifying questions. The Parallel Execution architecture ensures speed, while the Refinement Loop guarantees that the final output is structured, cited, and professional, making it immediately usable for academic or business reports.


🏆 Competition Details

This project is submitted for the Kaggle Agents Intensive Capstone.

  • Track: Concierge Agents

📚 Resources & Credits

  • Google Agent Development Kit (ADK): Official Repository
  • Model Provider: Google AI Studio (Gemini)
  • Inspiration: The "Agent Shutton" sample provided by the Kaggle team was a reference for the multi-agent architectural style.
  • Visualization: Architecture diagrams created using Mermaid.js.

📄 License

This project is licensed under the Apache 2.0 License.

About

A Multi-Agent System built with Google ADK that cures LLM hallucinations. It interviews users, conducts parallel web research, and iteratively refines drafts to produce professional reports

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors