cite-rag

Production citation-backed RAG

Citation-backed RAG that refuses to hallucinate

Ask a real indexed corpus. Every grounded answer shows sources you can open. When retrieval is weak, cite-rag says it does not know.

Next.js 15pgvectorMiniLM 384-dGroqAuth.js

How it works

A fixed pipeline with a grounding gate — not prompt theater.

  1. 01

    Ingest

    TXT / PDF corpus via offline CLI

  2. 02

    Chunk

    ~640 tokens · 12% overlap

  3. 03

    Embed

    MiniLM 384-d in-process

  4. 04

    Retrieve

    pgvector HNSW · cosine

  5. 05

    Generate

    Groq via Vercel AI SDK

  6. 06

    Cite or refuse

    Grounded markers — or explicit no

Proof

Live corpus counts and published eval refusal correctness.

Corpus

1,000+ docs indexed

Live document count from production index

Chunks

1003/1003 chunks verified

Scorecard corpus: 1003 documents / 1003 chunks

OOD refusal

100% (8/8)

evals/scorecard.md — out-of-corpus correctly refused

Embeddings

384-dim

Transformers.js all-MiniLM-L6-v2

Architecture

Monorepo seams — UI, RAG library, ingest CLI, vectors, and LLM.

  • apps/web

    Next.js UI · Auth.js · API routes

  • packages/rag

    chunk · retrieve · ground · cite

  • data/scripts

    1,000+ doc ingest CLI

  • Postgres + pgvector

    Supabase · 384-d HNSW

  • Groq

    openai/gpt-oss-20b

Monorepo · designed seams · not a single-file demo

Tech stack

The same stack that runs in production on Vercel + Supabase.

Next.js 15React 19TypeScriptTailwind CSS 4Supabase / pgvectorGroqDrizzle ORMAuth.jsVercel AI SDKTransformers.js

Built by Tanmay Shinde · citation-backed RAG