Similarity
2D map
RAG
RAG (Retrieval-Augmented Generation) combines information retrieval with text generation. It works in three steps: index, retrieve and generate. This tool demonstrates steps 1 and 2.
Split the corpus into chunks (separated by a blank line) and compute the embedding of each one: a numeric vector that captures its meaning.
When a query arrives, its embedding is computed and compared against those of the corpus using cosine similarity. The K most similar chunks are returned.
In a full RAG system, an LLM receives the retrieved chunks as context and generates the answer. The embedding model is all-MiniLM-L6-v2 (~22 MB), the same one used in the semantic similarity tool.
This tool will download a multilingual AI model (~150 MB) from HuggingFace Hub the first time you use it. The model is stored in your browser and is not downloaded again. No text of yours leaves your device — all processing happens locally.
huggingface.co · *.cdn.hf.co · cdn.jsdelivr.net — only to download the file: nothing of yours is sent.