|
| 1 | +--- |
| 2 | +sidebar_position: 3 |
| 3 | +--- |
| 4 | + |
| 5 | +# Architecture |
| 6 | + |
| 7 | +Vectorless transforms documents into hierarchical semantic trees and uses LLM-powered reasoning to navigate them. This page describes the end-to-end pipeline. |
| 8 | + |
| 9 | +## High-Level Flow |
| 10 | + |
| 11 | +```text |
| 12 | +┌──────────────┐ ┌──────────────┐ ┌──────────────┐ |
| 13 | +│ Document │────▶│ Index │────▶│ Storage │ |
| 14 | +│ (PDF/MD) │ │ Pipeline │ │ (Disk) │ |
| 15 | +└──────────────┘ └──────────────┘ └──────┬───────┘ |
| 16 | + │ |
| 17 | + ┌──────────────┐ ┌──────▼───────┐ |
| 18 | + │ Result │◀────│ Retrieval │ |
| 19 | + │ (Answer) │ │ Pipeline │ |
| 20 | + └──────────────┘ └──────────────┘ |
| 21 | +``` |
| 22 | + |
| 23 | +## Index Pipeline |
| 24 | + |
| 25 | +The indexing pipeline processes documents through ordered stages: |
| 26 | + |
| 27 | +| Stage | Priority | Description | |
| 28 | +|-------|----------|-------------| |
| 29 | +| **Parse** | 10 | Parse document into raw nodes (Markdown headings, PDF pages) | |
| 30 | +| **Build** | 20 | Construct arena-based tree with thinning and content merge | |
| 31 | +| **Validate** | 22 | Tree integrity checks | |
| 32 | +| **Split** | 25 | Split oversized leaf nodes (>4000 tokens) | |
| 33 | +| **Enhance** | 30 | Generate LLM summaries (Full, Selective, or Lazy strategy) | |
| 34 | +| **Enrich** | 40 | Calculate metadata, page ranges, resolve cross-references | |
| 35 | +| **Reasoning Index** | 45 | Build keyword-to-node mappings, synonym expansion, summary shortcuts | |
| 36 | +| **Optimize** | 60 | Final tree optimization | |
| 37 | + |
| 38 | +Each stage is independently configurable. The pipeline supports incremental re-indexing via content fingerprinting. |
| 39 | + |
| 40 | +## Tree Structure |
| 41 | + |
| 42 | +Each node in the tree contains: |
| 43 | + |
| 44 | +```text |
| 45 | +TreeNode |
| 46 | +├── title — Section heading |
| 47 | +├── content — Raw text (leaf nodes) |
| 48 | +├── summary — LLM-generated summary |
| 49 | +├── structure — Hierarchical index (e.g., "1.2.3") |
| 50 | +├── depth — Tree depth (root = 0) |
| 51 | +├── references[] — Resolved cross-references ("see Section 2.1" → NodeId) |
| 52 | +├── token_count — Estimated token count |
| 53 | +└── page_range — Start/end page (PDF) |
| 54 | +``` |
| 55 | + |
| 56 | +## Retrieval Pipeline |
| 57 | + |
| 58 | +The retrieval pipeline consists of four phases: |
| 59 | + |
| 60 | +1. **Analyze** — Detect query complexity, extract keywords, decompose complex queries |
| 61 | +2. **Plan** — Select retrieval strategy and search algorithm |
| 62 | +3. **Search** — Execute tree traversal with Pilot guidance |
| 63 | +4. **Evaluate** — Score, deduplicate, and aggregate results |
| 64 | + |
| 65 | +### Pilot |
| 66 | + |
| 67 | +The Pilot is the core intelligence component. It provides LLM-guided navigation at key decision points: |
| 68 | + |
| 69 | +- **Fork points** — When multiple children exist, Pilot evaluates which path to follow |
| 70 | +- **Backtracking** — When a path yields insufficient results, Pilot suggests alternatives |
| 71 | +- **Binary pruning** — Quick relevance filter for nodes with many children |
| 72 | + |
| 73 | +### Search Algorithms |
| 74 | + |
| 75 | +| Algorithm | Description | Use Case | |
| 76 | +|-----------|-------------|----------| |
| 77 | +| **Beam Search** | Explores multiple paths with backtracking | General purpose (recommended) | |
| 78 | +| **MCTS** | Monte Carlo Tree Search with UCT selection | Complex multi-hop queries | |
| 79 | +| **Pure Pilot** | Greedy single-path, Pilot at every level | High-accuracy, higher token cost | |
| 80 | +| **ToC Navigator** | Table-of-contents based location | Broad queries ("what is this about?") | |
| 81 | + |
| 82 | +## Cross-Document Graph |
| 83 | + |
| 84 | +When multiple documents are indexed, Vectorless automatically builds a relationship graph based on shared keywords and Jaccard similarity. This graph enables cross-document retrieval with score boosting. |
| 85 | + |
| 86 | +## Zero Infrastructure |
| 87 | + |
| 88 | +The entire system requires only an LLM API key. No vector database, no embedding models, no additional infrastructure. Trees and metadata are persisted to the local filesystem in the workspace directory. |
0 commit comments