CompletedAI/ML2026
RAG Retrieval System
Find the passages that answer a question, by meaning, not keywords.
Live demo
The search bar on my homepage is this pipeline: same model, chunk → embed → cosine → top-k, running in your browser.
Built
- Overlapping chunks of the source text
- 384-d embeddings with all-MiniLM-L6-v2
- Cosine-similarity ranking → top-k passages
Architecture
- 1 · Chunkoverlapping windows
- 2 · Embedall-MiniLM-L6-v2 · 384-d
- 3 · Scorecosine similarity
- 4 · Retrievetop-k passages
Real output
From my Python version: 61 chunks · all-MiniLM-L6-v2
- 0.224chunk 35…for natural language processing, showcasing an elegant convergence of ideas across…
- 0.195chunk 57…content from minimal inputs like single images or text prompts. This fusion leverages the…
- 0.185chunk 32…allowing it to overcome the spectral bias of standard MLPs that favor low-frequency…
- 0.690chunk 10…core innovations in NeRF is the use of volumetric rendering, where a ray is cast from the…
- 0.670chunk 37…has been the adaptation of NeRF-like models for dynamic scenes, where the geometry and…
- 0.640chunk 2…novel views of complex 3D scenes. Unlike traditional graphics pipelines that rely on…
Insight
With normalized embeddings, cosine similarity is a dot product. Retrieval is linear algebra.
Challenge
ProblemBig chunks match vaguely; small chunks lose context.
FixTuned chunk size and overlap to balance the two.
Code
pythonFrom the project repo
size = 100overlap = 40cs = [content[0:size]]for i in range(size, len(content), size - overlap): start = i - overlap end = i + size - overlap cs.append(content[start:end])model = SentenceTransformer("all-MiniLM-L6-v2")chunk_emb = [model.encode(chunk) for chunk in cs]Status
Done
- Chunking with overlap
- 384-d embeddings (all-MiniLM-L6-v2)
- Cosine similarity → top-k
- Live demo: this site's search bar
Next
- LLM answers grounded in the retrieved passages
- Evaluation: Recall@k, MRR
- Sentence-aware chunking