Case study · Phaedra Solutions · 2025
AskTT — Government AI Service
Production FastAPI RAG backend for the MyTT government portal — hybrid retrieval, cited answers, streaming + voice chat, plus an LLM recruitment-matching engine.
- FastAPI
- Elasticsearch
- RAG
- OpenAI
- SSE Streaming
- Whisper
- PostgreSQL
- Prisma
400,000+applicant–vacancy pairs evaluated
30–50/secreal-time matches
Government engagement — implementation details are generalized and there is no public source repository.
The problem
Citizens needed reliable, cited answers from sprawling government knowledge, and ministries needed to evaluate hundreds of thousands of applicant–vacancy pairs quickly and explainably.
My role
Senior AI Developer — designed and built the production AI backend end to end.
What I built
A FastAPI RAG service with hybrid retrieval (BM25 + dense kNN + Reciprocal Rank Fusion in Elasticsearch), OpenAI-powered answers with numbered citations, KB-only and general-answering modes, and context-aware query rewriting for follow-ups. End-user features — streaming chat over SSE, AI-assisted search with ranked results, and Whisper voice chat — share conversation state across text and voice. A separate LLM recruitment-matching engine scores applicant–vacancy fit with explainable rationales.
Architecture & stack
- FastAPI backend with Server-Sent Events streaming
- Hybrid retrieval: BM25 + dense kNN + Reciprocal Rank Fusion (Elasticsearch)
- OpenAI answers with numbered citations; KB-only + general modes; query rewriting
- Whisper speech-to-text voice chat with optional TTS and S3 persistence
- PostgreSQL + Prisma; idempotent KB ingestion, embeddings, content hashing
- Async parallel execution, caching, checkpointed batch processing, LangSmith tracing