How This Tool Works
This playground implements a complete Retrieval-Augmented Generation (RAG) pipeline entirely within your browser, ensuring maximum privacy. When you upload documents, the process begins: first, the system chunks your files into manageable segments. Next, each chunk is converted into numerical vectors using the all-MiniLM-L6-v2 embedding model. These embeddings capture the semantic meaning of your text.
When you ask a question, we perform a cosine similarity search against these stored vectors, retrieving the top 5 most relevant chunks (top-5 retrieval). Finally, the retrieved context is passed to an optional local Large Language Model (LLM) to generate a coherent answer. Crucially, this entire workflow—chunking, embedding, and querying—happens locally, meaning your documents never leave your device.