Skip to content

Commit 9acb0b9

Browse files
authored
Merge pull request #116 from vectorlessflow/dev
Dev
2 parents ad4448f + e1d0632 commit 9acb0b9

213 files changed

Lines changed: 8760 additions & 14954 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ members = [
1414
# "vectorless-core/vectorless-query",
1515
# "vectorless-core/vectorless-agent",
1616
# "vectorless-core/vectorless-retrieval",
17-
"vectorless-core/vectorless-index",
18-
"vectorless-core/vectorless-rerank",
17+
# "vectorless-core/vectorless-rerank",
18+
"vectorless-core/vectorless-compiler",
1919
"vectorless-core/vectorless-primitives",
2020
"vectorless-core/vectorless-engine",
2121
"vectorless-core/vectorless-py",
@@ -24,7 +24,7 @@ resolver = "2"
2424

2525
[workspace.package]
2626
version = "0.1.12"
27-
description = "Document Understanding Engine for AI"
27+
description = "Knowing by reasoning, not vectors."
2828
edition = "2024"
2929
authors = ["zTgx <beautifularea@gmail.com>"]
3030
license = "Apache-2.0"

HISTORY.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# HISTORY
22

3+
## 0.1.12 (2026-04-24)
4+
5+
- **Compile pipeline**: renamed index pipeline to compile pipeline with passes-based architecture
6+
- **Compiler refactor**: renamed stages to passes, removed deprecated `StageResult` alias and `CustomStageBuilder`
7+
- New backend compilation passes: query routing, reasoning chains, overlap detection, and scoring
8+
- Agent acceleration data added to compiled documents
9+
- LLM-powered cross-document insight extraction in ask module
10+
- Enhanced JSON parsing with proper error handling
11+
- Upgraded minimum Python version to 3.11
12+
- Removed unused modules: agent, memory backend, validation, ReferenceResolver, SufficiencyLevel
13+
- Restructured configuration modules and removed legacy retrieval config
14+
- Simplified storage layer by removing memory backend
15+
- Documentation updates for architecture and compilation pipeline
16+
317
## 0.1.11 (2026-04-21)
418

519
- Project description updated to "reasoning-based document engine"

docs/docs/architecture.mdx

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Vectorless transforms documents into hierarchical semantic trees and uses LLM-po
1010

1111
```text
1212
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
13-
│ Document │────▶│ Index │────▶│ Storage │
13+
│ Document │────▶│ Compile │────▶│ Storage │
1414
│ (PDF/MD) │ │ Pipeline │ │ (Disk) │
1515
└──────────────┘ └──────────────┘ └──────┬───────┘
1616
@@ -20,23 +20,42 @@ Vectorless transforms documents into hierarchical semantic trees and uses LLM-po
2020
└──────────────┘ └──────────────┘
2121
```
2222

23-
## Index Pipeline
23+
## Compile Pipeline
2424

25-
The indexing pipeline processes documents through ordered stages:
25+
The compile pipeline processes documents through four phases (Frontend → Analysis → Transform → Backend), each containing independent passes:
2626

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-
| **Navigation Index** | 50 | Build NavEntry + ChildRoute data for agent navigation |
37-
| **Optimize** | 60 | Final tree optimization |
27+
| Phase | Pass | Priority | Description |
28+
|-------|------|----------|-------------|
29+
| **Frontend** | Parse | 10 | Parse document into raw nodes (Markdown headings, PDF pages) |
30+
| **Frontend** | Build | 20 | Construct arena-based tree with thinning and content merge |
31+
| **Analysis** | Validate | 22 | Tree integrity checks |
32+
| **Transform** | Split | 25 | Split oversized leaf nodes (>4000 tokens) |
33+
| **Transform** | Enhance | 30 | Generate LLM summaries (Full, Selective, or Lazy strategy) |
34+
| **Transform** | Enrich | 40 | Calculate metadata, page ranges, resolve cross-references |
35+
| **Backend** | Reasoning Index | 45 | Build keyword-to-node mappings, synonym expansion, summary shortcuts |
36+
| **Backend** | Concept | 46 | Extract key concepts with section associations |
37+
| **Backend** | Navigation Index | 50 | Build NavEntry + ChildRoute data for agent navigation |
38+
| **Backend** | Route | 52 | Build query routing table (intent routes + concept routes) |
39+
| **Backend** | Chain | 54 | Build reasoning chains from cross-references |
40+
| **Backend** | Overlap | 56 | Detect content overlap between nodes (Jaccard similarity) |
41+
| **Backend** | Score | 58 | Compute evidence quality scores (density, richness, specificity) |
42+
| **Backend** | Verify | 59 | Validate compiled output integrity |
43+
| **Backend** | Optimize | 60 | Final tree optimization |
3844

39-
Each stage is independently configurable. The pipeline supports incremental re-indexing via content fingerprinting.
45+
Each pass is independently configurable. The pipeline supports incremental recompilation via content fingerprinting and checkpoint/resume for fault tolerance.
46+
47+
### Agent Acceleration Data
48+
49+
The backend passes produce pre-computed acceleration data used by Workers during retrieval:
50+
51+
| Data | Pass | Purpose |
52+
|------|------|---------|
53+
| **QueryRoutingTable** | Route | Maps intents and concepts to scored target nodes |
54+
| **ChainIndex** | Chain | Connects sections via reasoning chains (elaboration, supporting, etc.) |
55+
| **ContentOverlapMap** | Overlap | Flags duplicate/subset/summary overlap between nodes |
56+
| **EvidenceScoreMap** | Score | Ranks nodes by information density and data richness |
57+
58+
This data is injected as Phase 1.5 hints into the Worker's navigation plan, allowing the LLM to make informed routing decisions without additional navigation steps.
4059

4160
## Tree Structure
4261

@@ -104,7 +123,7 @@ When the user specifies document IDs directly, the Orchestrator skips the analys
104123
Each Worker navigates a single document's tree to collect evidence through a command-based loop:
105124

106125
1. **Bird's-eye**`ls` the root for an overview
107-
2. **Plan** — LLM generates a navigation plan based on keyword index hits
126+
2. **Plan** — LLM generates a navigation plan based on keyword index hits + acceleration data
108127
3. **Navigate** — Loop: LLM selects command → execute → observe result → repeat
109128
4. **Return** — Collected evidence only — no answer synthesis
110129

@@ -132,6 +151,7 @@ Workers prioritize keyword-based navigation over manual exploration:
132151
1. When keyword index hits are available, Workers use `find` with the exact keyword to jump directly to relevant sections
133152
2. Workers use `ls` when no keyword hints exist or when discovering unknown structure
134153
3. Workers use `findtree` when the section title pattern is known but not the exact name
154+
4. Pre-computed acceleration data (routes, scores, chains) is injected as Phase 1.5 hints to guide the Worker toward high-value nodes
135155

136156
#### Dynamic Re-planning
137157

@@ -149,11 +169,11 @@ The system returns raw evidence text — no LLM synthesis or paraphrasing. This
149169

150170
## DocCard Catalog
151171

152-
When multiple documents are indexed, Vectorless maintains a lightweight `catalog.bin` containing DocCard metadata for each document. This allows the Orchestrator to analyze and select relevant documents without loading the full document trees — a significant optimization for workspaces with many documents.
172+
When multiple documents are compiled, Vectorless maintains a lightweight `catalog.bin` containing DocCard metadata for each document. This allows the Orchestrator to analyze and select relevant documents without loading the full document trees — a significant optimization for workspaces with many documents.
153173

154174
## Cross-Document Graph
155175

156-
When multiple documents are indexed, Vectorless automatically builds a relationship graph based on shared keywords and Jaccard similarity. The graph is constructed as a background task after each indexing operation.
176+
When multiple documents are compiled, Vectorless automatically builds a relationship graph based on shared keywords and Jaccard similarity. The graph is constructed as a background task after each compilation operation.
157177

158178
## Zero Infrastructure
159179

docs/docs/compiler/checkpoint.mdx

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
sidebar_position: 6
3+
---
4+
5+
# Checkpoint and Resume
6+
7+
Checkpointing allows the pipeline to resume from where it left off after an interruption (crash, timeout, process kill). This is critical for large documents where LLM-enhanced compilation can take minutes.
8+
9+
## How It Works
10+
11+
When `PipelineOptions::checkpoint_dir` is set, the orchestrator saves state to disk after each execution group completes:
12+
13+
```text
14+
Group 0: [ParsePass] → save checkpoint
15+
Group 1: [BuildPass] → save checkpoint
16+
Group 2: [ValidatePass, SplitPass] → save checkpoint
17+
Group 3: [EnhancePass] → save checkpoint ← expensive LLM calls
18+
...
19+
```
20+
21+
On restart, the orchestrator loads the checkpoint and skips already-completed passes.
22+
23+
## What's Stored
24+
25+
Each checkpoint contains:
26+
27+
```rust
28+
pub struct PipelineCheckpoint {
29+
pub doc_id: String,
30+
pub source_hash: String, // SHA-256 of source content
31+
pub processing_version: u32, // Algorithm version
32+
pub config_fingerprint: String, // Hash of PipelineOptions
33+
pub completed_stages: Vec<String>, // Names of completed passes
34+
pub context_data: CheckpointContextData,
35+
pub timestamp: DateTime<Utc>,
36+
}
37+
38+
pub struct CheckpointContextData {
39+
pub raw_nodes: Vec<RawNode>, // From ParsePass
40+
pub tree: Option<DocumentTree>, // From BuildPass
41+
pub metrics: IndexMetrics, // Cumulative metrics
42+
pub page_count: Option<usize>,
43+
pub line_count: Option<usize>,
44+
pub description: Option<String>,
45+
}
46+
```
47+
48+
## Validation
49+
50+
Before resuming, the checkpoint is validated against the current input:
51+
52+
| Check | Purpose |
53+
|---|---|
54+
| `source_hash` matches | Source content hasn't changed |
55+
| `processing_version` matches | Algorithm hasn't been upgraded |
56+
| `config_fingerprint` matches | Pipeline options haven't changed |
57+
58+
If any check fails, the checkpoint is discarded and the pipeline starts fresh.
59+
60+
## Lifecycle
61+
62+
```text
63+
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
64+
│ Start │────▶│ Load │────▶│ Valid? │
65+
│ Pipeline │ │ Checkpoint │ │ │
66+
└──────────────┘ └──────────────┘ └──┬───────┬───┘
67+
│ │
68+
Yes │ No │
69+
│ │
70+
┌─────────▼──┐ ┌─▼──────────┐
71+
│ Resume from │ │ Start fresh │
72+
│ completed │ │ │
73+
│ stages │ │ │
74+
└──────┬──────┘ └────────────┘
75+
76+
┌────────────▼─────────────┐
77+
│ Execute remaining passes │
78+
│ Save after each group │
79+
└────────────┬─────────────┘
80+
81+
┌────────────▼─────────────┐
82+
│ All complete? │
83+
│ → Clear checkpoint file │
84+
└──────────────────────────┘
85+
```
86+
87+
## Configuration
88+
89+
```rust
90+
let options = PipelineOptions::default()
91+
.with_checkpoint_dir("./workspace/checkpoints");
92+
```
93+
94+
Checkpoints are stored as individual JSON files in the checkpoint directory, one per document (keyed by `doc_id`). On successful completion, the checkpoint file is deleted.
95+
96+
## CheckpointManager API
97+
98+
```rust
99+
let manager = CheckpointManager::new("./checkpoints");
100+
101+
// Save checkpoint
102+
manager.save(&doc_id, &checkpoint)?;
103+
104+
// Load checkpoint
105+
let checkpoint = manager.load(&doc_id);
106+
107+
// Check if valid for resume
108+
let valid = CheckpointManager::is_valid_for_resume(
109+
&checkpoint,
110+
&source_hash,
111+
processing_version,
112+
&config_fingerprint,
113+
);
114+
115+
// Clear after successful completion
116+
manager.clear(&doc_id)?;
117+
```

0 commit comments

Comments
 (0)