Skip to content

Naazimsnh02/policy_solution_creator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏛️ Policy Solution Creator

AI-Powered Multi-Agent System for Policy Analysis & Solution Design

Hackathon Track Kaggle Python Google ADK


📋 Table of Contents


🎯 Problem Statement

The Challenge

Policy makers, researchers, and social impact organizations face significant challenges when addressing complex societal issues:

  1. Information Overload: Vast amounts of data from multiple sources make it difficult to identify root causes and evidence-based solutions
  2. Time Constraints: Manual research and analysis can take weeks or months, delaying critical interventions
  3. Limited Global Perspective: Lack of awareness about successful international case studies and best practices
  4. Implementation Gaps: Difficulty translating research into actionable, context-specific implementation plans
  5. Resource Inefficiency: Duplication of research efforts across organizations working on similar problems

Real-World Impact

  • Healthcare: Rural areas struggle with limited access to quality healthcare services
  • Environment: Cities like Delhi face severe air pollution affecting millions of lives
  • Education: Educational inequality persists across socioeconomic divides
  • Employment: Youth unemployment requires targeted policy interventions

These problems require comprehensive, data-driven, and actionable solutions that consider local context while learning from global successes.


💡 Solution Overview

Policy Solution Creator is an AI-powered multi-agent system that transforms policy research and solution design from a weeks-long manual process into an automated, comprehensive analysis delivered in minutes.

What It Does

Given any policy issue (e.g., "Air Pollution in Delhi"), the system:

  1. Analyzes the Problem with current statistics, root causes, and impact assessment
  2. Researches Global Solutions by finding successful case studies from around the world
  3. Designs Context-Specific Solutions adapted to local political, economic, and social factors
  4. Creates Implementation Roadmaps with phased timelines, milestones, and success metrics
  5. Synthesizes Executive Summaries for decision-makers with actionable insights

Value Proposition

  • ⏱️ Time Savings: Reduces research time from weeks to 2-5 minutes
  • 📊 Data-Driven: Provides current statistics and evidence-based analysis
  • 🌍 Global Perspective: Identifies successful international case studies
  • 🎯 Actionable: Delivers specific, implementable solutions with roadmaps
  • 📚 Verified Sources: All findings backed by credible references

🤖 Why AI Agents?

The Power of Multi-Agent Systems

This problem is uniquely suited for AI agents because:

  1. Parallel Processing: Different aspects of policy analysis (problem analysis, comparative research) can happen simultaneously
  2. Specialized Expertise: Each agent focuses on a specific domain (analysis, research, design, planning)
  3. Context Sharing: Agents build upon each other's outputs for comprehensive solutions
  4. Autonomous Research: Agents independently search, analyze, and synthesize information
  5. Scalability: The system can handle any policy domain without reprogramming

Why Not Traditional Approaches?

  • Manual Research: Too slow, limited scope, prone to bias
  • Single LLM: Lacks depth, can't parallelize, limited context window
  • Rule-Based Systems: Inflexible, can't adapt to new domains
  • Multi-Agent AI: Fast, comprehensive, adaptive, and scalable

🏗️ Architecture

System Design

┌─────────────────────────────────────────────────────────────────┐
│                     Policy Solution Creator                      │
│                    (Sequential Orchestrator)                     │
└─────────────────────────────────────────────────────────────────┘
                                 │
                                 ├─────────────────────────────────┐
                                 │                                 │
                    ┌────────────▼──────────┐         ┌───────────▼──────────┐
                    │   PHASE 1: ANALYSIS   │         │  PHASE 2: SYNTHESIS  │
                    │   (Parallel Agents)   │         │ (Sequential Agents)  │
                    └────────────┬──────────┘         └───────────┬──────────┘
                                 │                                 │
                    ┌────────────┴──────────┐                     │
                    │                       │                     │
         ┌──────────▼──────────┐ ┌─────────▼─────────┐          │
         │  Problem Analyzer   │ │ Comparative       │          │
         │                     │ │ Researcher        │          │
         │ • Root Cause        │ │ • Case Studies    │          │
         │ • Statistics        │ │ • Best Practices  │          │
         │ • Impact            │ │ • Lessons Learned │          │
         │ • Sources           │ │ • Sources         │          │
         └──────────┬──────────┘ └─────────┬─────────┘          │
                    │                       │                     │
                    └───────────┬───────────┘                     │
                                │                                 │
                                │ Session State (InMemory)        │
                                │                                 │
                    ┌───────────▼─────────────────────────────────┘
                    │
         ┌──────────▼──────────┐
         │  Solution Designer  │
         │                     │
         │ • Context Analysis  │
         │ • Solution Design   │
         │ • Feasibility       │
         │ • Resources         │
         └──────────┬──────────┘
                    │
         ┌──────────▼──────────┐
         │  Roadmap Generator  │
         │                     │
         │ • 4 Phases          │
         │ • Milestones        │
         │ • Success Metrics   │
         │ • Risk Mitigation   │
         └──────────┬──────────┘
                    │
         ┌──────────▼──────────┐
         │ Executive Summary   │
         │                     │
         │ • Key Findings      │
         │ • Top 3 Solutions   │
         │ • Success Factors   │
         └─────────────────────┘

