Skip to content

AbiliLife/AbiliLife-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Abby - AI Agent for AbiliLife

Abby is an intelligent AI agent built with Google's Agent Development Kit (ADK) to help persons with disabilities (PWDs) discover accessible services across Kenya.

Python Google ADK License


🎯 Purpose

Abby serves as the conversational AI backend for AbiliLife, an inclusive super-app. The agent helps users discover:

  • 🏥 Healthcare: Accessible clinics and medical facilities
  • 💼 Employment: Job opportunities for PWDs
  • 🚗 Transport: Accessible ride-hailing and public transport
  • 📚 Education: Inclusive learning centers and skills training
  • 🛒 Marketplace: Assistive devices and accessibility products

🏗️ Project Structure

AbiliLife-agent/
├── abby/                          # Main agent package
│   ├── agent.py                   # Root agent definition
│   ├── tools.py                   # Tool functions for data retrieval
│   ├── data/
│   │   └── accessible_services.json  # Mock service data
│   └── __init__.py
├── test_agent.py                  # Test script
├── requirements.txt               # Python dependencies
├── .env                           # Environment variables (not in repo)
├── .gitignore                     # Git ignore rules
├── README.md                      # This file
└── ARCHITECTURE.md                # Technical architecture documentation

🚀 Getting Started

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/AbiliLife/AbiliLife-agent.git
    cd AbiliLife-agent
  2. Create virtual environment

    python -m venv venv
    
    # Windows
    .\venv\Scripts\Activate.ps1
    
    # Linux/Mac
    source venv/bin/activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Configure API key

    Create a .env file in the project root:

    GOOGLE_API_KEY=your_google_api_key_here

Running Abby

Option 1: ADK Web Interface (Recommended)

adk web

Then open http://localhost:8000 in your browser.

Option 2: ADK CLI

adk run .

Option 3: Test Script

python test_agent.py

💬 Example Interactions

User: What cities do you cover?
Abby: Available cities: Kisumu, Mombasa, Nairobi, Nakuru

User: Find accessible clinics in Nairobi
Abby: I found 3 accessible services for you:

1. Hope Health Clinic (Healthcare)
   Location: Nairobi
   Accessibility Rating: 4.8/5.0
   Features: wheelchair_accessible, sign_language_support, accessible_parking
   Contact: +254 700 123 456
   ...

🛠️ Technical Stack

Component Technology
AI Framework Google Agent Development Kit (ADK) 1.16.0
LLM Model Gemini 2.0 Flash Exp
Language Python 3.9+
Data Storage JSON (mock), ready for database integration
Environment python-dotenv for configuration

🧩 Agent Architecture

Core Components

1. Agent (abby/agent.py)

  • Defines Abby's personality and instructions
  • Configures available tools
  • Manages conversation flow via ADK

2. Tools (abby/tools.py)

  • get_services_by_city(city, min_rating) - Find services by location
  • get_services_by_type(service_type, city, min_rating) - Filter by category
  • get_services_by_feature(feature, city) - Search by accessibility feature
  • get_all_cities() - List available cities
  • get_all_service_types() - List service categories

3. Data (abby/data/accessible_services.json)

  • Mock dataset with 10 services across 4 Kenyan cities
  • Ready for replacement with live API integration

How It Works

User Query → ADK Runtime → Abby Agent → Tool Selection → Data Retrieval → Response

See ARCHITECTURE.md for detailed flow diagrams.


📊 Current Features

✅ Implemented

  • ✅ Natural language understanding via Gemini
  • ✅ Location-based service discovery
  • ✅ Accessibility rating filtering (≥4.0)
  • ✅ Multi-category service search
  • ✅ Conversational, empowering responses
  • ✅ ADK web and CLI interfaces

🔜 Roadmap

  • 🔄 Integration with live APIs (Google Maps, job boards)
  • 🔄 Persistent session storage (Firestore/PostgreSQL)
  • 🔄 Voice input/output support
  • 🔄 Multilingual support (English, Swahili)
  • 🔄 REST API for mobile app integration
  • 🔄 User authentication and profiles

🧪 Development

Running Tests

python test_agent.py

Adding New Services

Edit abby/data/accessible_services.json:

{
  "id": "svc_011",
  "name": "Service Name",
  "type": "Healthcare|Employment|Transport|Education|Marketplace",
  "city": "City Name",
  "county": "County Name",
  "accessibility_rating": 4.5,
  "features": ["wheelchair_accessible", "sign_language_support"],
  "address": "Full address",
  "contact": "+254 XXX XXX XXX",
  "description": "Service description"
}

Creating New Tools

  1. Define function in abby/tools.py
  2. Add function to root_agent tools list in abby/agent.py
  3. ADK automatically converts it to a callable tool

Example:

# In abby/tools.py
def get_nearby_services(lat: float, lon: float, radius_km: float = 5.0) -> str:
    """Find services within radius of coordinates."""
    # Implementation
    return formatted_results

# In abby/agent.py
from .tools import get_nearby_services  # Add import

root_agent = Agent(
    ...
    tools=[
        ...
        get_nearby_services,  # Add to tools list
    ]
)

📡 Future Integration

REST API Endpoint (Planned)

from fastapi import FastAPI
from abby.agent import root_agent

app = FastAPI()

@app.post("/chat")
async def chat(message: str, session_id: str):
    # Integration code
    pass

React Native Integration (Planned)

const response = await fetch('https://api.abililife.com/abby/chat', {
  method: 'POST',
  body: JSON.stringify({
    message: "Find accessible clinics in Nairobi",
    session_id: user.id
  })
});

🤝 Contributing

We welcome contributions from the team! Please:

  1. Create a feature branch from main
  2. Make your changes
  3. Test thoroughly with python test_agent.py
  4. Submit a pull request

Code Style

  • Follow PEP 8 for Python code
  • Add docstrings to all functions
  • Include type hints
  • Test all changes before committing

📄 License

This project is part of the AbiliLife ecosystem - AGPL-3.0 License


📚 Resources


📞 Team Contact

For questions or support, reach out via:


Built with ❤️ for the disability community in East Africa

Accessibility is a right, not a privilege.

About

Abby - An AI agent built with Google ADK to help persons with disabilities discover accessible services across Kenya. Part of the AbiliLife ecosystem.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages