Smart RAG

June 2026

A full-stack Retrieval-Augmented Generation app that lets users chat with their own PDF documents. Uploaded files are parsed, chunked and embedded, and every question is answered strictly from the most relevant passages. A dedicated LLM security judge screens each message first, blocking prompt-injection, jailbreak and off-topic requests before they reach the answering model.

Preview for smart-rag

Key Features

  • PDF upload with automatic text extraction and overlapping chunking (1000 chars, 200 overlap)
  • Semantic search over chunk embeddings (Google text-embedding-004) ranked by cosine similarity
  • Two-stage LLM pipeline on Groq: a security judge model gates requests before the answer model runs
  • Grounded answers that cite the source passages and refuse to answer outside the document context
  • Conversation memory for follow-up questions, plus an in-app PDF viewer and document library
  • JWT authentication with per-user document isolation in MongoDB

Tech Stack

ReactTailwindFramer MotionNode.jsExpress.jsMongoDBGroqJWT