Agent Responsibilities

Agent Role Tools Output
Problem Analyzer Analyzes policy issues comprehensively Google Search, Date Tool Problem overview, statistics, root causes, impact assessment, sources
Comparative Researcher Finds global solutions and case studies Google Search, Date Tool Case studies, best practices, lessons learned, sources
Solution Designer Adapts global practices to local context Google Search, Session State Context-specific solutions, feasibility scores, resource requirements
Roadmap Generator Creates phased implementation plans Session State 4-phase roadmap, milestones, metrics, risk mitigation
Executive Summary Synthesizes insights for decision-makers Session State Overview, key findings, top 3 solutions, success factors

Data Flow

  1. User Input → Policy issue (e.g., "Air Pollution in Delhi")
  2. Phase 1 (Parallel) → Problem analysis + Comparative research run simultaneously
  3. Session State → Outputs stored in InMemorySessionService
  4. Phase 2 (Sequential) → Solution design → Roadmap → Executive summary (each builds on previous)
  5. Gradio UI → Formatted outputs displayed in tabs

✨ Key Features

1. Multi-Agent Architecture

  • Parallel Agents: Problem analysis and comparative research run simultaneously for speed
  • Sequential Agents: Solution design, roadmap, and summary build on each other for depth
  • Session Management: InMemorySessionService maintains state across agents

2. Advanced Tools Integration

  • Google Search: Real-time web search for current data and case studies
  • Custom Date Tool: Ensures agents use current date for recent information
  • JSON Schema Enforcement: Structured outputs for reliable parsing

3. Comprehensive Analysis

  • Root Cause Analysis: Identifies political, economic, social, and geographical factors
  • Evidence-Based: All findings backed by statistics and credible sources
  • Impact Assessment: Quantifies effects on communities and economies

4. Global Research

  • Case Studies: 3-5 successful international implementations
  • Best Practices: Cross-cutting lessons from multiple contexts
  • Transferability Assessment: Evaluates applicability to target location

5. Context-Aware Solutions

  • Local Adaptation: Considers political, economic, and social feasibility
  • Multiple Timelines: Short-term (0-6 months), medium-term (6-18 months), long-term (18+ months)
  • Feasibility Scoring: 1-10 scale for implementation practicality

6. Implementation Roadmaps

  • 4 Phases: Foundation → Pilot → Scale-Up → Optimization
  • Detailed Milestones: Specific deliverables with timelines
  • Success Metrics: Measurable KPIs for tracking progress
  • Risk Mitigation: Identified risks with mitigation strategies

7. Professional UI

  • Gradio Interface: Clean, intuitive web interface
  • Progress Tracking: Real-time status updates during analysis
  • Tabbed Outputs: Executive Summary, Full Analysis, Solutions & Roadmap, Sources
  • Markdown Formatting: Professional, readable output

🔧 Technical Implementation

Technologies Used

  • Google ADK (Agent Development Kit) 1.18.0: Multi-agent orchestration
  • Gemini 2.5 Flash: LLM for all agents
  • Gradio: Web interface
  • Python 3.10+: Core programming language
  • InMemoryRunner: Session and state management

ADK Features Demonstrated

