haq.ai is a Retrieval-Augmented Generation (RAG) application that makes Pakistani law accessible to ordinary citizens who cannot afford a lawyer for basic legal questions. Many people don't know their rights around arrest, family law, contracts, or workplace disputes simply because the law is written in dense legal language they can't parse. The app indexes official Pakistani legal texts — including the Pakistan Penal Code, Code of Criminal Procedure, Muslim Family Laws Ordinance, Guardianship & Wards Act, and Contract Act — into a searchable knowledge base. When a citizen describes their situation in plain English or Urdu, haq.ai retrieves the exact relevant sections and explains them in simple terms, with concrete next steps and emergency contact numbers when appropriate. The system is built with a FastAPI backend and a React frontend. Documents are chunked and embedded using HuggingFace sentence embeddings, indexed in FAISS for fast semantic search. Answer generation runs through Fireworks AI, which serves open-weight models on AMD Instinct GPUs — meaning every response a user receives is generated on AMD hardware. The assistant is strictly grounded in retrieved legal text: it never fabricates section numbers, and if a topic isn't covered in its current knowledge base, it says so honestly rather than guessing — critical for a legal-information tool where wrong answers can cause real harm. Every response includes clear source citations back to the specific law and page it came from. haq.ai demonstrates how open-weight LLMs running on AMD infrastructure can be applied to real social-impact problems — expanding access to legal information for citizens who would otherwise have none.
Category tags: