🧠 Reasoning-Based RAG with PageIndex

We provide a simple example of using PageIndex to build reasoning-based retrieval systems for documents.

Preprocessing Workflow

  1. Process documents using PageIndex to generate tree structures
  2. Store the tree structures and their corresponding document IDs in a database table
  3. Store the contents of each node in a separate table, indexed by node ID and tree ID

Reasoning-Based RAG Pipeline

  1. Query Preprocessing

    • Analyze the query to identify the required knowledge
    • Break down complex queries into sub-queries
  2. Document Search (Learn more →)

    • Search the relevant documents and their IDs
    • Fetch corresponding tree structures from the database
  3. Node Search (Learn more →)

    • Search through tree structures to identify relevant nodes
    • Prioritize nodes based on relevance and context
  4. LLM Generation

    • Fetch the corresponding contents of the selected nodes
    • Format and extract the relevant information
    • Send the assembled context with the original query to the LLM
    • Generate contextually informed responses

📢 Stay Tuned!
We are continuously updating our documentation with new examples and best practices.
Last updated: 2025/05/01