← Home

Chunks → embeddings (RAG demo)

Split text into overlapping chunks, then turn each chunk into a numeric vector. This page is a teaching visualization: vectors are simulated locally so nothing leaves your browser. Production RAG uses a trained embedding model API.

2 chunks
1

Chunking

Sliding windows slice the document. Overlap keeps sentences that would otherwise be cut in half at boundaries.

2

Embedding

Each chunk becomes a fixed-length vector (here 48 numbers). Similar passages would land nearby with a real model—here you still see structure for the lesson.

Map (first two dimensions)

Quick 2-D peek at how chunks differ. Real tutorials often use PCA/t-SNE on hundreds of dimensions.

dim 0 vs dim 1 (illustrative)#1#2

All chunks

Chunk 1220 chars

Retrieval-Augmented Generation (RAG) combines search with language models. Documents are split into chunks—small passages that fit in context. Each chunk is converted into an embedding: a list of numbers capturing meanin

Vector (48-D, showing first 24)
Chunk 2176 chars

ding: a list of numbers capturing meaning. At query time, the system compares your question's embedding to chunk embeddings and retrieves the best matches to ground the answer.

Vector (48-D, showing first 24)