Build a RAG Chat Interface
Build a Retrieval-Augmented Generation chat where users upload documents and ask questions with context.
Requirements
Document upload: accept PDF, TXT, and MD filesText extraction and chunking (split into ~500 token chunks with overlap)Simple vector search: embed chunks using a basic similarity metricChat interface with message historyEach AI response cites which document chunks were usedHighlight relevant chunks in a side panelClear conversation and re-upload documentsTechnical Notes
For embeddings, you can use simple TF-IDF or word overlap similarity. For the AI response, use a mock or real API. Store chunks in memory.
Bonus Points
Real embedding API integration (OpenAI embeddings)Chunk preview with relevance scoresMulti-document support with source attribution