Qanoon
Ask Pakistan's Federal Statutes a Question
Qanoon answers questions about Pakistan's federal statutes in plain language, grounded strictly in statute text, with citations that open the exact page of the exact source PDF. 525 federal laws — 6,487 pages across 21 categories — are chunked, embedded, and searchable through hybrid retrieval that fuses vector similarity with full-text search, so a specific section or act name is never missed. Every answer streams live and cites its source; every act also has a precomputed plain-language summary, key topics, and suggested questions ready with zero runtime cost.
- Category
- Legal RAG Application
- Role
- Solo design & engineering
- AI engine
- OpenAI (gpt-5.6-luna)
- Status
- Live · Open source
Next.jsReactTypeScriptTailwind CSSShadcn/UIVercel AI SDKOpenAI LLMPostgreSQLpgvectorBetter AuthResendUpstash RedisMinIO

Grounded answers, page-exact citations.
Hybrid retrieval
pgvector cosine search fused with Postgres full-text search via Reciprocal Rank Fusion — statute questions hinge on exact section and act names that pure vector search drifts on.
Cited, streamed answers
Citations render as numbered pills that open a reference panel with the exact PDF page — nothing is asserted without a source.
Category & act browsing
525 statutes across 21 categories, each with a precomputed plain-language summary, key topics, and suggested questions — a DB read, not a runtime LLM call.
Accounts & admin
Better Auth email/password and Google sign-in, a per-user dashboard and credit balance, and an admin dashboard for platform totals, user management, and in-app PDF ingestion.
From question to cited page.
- 1Ask a question — scoped to all laws, a category, or a single act.
- 2Hybrid retrieval fuses vector and full-text search results with Reciprocal Rank Fusion.
- 3The answer streams in, grounded strictly in the retrieved statute text.
- 4Citation pills open a reference panel showing the exact page of the source PDF.
Route handlers, no orchestration layer.
Direct to Postgres + OpenAI
Next.js App Router route handlers talk directly to Postgres and OpenAI — no separate orchestration layer in between.
Better Auth
Email/password and Google OAuth, email OTP verification, password reset, and an admin plugin for roles and bans.
Cost ledger
Every OpenAI call — embeddings, chat completions, offline summarization — is logged to a usage_events table, priced from a model_pricing table.
A closer look.





