HomeChallengesRepsProblemsLeaderboardTake a challenge

RAG Chat with Citations

The whole pipeline end to end: upload a .txt, chunk and embed it, answer a question from it, and cite which chunks you used.

Advanced25 min on the clock8 graded checks · 100 pointsRAG and Model APIsPro
Graded by reading your code against the checklist below.

What you build

  • Split the document into overlapping chunks
  • Embed every chunk, and embed the question
  • Rank chunks by cosine similarity and keep the top k
  • Ask Claude to answer using only those chunks
  • Render the answer with its sources visible

Done means

A question returns an answer plus the ranked chunks it was drawn from.

How it is graded

Published in full, before you start — every point is one of these and there is nothing else.

  1. Split the document into chunks+20Chunking documents
  2. Overlap the chunks+10Chunking documents
  3. Embed the chunks and the question+20Embeddings
  4. Score chunks by cosine similarity+15Similarity search
  5. Rank and keep the top k+10Similarity search
  6. Ask Claude with the retrieved context+5Calling a model API
  7. Instruct the model to cite its sources+5Grounding and citations
  8. Show the sources in the UI+15Grounding and citations

What it teaches

The rest of RAG and Model APIs