How vectifyai/pageindex works
PageIndex is a vectorless RAG SDK: it builds hierarchical document trees, then uses LLM-guided tools to search them and answer questions. The main workflow starts at the SDK client, selects cloud or local operation, indexes PDFs into trees, and exposes retrieval/chat. Flash adds a text-PDF layout-to-outline pipeline; classic indexing and tree optimization remain distinct paths. Groups and arrows reflect README capabilities and source-index references; several implementation details are unsampled, so uncertain internal transitions are omitted.
Main entry points: client.py PageIndex client · main.py Layout to outline · local_api.py Local API · agent_tools.py Agent retrieval tools
Components 21
SDK and APIs
- PageIndex client
pageindex/client.py - Cloud API
pageindex/cloud_api.py - Local API
pageindex/local_api.py - Local document store
pageindex/local_store.py
Tree indexing
- Classic indexer
pageindex/page_index_classic.py - Tree refinement
pageindex/tree_optimize.py
Flash PDF pipeline
- Flash index API
pageindex/flash/api.py - PDF text parsing
pageindex/flash/parser_pdfium_charlevel/pipeline.py - Layout to outline
pageindex/flash/main.py - Layout and text model
pageindex/flash/model - Text classification
pageindex/flash/classification - Caption labeling
pageindex/flash/labels/caption_text.py - Heading detection
pageindex/flash/heading_detection - Outline assembly
pageindex/flash/outline_assembly/candidates.py
Reasoning retrieval
- Local chat
pageindex/local_chat.py - Agent retrieval tools
pageindex/agent_tools.py - MCP bridge
pageindex/mcp_bridge.py - Agent SDK adapters
pageindex/integrations
Other components
- SDK user
- LLM provider
- PDF document
Connections 24
- SDK user → PageIndex client: submits and queries
- PageIndex client → Cloud API: uses cloud mode
pageindex/client.py - PageIndex client → Local API: uses local mode
pageindex/client.py - Local API → Local document store: reads and writes
pageindex/local_api.py - Local API → Flash index API: indexes with
pageindex/local_api.py - Local API → Classic indexer: indexes with
pageindex/local_api.py - PDF document → Local API: provides PDF
- Flash index API → Layout to outline: runs pipeline
pageindex/flash/api.py - Flash index API → Tree refinement: refines tree
pageindex/flash/api.py - Layout to outline → PDF text parsing: parses pages
pageindex/flash/main.py - Layout to outline → Layout and text model: uses structures
pageindex/flash/main.py - Layout to outline → Text classification: classifies text
pageindex/flash/main.py - Layout to outline → Caption labeling: labels captions
pageindex/flash/main.py - Layout to outline → Heading detection: detects headings
pageindex/flash/main.py - Layout to outline → Outline assembly: assembles outline
pageindex/flash/main.py - Classic indexer → Tree refinement: refines tree
pageindex/page_index_classic.py - PageIndex client → Local chat: routes local chat
pageindex/client.py - PageIndex client → Agent retrieval tools: exposes tools
pageindex/client.py - Local chat → Agent retrieval tools: invokes tools
pageindex/local_chat.py - Agent retrieval tools → MCP bridge: uses bridge
pageindex/agent_tools.py - PageIndex client → Agent SDK adapters: offers adapters
pageindex/client.py - Agent SDK adapters → Agent retrieval tools: wraps tool contract
pageindex/integrations/openai_agents.py - Local chat → LLM provider: requests reasoning
- PageIndex client → LLM provider: configures models