Scrim UI

RAG Document Q&A TemplatePro

Upload, chunk, embed, retrieve, answer — with citations that land on the sentence they came from, not a list of filenames at the bottom.

Next.js 16React 19AI SDK 7Tailwind v4TypeScript
ready

Ask the document something.

A scripted replay — there is no model behind this page. The citations are live, though: click one, or a row in the source list, and the passage is marked in the document. That is the interaction the template ships, driven by chunk offsets carried all the way from ingestion.

Every file in it

The full file list, with line counts — nothing is hidden about what you are getting, only the contents are.

31 files, 3,324 lines

Every file below is real and readable once you have Pro — downloaded as a zip, installed with one shadcn command, or read here in the browser. $49 once, for this and every other Pro item.

.env.example

Built on these components

All free, all documented on their own pages. The template is what wires them together.

Running it

  1. Download the zip and unpack it, or install it with the shadcn command above — either way the app lands in its own directory. Then npm install.
  2. Add an AI_GATEWAY_API_KEY to .env.local — one key reaches every model the template uses, the embedding model included.
  3. npm run dev. To use a provider directly instead, install its package and change the two model lines in lib/models.ts.