Skip to content

johntooth/village

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Village 🏘️

AI-powered support system for Australian mothers and expectant parents

A multi-agent AI system providing evidence-based health information and emotional support through intelligent agent coordination.


🎯 Project Status

Current Phase: MVP Backend Development Status: Agents implemented, testing in progress

What's Working

  • ✅ Health Information Agent (Groq + Google Search)
  • ✅ General Support Agent (Groq, conversational)
  • ✅ A2A Coordinator with intelligent routing
  • ✅ Agent architecture and design

In Progress

  • 🔄 Dependency installation and testing
  • 🔄 Agent verification and deployment prep

🚀 Quick Start

Backend Setup

# 1. Install Python dependencies
cd village_ai
pip install -r requirements.txt

# 2. Configure environment
cp .env.example .env
# Edit .env and add:
# - GOOGLE_CLOUD_PROJECT=your-project-id
# - GROQ_API_KEY=your-groq-api-key

# 3. Test agents
python agents/health_agent.py
python agents/general_agent.py
python agents/coordinator.py

# 4. Run tests
python -m pytest tests/

✨ Features

Multi-Agent System

  • Health Information Agent - Evidence-based health advice with citations from trusted Australian sources
  • General Support Agent - Emotional support and general guidance
  • Services Agent - Local support services and resources finder
  • A2A Coordinator - Intelligent routing between agents based on query analysis

Smart Capabilities

  • Citation System - All health advice includes trusted source references
  • Australian Focus - Prioritizes Australian health authorities (health.gov.au, rednose.org.au, etc.)
  • Session Management - Maintains conversation history and user context
  • Observability - Comprehensive logging, tracing, and metrics

🏗️ Architecture

Backend (Python)

  • Groq LLM - Fast, free inference with Llama 3.3 70B (14.4K requests/day free tier)
  • Google Gemini - Gemini 2.0 Flash for services agent
  • Google Search - Real-time information retrieval for health queries
  • Agent2Agent (A2A) - Multi-agent coordination protocol
  • Session Manager - In-memory conversation history
  • Observability - Structured logging, distributed tracing, metrics

Tech Stack

User Query
    ↓
A2A Coordinator (keyword-based routing)
    ↓
    ├─→ Health Information Agent → Google Search → Citations
    ├─→ General Support Agent → Conversational Response
    └─→ Services Agent → Local Resources
    
All agents → Session Manager → Conversation History
All agents → Observability → Logs, Traces, Metrics

📁 Project Structure

village_ai/
├── agents/                    # Python agents
│   ├── coordinator.py        # Multi-agent coordinator with A2A
│   ├── health_agent.py       # Health information with citations
│   ├── general_agent.py      # General support and guidance
│   ├── services_agent.py     # Local services finder
│   ├── a2a_protocol.py       # Agent-to-Agent protocol
│   ├── session_manager.py    # Session & conversation history
│   ├── observability.py      # Logging, tracing, metrics
│   └── search_tool.py        # Google Search integration
│
├── tests/                     # Python tests
│   ├── test_agents.py        # Agent unit tests
│   ├── test_components.py    # Component tests
│   └── test_integration.py   # Integration tests
│
├── docs/                      # Documentation
│   ├── architecture.md       # System architecture & diagrams
│   ├── data.md              # Data models, ERD & schema
│   └── directorymap.md      # Directory structure guide
│
├── requirements.txt          # Python dependencies
└── .env.example             # Environment template

🧪 Testing

Test Agent Creation

python -m pytest tests/test_agents.py -v

Test Routing Logic

from agents.coordinator import create_coordinator

coordinator = create_coordinator()

# Test queries
queries = [
    "How to dress baby for sleep?",  # → Health Agent
    "I'm feeling anxious",            # → General Agent
    "What is safe sleep?"            # → Health Agent
]

for query in queries:
    agent = coordinator.route_query(query)
    print(f"'{query}' → {agent}")

🎓 Course Concepts

All 4 required concepts implemented:

  1. Multi-Agent Systems

    • Health Information Agent with Google Search
    • General Support Agent for emotional support
    • Coordinator with intelligent routing
  2. Tool Integration

    • Google Search MCP for real-time information
    • Groq LLM API integration
    • Citation extraction from search results
  3. Agent2Agent (A2A) Protocol

    • Coordinator routes queries to appropriate agents
    • Agents communicate via standardized A2A protocol
    • Context passing between agents
  4. Sessions & Memory

    • In-memory session management
    • User context tracking (location, preferences)
    • Conversation history with message persistence
    • Session lifecycle management

💰 Cost

All services use free tiers:

Service Free Tier Usage
Groq API 14.4K req/day LLM inference
Google Search Limited free Information retrieval
Vertex AI 1K queries/month Agent hosting (planned)

Total Cost: $0/month ✅


🔒 Safety & Privacy

  • Evidence-Based - All health advice includes citations from trusted sources
  • Australian Focus - Prioritizes Australian health authorities
  • Clear Disclaimers - Agents provide appropriate medical disclaimers
  • No Diagnosis - System provides information, not medical diagnosis
  • Trusted Sources - health.gov.au, rednose.org.au, raisingchildren.net.au

📚 Documentation

Architecture & Design

  • architecture.md - System architecture with Mermaid diagrams

    • Component architecture
    • Request flow sequences
    • Deployment architecture
    • Scalability & security
  • data.md - Data models, ERD, and schema documentation

    • Entity relationship diagrams
    • Data models (Session, Message, Trace, Metric)
    • JSON schemas
    • Database schema (SQL)
    • Data flow diagrams
  • directorymap.md - Complete directory structure guide

    • File-by-file descriptions
    • Purpose and responsibilities
    • Usage examples
    • Dependency graphs

Code Documentation


🤝 Contributing

This is a capstone project for the Google Cloud Agent Development course.


📄 License

MIT License - See LICENSE file for details


🙏 Acknowledgments

  • Google Cloud - Agent Development Kit and course materials
  • Groq - Fast LLM inference
  • Australian Health Authorities - Trusted health information

Built for Australian mothers and families 🏘️

About

A new project for the joy of projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published