We rebuilt RAG in a browser tab. Our first bug: every vector was empty. A team that rebuilt its browser-based RAG knowledge bases found in a pre-rebuild audit that no knowledge base had ever stored a single searchable chunk, because SurrealDB saved every vector as an empty array in a SCHEMAFULL table where the vector field was declared TYPE array instead of array. The rebuild, spanning 28 issues across storage, ingestion, search, citations and privacy, fixed the empty-vector bug with that one type change and made every write return added/updated/failed/removed counts, treating zero written rows as a failure rather than success. The team also made ingestion idempotent via deterministic chunkId(kb, source, index) upserts and recorded each knowledge base's embedding model (TF.js Universal Sentence Encoder at 512 dimensions versus MiniLM at 384) alongside its vectors, after the chat assistant's separate routing read a legacy table and returned 0 passages for MiniLM-built knowledge bases. We rebuilt RAG in a browser tab. Our first bug: every vector was empty. Our knowledge bases embed, store and search your documents inside the browser. Before rebuilding them, an audit found that no knowledge base had ever had a single searchable chunk. Ten RAG lessons from that rebuild, written so you can check your own pipeline. You add your documents to an AI assistant, it says they are indexed, and then it answers as if it had never seen them. Most people conclude the AI is dumb. Often the pipeline behind it is quietly returning less than it should. That is the story of our own knowledge bases. They live entirely in the browser: documents are chunked and embedded on your machine, stored in a database that runs inside the tab, and searched from chats, agents and workflows. Nothing goes to a server unless you choose a cloud model. We recently rebuilt the whole thing: 28 issues covering storage, ingestion, search, citations and privacy. The audit before it started with a bad surprise. This post is the list of what we changed, one lesson per section. RAG rarely fails loudly. It fails by returning less, and each lesson below is a place where it did. Indexing that tells the truth First, what sits under the hood. Each layer runs on your machine. If the database-in-a-tab part sounds unlikely, WebAssembly, explained covers how a browser tab became a small computer. 1. Count what you actually wrote The vector field was declared TYPE array in a SCHEMAFULL table, and SurrealDB saved every vector as . The Indexer node reported success every time. Users indexed documents, got a green badge, and then searched nothing. The fix for the empty vectors was one type array