Multi-Agent System

  • Parallel agents (problem_analyzer, comparative_researcher)
  • Sequential agents (solution_designer, roadmap_generator, executive_summary)
  • Hierarchical orchestration (root_agent → analysis_agent → synthesis_agent)

Tools

  • Built-in tools: google_search
  • Custom tools: get_current_date (FunctionTool)

Sessions & Memory

  • InMemorySessionService for state management
  • Session-based context sharing between agents
  • Output keys for structured data flow

Observability

  • Debug mode with run_debug()
  • Progress tracking and status updates
  • Error handling and logging

Gemini Integration

  • All agents powered by Gemini 2.5 Flash
  • JSON schema enforcement for structured outputs
  • Context-aware prompting

Code Quality

  • Comprehensive Comments: All functions and agents documented
  • Error Handling: Try-catch blocks with detailed error messages
  • Type Hints: Function signatures with return types
  • Modular Design: Separate formatting functions for each output type
  • JSON Parsing: Robust handling of LLM outputs (markdown code blocks, strings, dicts)

🚀 Setup Instructions

Prerequisites

  • Python 3.10 or higher
  • Google API Key (for Gemini)
  • Internet connection (for Google Search)

Installation

Option 1: Google Colab

  1. Open the Notebook

    Upload Capstone_Project_Policy_Solution_Creator.ipynb to Google Colab
    
  2. Add API Key

    • Go to Colab → Secrets (🔑 icon in left sidebar)
    • Add secret: GOOGLE_API_KEY = your_api_key_here
  3. Run All Cells

    • Runtime → Run all
    • Wait for Gradio interface to launch

Option 2: Kaggle Notebooks

  1. Upload Notebook

    Upload Capstone_Project_Policy_Solution_Creator.ipynb to Kaggle
    
  2. Add API Key

    • Add-ons → Secrets → Add Secret
    • Name: GOOGLE_API_KEY
    • Value: your_api_key_here
  3. Run Notebook

    • Run all cells
    • Access Gradio interface via public URL

Option 3: Local Setup

  1. Clone Repository

    git clone https://github.com/naazimsnh02/policy-solution-creator.git
    cd policy-solution-creator
  2. Install Dependencies

    pip install google-adk==1.18.0 gradio
  3. Set API Key

    export GOOGLE_API_KEY="your_api_key_here"
  4. Run Notebook

    jupyter notebook Capstone_Project_Policy_Solution_Creator.ipynb

Getting a Google API Key

  1. Visit Google AI Studio
  2. Click "Create API Key"
  3. Copy the key and add to your environment

📖 Usage Guide

Basic Usage

  1. Launch the Interface

    • Run all cells in the notebook
    • Wait for Gradio interface to appear
  2. Enter Policy Issue

    • Type your policy problem (e.g., "Traffic Management in Bangalore")
    • Or use the default example: "Air Pollution in Delhi"
  3. Generate Solution

    • Click "🚀 Generate Policy Solution"
    • Wait 2-5 minutes for analysis
  4. Review Results

    • Executive Summary: Quick overview for decision-makers
    • Full Analysis: Detailed problem analysis and case studies
    • Solutions & Roadmap: Specific solutions and implementation plan
    • Sources: All references and citations

Understanding the Output

Executive Summary

  • Overview: 2-3 sentence problem summary
  • Key Findings: 4-6 critical insights with data
  • Recommended Solutions: Top 3 solutions with impact and timeframe
  • Critical Success Factors: Essential elements for implementation

Full Analysis

  • Problem Analysis: Overview, statistics, root causes, impact
  • Comparative Research: Global case studies, best practices, lessons learned

Solutions & Roadmap

  • Proposed Solutions: 3-5 solutions with feasibility scores and resource requirements
  • Implementation Roadmap: 4 phases with milestones, metrics, and risk mitigation

Sources

  • Problem Analysis Sources: Citations for problem data
  • Comparative Research Sources: Citations for case studies

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🙏 Acknowledgments

Thank you to:

  • Google & Kaggle for the 5-Day AI Agents Intensive Course and capstone project

📞 Contact

Project Maintainer: [Syed Naazim Hussain]

Project Link: https://github.com/Naazimsnh02/policy_solution_creator


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors