Skip to content
ghwmelite-dotcomPublic

About

AI-powered productivity platform for Government of Ghana operations. Multi-model chat, deep research, document drafting, data analysis, RAG knowledge base, and multi-channel access (web, WhatsApp, SMS, USSD). Built on Cloudflare Workers.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

168 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AskOzzy — AI-Powered Productivity for Ghana's Civil Service

Live App Admin Portal Docs

Cloudflare Workers Hono 4.6 TypeScript 5.7 Cloudflare D1 Workers AI Deploy License


AskOzzy is a full-stack AI assistant built exclusively for Ghana's civil service. It gives civil servants, students, and the general public access to intelligent document drafting, deep research, data analysis, and multilingual communication — all running on Cloudflare's global edge network for speed, security, and data sovereignty.

✨ Highlights

  • 🤖 10 AI Models — GPT-OSS 120B, Llama 4 Scout, Llama 3.3 70B, QwQ 32B, Qwen3 30B, Mistral Small, Gemma 3, Granite 4.0, and more
  • 🔌 139+ API Endpoints — Single Hono/TypeScript Worker powering the entire backend
  • 🗄️ 32 Database Tables — Comprehensive relational schema across 9 migration files
  • 📝 45 Prompt Templates — GoG memos, cabinet briefs, policy drafts, student essays, IT specs
  • 📴 Offline-First PWA — Works without internet; queues and syncs automatically
  • 📡 Multi-Channel Access — Browser, WhatsApp, SMS, and USSD (*713*OZZY#)

🛡️ The Trust Pipeline — no raw model output, ever

Every response travels through a six-gate anti-hallucination pipeline: known-error registry → grounded retrieval → cited drafting → independent fact-check → adjudication → channel-aware formatting.

AskOzzy Trust Pipeline — Known-Error Check, RAG Retrieval, Grounded Draft, Fact-Check, Adjudicate, Channel Format

🏗️ Architecture

One Worker. Every channel. Zero cold starts.

flowchart LR
    subgraph CH["📡 Channels"]
        WEB["🌐 Web PWA<br/><i>offline-first</i>"]
        WA["💬 WhatsApp"]
        SMS["✉️ SMS"]
        USSD["📟 USSD<br/><i>*713*OZZY#</i>"]
    end

    subgraph EDGE["☁️ Cloudflare Edge — single Hono Worker"]
        MW["CORS · Auth ·<br/>Rate Limiting"]
        RT["139+ Route Handlers"]
    end

    subgraph DATA["🗄️ Edge Data & AI"]
        D1[("D1 · SQLite<br/>32 tables")]
        KV[("KV Sessions<br/>7-day TTL")]
        VEC[("Vectorize<br/>768-dim cosine")]
        AI["⚡ Workers AI<br/>10 models, SSE streaming"]
        PAY["💳 Paystack<br/>GHS payments"]
    end

    WEB & WA & SMS & USSD --> MW --> RT
    RT --> D1 & KV & VEC & AI
    RT --> PAY

    style CH fill:#1a1420,stroke:#CE1126,color:#e7eaf0
    style EDGE fill:#141a16,stroke:#006B3F,color:#e7eaf0
    style DATA fill:#1a180f,stroke:#FCD116,color:#e7eaf0
Loading

🔍 RAG pipeline

flowchart LR
    U["📄 Upload"] --> P["Parse"] --> C["Chunk<br/><i>500 chars · 50 overlap</i>"] --> E["Embed<br/><i>bge-base-en-v1.5</i>"] --> S[("Vectorize")]
    Q["❓ Query"] --> SIM["Cosine<br/>similarity"] --> S
    SIM --> INJ["Inject context"] --> R["⚡ Cited AI response"]

    style S fill:#1a180f,stroke:#FCD116,color:#e7eaf0
    style R fill:#141a16,stroke:#006B3F,color:#e7eaf0
Loading

🚀 Features

Core AI

Feature Description
Multi-Model Chat Real-time SSE streaming across 10 LLMs
Deep Research 5-step pipeline with DuckDuckGo web search
Data Analysis CSV/Excel processing with Chart.js visualizations
Vision AI Image description, OCR, form extraction, receipt scanning
RAG Knowledge Base Document ingestion, vector embeddings, semantic retrieval
AI Memory Auto-extracts preferences for personalized responses
Translation m2m100 multilingual translation
Transcription Whisper audio-to-text

Productivity

Feature Description
45 Templates GoG-specific and student-specific prompt templates
Custom Agents 25 pre-seeded + admin-managed AI agents
Workflow Automation Multi-step document generation pipelines
Meeting Assistant Upload recordings, get AI-generated minutes
Collaborative Spaces Team workspaces with shared conversations
Voice I/O 7 languages — English, Twi, Ga, Ewe, Hausa, Dagbani, French

Platform

Feature Description
Admin Portal 16 management tabs for users, analytics, content, settings
Affiliate Program 2-level commissions (30% L1, 5% L2) with milestone bonuses
Payments Paystack — MTN MoMo, Vodafone, AirtelTigo, Visa, Mastercard
Student Mode Discounted pricing with 16 academic templates
Citizen Bot Public-facing AI chat — no login required
Push Notifications VAPID-based web push
Gamification Streaks, badges, and milestones

🧰 Tech Stack

Layer Technology
Runtime Cloudflare Workers (0ms cold start)
Framework Hono 4.6 (TypeScript)
Database Cloudflare D1 (SQLite) — 32 tables
Session Store Cloudflare KV (7-day TTL)
Vector DB Cloudflare Vectorize (768-dim, cosine)
AI Inference Cloudflare Workers AI (10 models)
Payments Paystack (GHS)
Frontend Vanilla JS PWA with Service Worker v2

⚡ Quick Start

# Clone
git clone https://github.com/ghwmelite-dotcom/ask-ozzy.git
cd ask-ozzy

# Install
npm install

# Local dev
npx wrangler dev
# → http://localhost:8787

First Deployment

# 1. Create infrastructure
npx wrangler d1 create ghana-civil-ai-db
npx wrangler kv namespace create SESSIONS
npx wrangler vectorize create askozzy-knowledge --dimensions=768 --metric=cosine

# 2. Run migrations (in order)
npx wrangler d1 execute ghana-civil-ai-db --remote --file=schema.sql
npx wrangler d1 execute ghana-civil-ai-db --remote --file=schema-kb.sql
npx wrangler d1 execute ghana-civil-ai-db --remote --file=schema-phase1.sql
npx wrangler d1 execute ghana-civil-ai-db --remote --file=schema-phase2.sql
npx wrangler d1 execute ghana-civil-ai-db --remote --file=schema-phase4.sql
npx wrangler d1 execute ghana-civil-ai-db --remote --file=schema-phase5.sql
npx wrangler d1 execute ghana-civil-ai-db --remote --file=schema-phase5b.sql
npx wrangler d1 execute ghana-civil-ai-db --remote --file=schema-ussd.sql
npx wrangler d1 execute ghana-civil-ai-db --remote --file=schema-affiliate.sql

# 3. Set secrets
npx wrangler secret put JWT_SECRET
npx wrangler secret put VAPID_PUBLIC_KEY

# 4. Deploy
npx wrangler deploy

# 5. Bootstrap admin
curl -X POST https://askozzy.ghwmelite.workers.dev/api/admin/bootstrap

💠 Subscription Tiers

Tier Price (GHS/mo) Student Messages/day Models
Free 0 0 10 3
Professional 60 25 200 All 10
Enterprise 100 45 Unlimited All 10

🔐 Security

  • Authentication — Access codes, WebAuthn passkeys, TOTP 2FA, recovery codes
  • Authorization — Role-based access control (user, dept_admin, super_admin)
  • Rate Limiting — KV-backed per-category limits (auth: 10/5min, chat: 30/min, API: 100/min)
  • Webhook Verification — HMAC-SHA512 signature validation (Paystack)
  • Content Security Policy — Strict CSP headers
  • Audit Trail — Full logging of all AI operations and admin actions
  • Content Moderation — Flag and review system

📁 Project Structure

ask-ozzy/
├── src/
│   ├── index.ts              # Backend — 161 route handlers
│   ├── config/               # Agent prompts, inference params, authorities
│   ├── lib/                  # Trust pipeline: chunker, ingest, retrieve,
│   │                         #   generator, verifier, adjudicator, …
│   └── types/                # Shared TypeScript contracts
├── public/
│   ├── index.html            # Main app UI
│   ├── admin.html            # Admin portal
│   ├── sw.js                 # Service Worker v2
│   ├── manifest.json         # PWA manifest
│   ├── css/                  # Stylesheets
│   ├── js/
│   │   ├── app.js            # Frontend logic
│   │   ├── admin.js          # Admin logic
│   │   └── templates.js      # 45 prompt templates
│   └── icons/                # PWA icons
├── schema*.sql               # 9 database migration files
├── docs/                     # 14 documentation guides
│   └── assets/               # README illustrations (SVG)
├── wrangler.jsonc            # Cloudflare Worker config
├── package.json
└── tsconfig.json

📚 Documentation

Full documentation lives in docs/ — 14 comprehensive guides covering architecture, API reference (139+ endpoints), database schema, frontend, admin portal, AI features, payments, security, PWA/offline, deployment, and a complete user guide.

License

Proprietary. All rights reserved.


Built for the Government of Ghana by Osborn Hodges
🇬🇭 From the civil service, for the civil service — on every channel, on any network.

About

AI-powered productivity platform for Government of Ghana operations. Multi-model chat, deep research, document drafting, data analysis, RAG knowledge base, and multi-channel access (web, WhatsApp, SMS, USSD). Built on Cloudflare Workers.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages