A proposal for GNG Leadership · 2026

A searchable library.

A clean dashboard to browse, search, and read your corpus. An AI assistant sits in the corner for when you'd rather just ask. Answers come from your documents only, with citations. When the corpus is silent, it says so.

For
GNG Leadership
By
Ahmad Wasiq Shairzad
Build
2 weeks
Type
Full-stack platform
The product

A library you can read, and ask.

Your team uploads. Users browse and read. The chat is there when they need it.

Upload & organize

Admins upload PDFs. The system parses and tags them by country and statute.

Browse & read

Users find documents in the dashboard. Search, filter, open, read. Like any modern library.

Ask the assistant

A chat icon in the corner. Optional. Citations link back to the exact passage; silence is allowed.

Under the hood

How a question becomes a citation.

What happens the moment a user does decide to ask the chat. Six stages, one turn.

Understand the question

A fast classifier extracts jurisdiction, topic, and time period before searching. Narrows the corpus to the right slice.

Claude Haiku 4.5

Find candidate passages

Hybrid search combines semantic vectors, keyword matching, and metadata filters to surface 50 candidates.

Convex hybrid 50 candidates

Pick the top five

A cross-encoder rereads each candidate against the question and rescores. Lifts accuracy 30 to 40 percent on hard queries.

BGE reranker Cloudflare Workers AI

Draft the answer

The model generates from the retrieved passages only. Structured citations like Section 31(1), PBO Act 2013 are required.

Gemini 3.1 Pro Streamed

Check every citation

Every cited reference is matched against the source text. Mismatches reject the answer. No hallucinated citations ship.

Custom validator

Log for replay

Question, candidates, scores, output, validator result. Stored in full. Admins can replay any past chat.

Convex audit log
Working together

A project is a loop, not a hand‑off.

Open, iterative, and close. The clearer you are about what you want, the easier the building gets.

Open conversation

We start with a real talk, not a spec sheet. What matters, what doesn’t, where you’d like to land.

Show, then adjust

You see things often, not at the end. Small versions, shared early. You react, I adjust.

Stay close

Keep talking through the build. Questions, second thoughts, new ideas. All welcome, anytime.

Building is my part

Once I understand what you want, execution is on me. You don’t need to manage it.

The build

Five phases. Two weeks.

Tap a stop to see what lands in that window.

The dashboard & document library

The interface your users actually live in. By day 3 you can sign in, upload a PDF, find it, and read it.

  • Sign-in and roles
  • Admin upload & corpus ingest
  • Library: search, filter, browse
  • Document viewer
The stack

Friendly, mainstream tools. Mostly free at your scale.

No exotic frameworks, no lock-in. Filter by category.

Unlimited bandwidth, commercial use allowed, global CDN.

Industry-standard React framework. Responsive and accessible.

Database, functions, file storage, vector search in one platform. Free up to 1M function calls, 0.5GB storage, and 20 GB‑hours of compute per month. Beyond that, pay‑as‑you‑go overages in cents per unit. No forced upgrade.

Sign-in, social login, roles. Free up to 10,000 monthly users.

Vision model that turns PDFs into clean markdown. Around $0.001 to $0.005 per page.

Cross‑language semantic search across 100+ languages. Plenty of strong options: Voyage 3‑large, OpenAI text‑embedding‑3‑large, Jina v5, or self‑hosted BGE‑M3. We pick based on language mix, budget, and where you want the data to live.

Cross-encoder reranker. Free up to 10,000 calls per day.

Gemini 3.1 Pro is the cheapest capable default at $2/$12 per M tokens. Our citation validator catches bad citations regardless of model, so we lead with cost. If eval scores ever slip, one line flips to Claude Sonnet 4.6, GPT‑5.5, or Grok 4.3. Prompt caching on the system prompt + retrieved passages cuts input cost ~90% on cache hits.

Automated eval on every change. Faithfulness, citation precision, answer relevancy.

Custom-built. No third-party processor touches your data.

Considered
Vercel, Netlify
Why
Unlimited bandwidth, commercial use allowed on free. Vercel free disallows client work.
Considered
Supabase, Firebase, custom Postgres
Why
Real-time, vector search, single TypeScript codebase. Faster build, simpler handoff.
Considered
LlamaParse, MinerU, Docling
Why
Top-tier accuracy, zero infrastructure. Open-source parsers add ops burden without real accuracy gain.
Considered
OpenAI 3-large, Voyage-3-large
Why
Strongest commercial multilingual. Voyage wins on English but lacks language breadth.
Considered
Cohere Rerank 3, Jina v3, none
Why
Within 3% of paid Cohere Rerank, free up to 10k/day. Skipping costs 30 to 40% accuracy.
Considered
Claude Sonnet 4.6, GPT-5.5, Grok 4.3
Why
Cheapest capable default (~25% under Claude). Validator catches bad citations regardless of model, so we lead with cost. One-line swap if eval scores slip.
Considered
Single-pass RAG, long-context dump
Why
Decomposes multi-jurisdiction questions cleanly. The 2026 standard.
Why trust it

Six guarantees, baked in.

Trust here is structural, not promised.

Every claim has a citation

Required by the prompt contract. No citation, no answer.

Every citation is verified

The validator confirms the cited text exists. No hallucinated authorities.

Refusal is built in

If the corpus is silent, the answer says so. Not a confident guess.

Every interaction is logged

Full traces. Replay any conversation any time.

Quality is measured

A golden test set runs on every change. Drops in precision block deploy.

Documents are versioned by date

Point-in-time queries work. Laws change without breaking history.

Running costs

Pennies per query. Transparent.

Infrastructure is mostly free. AI is metered, in fractions of a cent.

Frontend hosting · Cloudflare Pages
Free
Authentication · Clerk (≤10k MAU)
Free
Reranker · Cloudflare BGE (≤10k/day)
Free
Database & backend · Convex (free tier)
Free
AI usage

Per chat ~$0.02–0.05

Mostly Gemini 3.1 Pro for the answer, plus a fast classifier and embeddings. 1,000 chats a month costs roughly $20 to $50. Prompt caching on the system prompt and retrieved passages drops this further once traffic settles.

AI accounts owned by GNG. Billed directly.

Infrastructure is fully free at small scale. Total comes down to AI usage: typically  $20 to $50/month  for 1,000 chats with Gemini 3.1 Pro, dropping further with prompt caching. If we exceed Convex’s free tier, you pay only the overage in cents. No forced plan upgrade.

These figures are an estimate based on the cost‑efficient setup described above (Gemini 3.1 Pro default, prompt caching, free‑tier infra). Real usage will vary with traffic patterns, question complexity, corpus size, and any model swaps. We’ll share a sharper projection after we see the first week of real chats.

Questions

The honest answers.

Three layers. The model only sees retrieved passages from your corpus, not its training data. The prompt requires a citation on every claim. A validator checks each citation against the source text before the answer ships.

The stack is intentionally mainstream and modern AI services (Gemini for parsing and generation, Cohere for embeddings, Convex for everything else) do the heavy lifting. With locked scope and daily communication, 2 weeks is achievable. Slower replies stretch it.

We’ll talk it through with you and build it the way you want. Options range from simple (just upload the new version and replace the old) to richer (version history with effective dates so users can ask point‑in‑time questions). We pick what fits your workflow.

Cloudflare and Convex Cloud. If you need a specific region for data residency (EU for example), we confirm that at kickoff. On-premise is possible with self-hosted alternatives.

Any language Cohere's multilingual embedding model handles (100+ including major European, African, and Asian languages). Source documents in one language and queries in another work natively.

Yes. The stack is intentionally mainstream (TypeScript, Next.js, Convex). Any senior full-stack dev can pick it up. Handoff includes full code, docs, runbooks, and a training session.

Not built: mobile native apps, billing or payments, advanced analytics, third‑party integrations (Slack, Salesforce, etc.). Built, but kept lean: the eval set (starts at 50 questions), the admin UI (functional, not fancy), and documentation. All of these can be added later as a separate, scoped follow‑up.

I’ll be available after handoff. We’ll see together what kind of help you actually need once the build is running, and shape the support around that. Could be a few questions over email, a small monthly check‑in, or active feature work. We figure it out when we get there.

Next step

Shall we begin?

A 30‑minute kickoff. You share rough vision, corpus, jurisdictions, must‑haves. Once we’re aligned, building starts the next morning.

Schedule kickoff