An inspectable AI portfolio with governed content, retrieval, ML routing, agent orchestration and conversational interfaces.
How a portfolio evolved into a governed knowledge system with deterministic ingestion, hybrid persistence, vector retrieval, an in-process ML router, bounded LangGraph execution and cited conversational interfaces.
A conventional portfolio could show Mahad's design work and list newer AI skills, but it could not prove that he understood the full path from content governance to model deployment and product experience. A résumé copied into a system prompt would become stale, difficult to inspect and easy to overstate. The system therefore needed to remain useful as a normal website while answering questions about projects, experience and engineering decisions from approved evidence. It also had to work within strict free-tier limits, distinguish English and Roman Urdu, refuse unrelated or adversarial requests and degrade honestly when an external service was unavailable.
Sanity is the authoring layer for approved portfolio content. The ingestion pipeline normalizes documents, computes hashes and creates deterministic chunks so unchanged content is not duplicated. Neon PostgreSQL stores canonical documents, chunks, versions, ingestion state and operational records. Qdrant stores the rebuildable vector index, with retrieved point identifiers hydrated back to PostgreSQL records before citation. The embedding layer uses intfloat/multilingual-e5-small to support English and Roman Urdu retrieval. FastAPI contains the assistant boundary. A compact classifier exported to ONNX runs in-process and routes retrieval, direct-chat and refusal requests without an LLM network call. LangGraph represents classification, retrieval, evidence checks, answer generation, citation validation and bounded recovery as explicit states. The web interface streams assistant events through Server-Sent Events. MLflow records model experiments, while LangSmith traces retrieval and generative execution. The voice architecture is being pivoted from separate transcription and synthesis into an ElevenLabs conversational channel that still uses the same grounded backend knowledge.
Keep Sanity as the authoring source while PostgreSQL owns normalized operational records and Qdrant remains a rebuildable search index.
Use content hashes and deterministic chunking so unchanged documents do not create duplicate vectors.
Run the routing model in the FastAPI process through ONNX Runtime instead of paying the latency and token cost of an LLM routing call.
Use LangGraph for explicit state transitions, bounded retry and inspectable refusal paths.
Keep MLflow responsible for model experiments and LangSmith responsible for runtime LLM and agent traces.
Use ElevenLabs only as the real-time audio layer while retaining the existing grounded assistant as the knowledge layer.
Test the RAG retrieval pipeline by asking specific questions about this case study: