Portfolio
RAG·CV retrieval-augmented, live
retrieval idle Source ↗

1 Knowledge base

no document loaded yet — drop a file or load the sample.

2 Ask a question

top-k 3
load a document first — the embeddings need to be ready before retrieval can run.

i How this works

embed → retrieve → augment → generate. Your document is split into chunks and embedded with all-MiniLM-L6-v2 (transformers.js, 384-dim, in your browser). A question is embedded the same way; the closest chunks by cosine similarity become the CONTEXT for the answer. The left arm gets no context and guesses; the right arm reads your actual CV. Load a document to begin.
A self-contained Retrieval-Augmented Generation demo — chunking + embeddings run client-side with @xenova/transformers (all-MiniLM-L6-v2, ~25 MB, cached after first load); PDFs are parsed with pdf.js. Retrieval is cosine similarity over L2-normalized vectors (a plain dot product); if the embedding model can't load it falls back to a pure-JS BM25 lexical scorer. The two answers come from one model via POST /api/rag — once with the retrieved context, once without. view the source ↗