DocChatPortfolio
Case study

DocChat - RAG over your documents.

A production-style AI demo that turns uploaded PDFs into cited answers using a practical two-model architecture.

Next.js 16Vercel AI SDKKimi K2.6DeepSeek V4 ProSupabase pgvectorTailwind v4
PDF -> chunks

page text extracted and indexed into pgvector

5 chunks

retrieved for every grounded answer by default

2 models

Kimi primary chat plus DeepSeek comparison

~$5/mo

demo-scale API cost target

Problem

Internal documents are useful only if teams can query them.

SMB teams often have policies, manuals, onboarding docs, and client instructions scattered across PDFs. A useful workflow needs ingestion, retrieval, source citations, and an honest fallback when the answer is not in the document.

Build goals
Accept real PDF uploads.
Embed chunks into Supabase pgvector.
Answer only from retrieved context.
Render citations as clickable source chips.
Show model-routing judgment, not just a wrapper around one LLM.
Architecture

A lean RAG pipeline without extra infrastructure.

01

Ingest

A PDF upload is parsed page by page, normalized, and split into overlapping token chunks.

02

Retrieve

DeepSeek-compatible embeddings are stored in Supabase and queried through a pgvector RPC.

03

Answer

Kimi receives only the retrieved chunks and must cite each factual claim with source markers.

04

Compare

A separate compare endpoint runs Kimi and DeepSeek over the same context for side-by-side evaluation.

Work with Anil

Want a document AI workflow for your business?

I design, build, and automate AI products for SMBs and agencies - full-stack, shipped in 14 days, no handoffs.