Build a Document-Grounded Legal AI Assistant with Corrective RAGBuild a Document-Grounded Legal AI Assistant with Corrective RAG
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
QanoonAI is an AI-powered legal assistant for Pakistani law. Users ask legal questions in English or Urdu and get clear, grounded answers drawn from Pakistan’s legal documents, with conversation history kept across sessions.
It uses a Corrective RAG (CRAG) pipeline: relevant legal text is retrieved from a FAISS vector store and re-ranked with a cross-encoder for precision. If the retrieved context isn’t good enough, the system falls back to live web search through Tavily instead of guessing. This reduces hallucinations, which matters a lot in legal use cases.
Tech stack: LangGraph (agent orchestration, SQLite checkpointing for memory), FastAPI with streaming (SSE) responses, Streamlit frontend, PyMuPDF, LangSmith (tracing and debugging), and Docker (distroless image) for deployment.
I can build similar document-grounded assistants for law firms, clinics, universities, and businesses that need reliable answers from their own documents.
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started