Chat with your docs (simple RAG)
Upload PDFs or markdown, ask questions, and get answers with citations to the source passages.
Build a 'chat with your documents' app. 1. Upload markdown/PDF files; extract text; split into ~800-token chunks with overlap. 2. Create embeddings with [PROVIDER] and store them in [pgvector on Supabase / a local SQLite vector extension / an in-memory index for the demo]. 3. On a question: embed it, retrieve the top 5 chunks, and answer using ONLY those chunks. If the answer isn't there, say so. 4. Show citations (file name + snippet) under each answer. 5. Keep API keys server-side; limit upload size and file types. Start with the in-memory version, then swap the store.
Tips
- Grounding instructions ('answer only from the provided passages') reduce made-up answers but don't eliminate them.
Works with: Cursor, Claude Code, Codex, Replit, Lovable, Bolt, v0. Last reviewed 2026-11-13.