Mr. Muungano is a RAG-powered AI assistant that answers questions about the Union of Tanganyika and Zanzibar using official sources-constitution, union documents, government publications, and curated youth Q&A—not model guesswork
# MuunganoAi
**An AI educator for the Union of Tanganyika and Zanzibar**
*Grounded in official sources — the Constitution, Articles of Union, and government publications.*
---
MuunganoGPT is a RAG (Retrieval-Augmented Generation) system that answers questions about the structure, history, and law of the Tanzanian Union. Responses are drawn from verified documents — not from the model's imagination alone.
Whether you're a young person, a student, or anyone trying to understand why Tanzania has two governments, when the Union was formed, or what *Union Matters* actually means — without wading through hundreds of PDF pages.
---
## Why MuunganoAi?
| Challenge | Solution |
|-----------|----------|
| Constitutions and Union documents are long and dense | Clear answers in language you can follow |
| Online information mixes facts with opinion | Crawler uses an **allowlist** of official sources only |
| Everyone learns differently | Pick a tone: youth, simple, student, or official |
| Swahili and English speakers | Full bilingual UI and responses — switch instantly |
---
## How it works
```
User question
│
▼
┌─────────────┐ ┌──────────────────┐
│ Retriever │────▶│ ChromaDB │
│ (semantic) │ │ + embeddings │
└─────────────┘ └──────────────────┘
│ ▲
│ top 5–6 chunks │ PDFs · official sites · youth Q&A
▼ │
┌─────────────┐ ┌──────────────────┐
│ OpenRouter │◀────│ Context + │
│ (LLM) │ │ tone prompts │
└─────────────┘ └──────────────────┘
│
▼
Streaming response in Swahili or English
```
**Knowledge sources** are ranked by priority: Constitution and Articles of Union first, then government publications, official FAQs, academic papers, and finally general knowledge (clearly labelled as such).
**Embedding model:** `paraphrase-multilingual-MiniLM-L12-v2` — handles Swahili and English in one pass.
**LLM:** OpenRouter (default: `google/gemini-2.5-flash`) — swap models …