Agentic AI

Vectorless RAG

Retrieval without embeddings: PageIndex's tree-based search.

Retrieval without embeddings or a vector store. Instead of cutting a document into chunks and searching for the ones that look most like a question, vectorless RAG keeps the document's own structure as a tree, a table of contents with page numbers and summaries, and lets a model reason its way to the sections that answer the question, the way an expert reads a long report. The module starts with the idea: why similarity isn't relevance, how the tree is built, how the search works, and when it beats vector RAG. Then it indexes "Attention Is All You Need", the paper module 06 searched with vectors, with PageIndex, in its cloud or on your own machine, and builds the retrieval half on top: a tree search, the sections it picks, an answer that cites them, domain rules in the prompt, and PageIndex's own chat, ending with the pipeline in one script with Gemini. Run the notebook cells in order, and try each practice task before you open its solution.

Lessons

  1. 1How vectorless RAG worksWhy similarity isn't relevance, the tree index and how it is built, retrieval as a search with a loop that follows cross-references, vector and vectorless RAG compared, costs and failure modes, when to use which and hybrid designs, interview questions and two practice tasks in plain Python.
  2. 2Index a document with PageIndexInstall PageIndex, load the keys, create the clients, upload a PDF and wait for its tree, fetch and read the tree, print and count its nodes, build it locally with the open-source script or the SDK, build its structure with no model at all, and two practice tasks.
  3. 3Search the tree and answerTree search with a JSON reply, finding the chosen nodes and two pitfalls of page-based trees, answers that cite section and page, the three steps as one function, expert rules in the search prompt, PageIndex's chat with conversation history, cleaning up, the pipeline in one script with Gemini, interview questions and two practice tasks.