Open-source AI platform for Rwanda education
# SomaAI
RAG-powered educational assistant for Rwandan students and teachers. Transforms curriculum PDFs into searchable knowledge and generates grounded, cited answers.
**Stack**: FastAPI · Qdrant (384d) · PostgreSQL 16 · Redis 7 · Groq (Llama 3.2)
---
## Architecture
```mermaid
graph LR
Client["Client"] -->|POST /chat/ask| API["FastAPI Gateway"]
API --> RAG["RAG Pipeline"]
RAG --> Q["Qdrant Vectors"]
RAG --> LLM["Groq Llama 3.2"]
RAG --> Cache["Redis Cache"]
API --- PG["PostgreSQL Metadata"]
Ingest["Ingestion Pipeline"] --> Q
Ingest --> PG
```
**How it works**: Curriculum PDFs are ingested through a 7-stage pipeline (extract → chunk → embed → store). Student/teacher queries hit the RAG pipeline, which classifies, retrieves, generates, and validates citations.
---
## Quick Start
```bash
git clone
github.com
cd SomaAI
cp .env.example .env
# Set GROQ_API_KEY in .env (or LLM_BACKEND=mock with TESTING=1 for dev)
uv sync
make docker
```
App runs at
localhost · Swagger at
localhost
---
## Documentation
| Document | Description |
|----------|-------------|
| ARCHITECTURE.md | System design, module breakdown, data flow, request lifecycles |
| INGESTION_PIPELINE.md | 7-stage ingestion: extract → chunk → embed → store |
| RETRIEVAL.md | Dense retrieval, fallback strategy, reranker/BM25 status |
| DEVELOPMENT.md | Local setup, environment variables, debugging, testing |
| ROADMAP.md | MVP status, prioritized improvements |
| monitoring.md | Prometheus metrics, alerts, and Grafana dashboards |
| CONTRIBUTING.md | Branch strategy, commit conventions, PR process |
| docs/api.md | API endpoint reference |
| CHANGELOG.md | Release history |
| CODE_OF_CONDUCT.md | Community guidelines |
| SECURITY.md | Security policy |
---
## API Overview
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/api/v1/chat/ask` | POST | Ask a question (returns AI answer + citations) |
| `/api/v1/ch …