Sitemap

Usebelha — Multi-Tenant AI Customer Support with Google ADK

Inspiration

--

Customer support is the backbone of any successful business, but building a custom AI support system is typically complex, expensive, and out of reach for small businesses and startups — especially in emerging markets.

I was inspired by ANDO Foods, a food delivery platform in Kigali, Rwanda, that faces unique challenges: OTP verification issues in regions with spotty WhatsApp connectivity, customers needing support in multiple languages (English, French, Kinyarwanda), and the need to scale support without prohibitive costs.

I wanted to prove that with Google’s latest AI tools — ADK, Gemini, and Cloud Run — a single developer could build production-ready, enterprise-grade AI customer support in days, not months, and at a cost accessible to any business.

What it does

Usebelha is a multi-tenant AI customer support platform that provides intelligent, context-aware support for multiple companies from a single deployment.

Key Features:

  • Auto-Discovery: Drop markdown files into a KB/company-name/ folder, and Usebelha automatically discovers the tenant and creates an isolated AI agent
  • Intelligent Responses: Powered by Gemini Flash Experimental with File Search API for accurate, knowledge-based answers
  • Real-Time Streaming: Server-Sent Events deliver responses word-by-word as they’re generated, just like ChatGPT
  • Perfect Isolation: Each company gets a dedicated File Search store — zero cross-contamination of data
  • Suggested Questions: Smart UI shows top questions from each tenant’s knowledge base
  • Human-in-the-Loop: Seamlessly escalates to human support when the AI can’t help
  • Multi-Language Ready: Gemini natively handles English, French, Kinyarwanda, and 100+ languages
  • Cost-Effective: Around $16/month total infrastructure cost vs $50–200/user/month for traditional solutions

Live Demo: I’m showcasing Usebelha with ANDO Foods at https://timtech4u.dev/usebelha-preview/andofoods.co/

The chatbot answers questions about:

  • Delivery fees (RWF 1,500)
  • OTP verification troubleshooting
  • Payment methods (Cash & MoMoPay)
  • Order tracking
  • Account management

All knowledge comes from simple markdown files — no database setup, no complex configuration.

How we built it

Architecture:

I built Usebelha using a multi-agent architecture with Google ADK:

  1. Router Agent (entry point)
  • Extracts company domain from userId (format: domain:email)
  • Routes requests to the correct tenant-specific agent

2. File Search Agents (one per tenant)

  • Searches company-specific knowledge base in Gemini File Search
  • Returns contextualized, accurate answers
  • Powered by Gemini Flash Experimental

Tech Stack:

Backend:

  • Go (Golang) for high performance and concurrency
  • Google ADK for agent orchestration
  • Gemini Flash Experimental for AI responses
  • Gemini File Search API for knowledge management

Frontend:

  • React + TypeScript
  • TanStack Router for routing
  • Server-Sent Events for real-time streaming
  • Tailwind CSS for styling

Infrastructure:

  • Google Cloud Run for serverless deployment
  • Google Secret Manager for API keys
  • Multi-stage Docker build for optimal container size
  • CORS middleware for multi-domain support

Challenges we ran into

Challenge 1: Store ID Mismatch Bug

The biggest challenge was a tricky bug where Gemini’s File Search API auto-generates store IDs instead of using my provided ones.

Expected: fileSearchStores/andofoods-co-docs Actual: fileSearchStores/andofoodsco-support-documen-mymt0ofn609v

This caused “Corpora does not exist” errors for hours until I realized the registry wasn’t capturing the actual generated IDs.

Solution: Update the registry with the actual store.Name returned by the API.

Lesson: Always capture what APIs actually return, not what you expect!

Challenge 2: Cloud Run Cold Starts

First requests after idle periods took 3–5 seconds, creating poor UX.

Solutions:

  • Implemented loading states and skeleton screens in UI
  • Used streaming to show responses as they arrive (reduces perceived latency)
  • Optimized Docker image with multi-stage builds
  • For production: set minimum instances to 1

Challenge 3: Multi-Tenant Security

Ensuring perfect data isolation between tenants was critical.

Solutions:

  • Separate File Search stores per tenant
  • Extract domain from userId on every request
  • Validate tenant access before searches
  • No shared data structures across tenants

Challenge 4: Session Management

ADK sessions needed to handle the “session already exists” case gracefully.

Solution: Treat “already exists” as success rather than error.

Accomplishments that we’re proud of

  • Built in 48 hours: From idea to production-ready platform with a real demo
  • Production-Ready: Not just a hackathon demo — includes error handling, retry logic, CORS, health checks, monitoring
  • Real-World Demo: ANDO Foods is a real business in Rwanda, demonstrating practical value for emerging markets
  • Incredibly Cost-Effective: $16/month vs $50–200/user/month for traditional solutions — democratizing AI support
  • Auto-Discovery: Zero configuration multi-tenancy — just add folders and it works
  • Instant Streaming: Real-time responses feel as fast as ChatGPT
  • Multi-Language: Ready for Kinyarwanda, French, English without any extra code
  • Great UX: Suggested questions, connection status, retry logic, typing indicators

What we learned

Technical Learnings:

  1. Google ADK is Powerful: The agent orchestration capabilities make complex multi-agent systems surprisingly simple
  2. Gemini File Search is Excellent: The semantic search quality is outstanding — it finds relevant answers even with different phrasing
  3. Cloud Run is Magic: From git push to production in 3 minutes, with auto-scaling and zero maintenance
  4. Streaming is Essential: SSE makes AI responses feel instant and keeps users engaged
  5. Go + React is a Great Stack: Go’s concurrency for backend, React’s reactivity for frontend — perfect match

Business Learnings:

  1. Emerging Markets Need This: ANDO’s challenges (OTP issues, multi-language, cost constraints) are common across Africa — huge opportunity
  2. Multi-Tenancy is Key: SaaS businesses need isolated data — solving this unlocks massive scale
  3. Simplicity Wins: Markdown files for knowledge bases beats complex database schemas

Personal Growth:

  1. Ship Fast: Perfect is the enemy of done — the working demo is what matters
  2. Real Users Matter: Using ANDO Foods forced me to think about real problems, not hypothetical ones
  3. Cost Awareness: Keeping it at $16/month makes it accessible to businesses that need it most

What’s next for Usebelha

Short-Term (Next 2 Weeks):

  • Analytics Dashboard: Track common questions, resolution rates, escalations per tenant
  • File Attachments: Already implemented — needs production testing for uploading images/PDFs
  • WhatsApp Integration: Connect directly to WhatsApp Business API for where African customers already are

Medium-Term (Next Month):

  • Usage Metrics: Per-tenant analytics showing cost, volume, satisfaction
  • Custom Branding: Tenant-specific colors, logos, and styling
  • Webhook Support: Notify Slack/Discord/email when HITL is triggered
  • Voice Support: Leverage Gemini’s multimodal capabilities for voice queries

Long-Term Vision:

  • Marketplace: Let businesses create and sell knowledge bases for common industries
  • Agent Marketplace: Pre-built agents for e-commerce, healthcare, fintech, etc.
  • Multi-Channel: Support chat, email, SMS, voice from one platform
  • Self-Learning: Agents learn from resolved escalations to improve over time

Immediate Next Steps:

  1. Reach out to ANDO Foods for real feedback and potential partnership
  2. Open-source the project for community contributions
  3. Create video tutorials for setting up tenants
  4. Write case studies showing ROI for different business sizes
  5. Explore Google Cloud credits for African startups

Built with love for businesses in emerging markets.

--

--