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

 
 
 

Contributors