Boxy · Knowledge Retrieval · Live Demo
Boxy uses a Large Language Model, a type of AI. When you chat with Boxy, your words become part of the context window that is sent to the model for processing along with relevant information from a Runbox knowledge base to help the model reply. The context window has a cost: every word included in it takes time and money to process. Rather than sending the whole knowledge base and burying the relevant answer in lots of unrelated text which actually degrades the quality of the reply rather than improving it, Boxy only sends part of the knowledge base. Boxy converts your question into 1,024 numbers, finds the knowledge base sections whose meaning is mathematically closest, and uses only those. This technique is called Retrieval-Augmented Generation, or RAG: the AI's reply is generated with help from knowledge retrieved for your question. Type anything below to see how this works with real data.
Your message is sent to an embedding model — a neural network that reads your whole message at once and converts it into 1,024 numbers encoding its meaning. The chart and grids below show what that conversion looks like.
Your message was converted into a vector of 1,024 numbers — we call this an
.
The knowledge base is divided into sections, each covering a specific topic. When the knowledge base was built, each section was converted into 1,024 numbers in the same way as your message, and those vectors were stored.
This grid shows that conversion for your message only — no comparison has happened yet.
Cyan cells are positive dimensions, amber are negative — but these values carry no semantic meaning. They are mathematical outputs of the embedding model, not a reflection of anything in the text itself. No single dimension maps to a human-readable concept such as topic, tone, or sentiment; meaning is distributed across the whole vector simultaneously. Strongly activated dimensions (brighter cells) carry more weight in the similarity calculation; dim cells contribute little.
Hover any cell to explore its value.
Every section in Boxy's knowledge base also has 1,024 numbers, pre-computed and stored. The similarity between your message and each section is measured using cosine similarity — essentially the angle between two sets of numbers in a 1,024-dimensional space. A score of 1.0 would mean identical; most scores are much lower.
Both grids use the same colour language — cyan = positive,
amber = negative, with intensity showing magnitude — so you can compare them directly.
Your message from Step 01 is on the left; the best-matching section retrieved in Step 02 is on the right.
Neither grid involves the comparison itself — they are simply what those two pieces of text look like as numbers.
The green overlay
The bright green cells mark dimensions where both
are strongly activated — high absolute values pointing in the same direction — the dimensions contributing
most positively to the similarity score.
The comparison happened across all 1,024 dimensions simultaneously and collapsed to that single number beneath the match grid.
The green shows why the match scored well — it is not where the calculation occurred.
Hover the match grid to read the matched section.
The chart below shows every section, sorted from closest match to furthest.
The embedding model doesn't operate on whole words. Your message is first broken into tokens — subword units produced by a fixed vocabulary (typically 32,000–100,000 types). "Embedding" might tokenise as ["embed", "##ding"]; a rarer word like "embeddability" might become ["embed", "##d", "##ability"]. Punctuation and spaces are handled as separate tokens. This subword scheme handles rare and compound words gracefully without needing an unbounded vocabulary.
The token sequence is passed through a transformer encoder — a stack of self-attention layers. In each layer, every token attends to every other token, building a contextual representation of the whole sequence. This is what makes transformer embeddings contextual rather than static: "bank" in "river bank" ends up with a different internal representation than "bank" in "bank account" because attention propagates context across the full input. Earlier word2vec-style embeddings assigned each word a single fixed vector regardless of context.
Mean pooling and the sentence vectorAfter the final transformer layer, the per-token representations are mean-pooled — averaged across all token positions — to produce a single fixed-length vector. This is the sentence embedding: one vector of 1,024 dimensions representing the meaning of the entire input. The model is trained using contrastive objectives — exposed to pairs of similar and dissimilar examples — so that semantically similar inputs produce vectors that are close together in this space, and dissimilar inputs produce vectors that are far apart.
Similarity is measured using cosine similarity: the dot product of two L2-normalised vectors, equivalent to cos(θ) where θ is the angle between them in 1,024-dimensional space. Unlike Euclidean distance, cosine similarity is magnitude-invariant — a longer message with more tokens doesn't automatically outscore a shorter one. Mistral Embed returns unit-normalised vectors, so cosine similarity reduces to a plain dot product. In practice, text embeddings from the same domain cluster in roughly the 0.5–0.9 range rather than spanning the full −1 to 1; scores above 0.9 typically indicate near-duplicates or paraphrases.
The 32×32 grids visualise the raw values of each 1,024-dimensional vector. When two passages are semantically related, many dimensions activate similarly — you'll see corresponding patterns of colour in the same grid positions. This isn't a neat feature-per-dimension mapping (the dimensions aren't labelled "topic" or "tone"). It's a distributed representation where meaning is encoded across the whole vector simultaneously, an emergent property of the training process. The green/red overlay visible on the match grid shows exactly this: green cells are dimensions where your message and the chunk agree, red cells are where they diverge.
RAG at scaleAt … chunks, exhaustive cosine search is computationally trivial. Production RAG systems at millions of chunks instead use approximate nearest-neighbour (ANN) indices — structures like HNSW (Hierarchical Navigable Small World graphs) or FAISS (Facebook AI Similarity Search) — to avoid comparing the query against every stored vector. These trade a small accuracy cost for retrieval times that stay fast regardless of corpus size. The chunk vectors are pre-computed offline; only the message is embedded at request time.
The top-scoring sections are retrieved and sent to the AI model alongside your question. The model doesn't search the whole knowledge base — it only sees these excerpts. Everything else is invisible to it.
This page uses Boxy's live knowledge base — the same data that powers real customer support at Runbox. Every result you see is a real retrieval happening in real time.
The technique shown here is called Retrieval-Augmented Generation (RAG). It lets AI systems answer questions accurately from a specific body of knowledge, rather than relying solely on what they learned during training. The embedding model used is Mistral Embed (1,024 dimensions), hosted in the EU.
Boxy is built and maintained by Runbox. Try asking Boxy a question directly →