An AI agent for Nigeria road safety and rules
# π§’ Roadman AI β RAG Traffic Safety Assistant
> **Authoritative, street-smart AI road safety & traffic law guide powered by Retrieval-Augmented Generation (RAG) and Google's Gemma model architecture.**
Roadman pairs strict factual accuracy (retrieved directly from verified government traffic codes, FRSC manuals, and highway safety documents) with a signature comedic street persona. Roadman provides 100% accurate legal answers wrapped in humor, exact fine amounts, and license penalty points without hallucinating fake laws.
---
## πΈ Key Features
- **π‘οΈ 100% Fact-Grounded RAG Pipeline**: Bounded strictly by official statutory traffic regulations. Never fabricates fake fines or laws.
- **β‘ Dual Client Access**:
- **Glassmorphism Web UI**: Sleek dark-mode single-page app with real-time word-by-word streaming responses, quick-prompt pills, and verifiable citation accordions.
- **Terminal CLI Client**: Fast terminal interface built with Python, `rich`, and `typer`, featuring color-coded penalty badges (`FINE: Β£200`, `POINTS: 6`).
- **π Multi-Persona Mode Selector**:
- π§’ **Classic Roadman**: Funny, street-smart, energetic & legally authoritative.
- βοΈ **Strict Lawman**: Pure formal legal and statutory text.
- π¨ **Hyper Roadman**: Maximum street commentary & energetic warning hypotheticals.
- **π Traffic Law Explorer**: Direct statutory database browser & search engine across 675 indexed vector chunks.
- **π€ Flexible Multi-Provider LLM Engine**: Native support for **Ollama Gemma 2** (`gemma2`), **Google Gemini API**, and an **Embedded High-Fidelity Local Engine** for instant out-of-the-box operation.
---
## ποΈ System Architecture
```
βββββββββββββββββββββββββββββ
β Clients (CLI / Web UI) β
βββββββββββββββ¬ββββββββββββββ
β REST / SSE Stream
βββββββββββββββΌββββββββββββββ
β FastAPI Backend β
β βββββββββββββββββββββββ β
β β Guardrails & Logic β β
β ββββββββββββ¬βββββββββββ β
βββββββββββββββΌββββββββββββββ
β
βββββββββββββββΌββββββββββββββ
β RAG Pip β¦