Skip to content

Commit 99bb2c2

Browse files
authored
Merge pull request #94 from vectorlessflow/dev
feat(docs): update documentation with agent-based navigation and Quer…
2 parents 820ae97 + e9015f8 commit 99bb2c2

9 files changed

Lines changed: 277 additions & 171 deletions

File tree

docs/blog/2026-04-12-welcome/index.mdx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Traditional RAG systems rely on vector embeddings and similarity search. This ap
1616
Vectorless takes a different path:
1717

1818
- **Hierarchical Semantic Trees** — Documents are parsed into a tree of sections, preserving structure and relationships.
19-
- **LLM Navigation** — Queries are resolved by intelligently traversing the tree, not by comparing vectors.
19+
- **LLM Agent Navigation** — Queries are resolved by agents that navigate the tree using commands (ls, cd, cat, find, grep), making every decision through LLM reasoning.
2020
- **Zero Infrastructure** — No vector DB, no embedding models, no similarity search. Just an LLM API key.
2121

2222
## Quick Start
@@ -25,7 +25,7 @@ Vectorless takes a different path:
2525

2626
```python
2727
import asyncio
28-
from vectorless import Engine, IndexContext
28+
from vectorless import Engine, IndexContext, QueryContext
2929

3030
async def main():
3131
engine = Engine(
@@ -38,7 +38,9 @@ async def main():
3838
doc_id = result.doc_id
3939

4040
# Query
41-
answer = await engine.query(doc_id, "What is the total revenue?")
41+
answer = await engine.query(
42+
QueryContext("What is the total revenue?").with_doc_ids([doc_id])
43+
)
4244
print(answer.single().content)
4345

4446
asyncio.run(main())
@@ -69,11 +71,17 @@ async fn main() -> vectorless::Result<()> {
6971
}
7072
```
7173

72-
## What's Next?
74+
## How It Works
75+
76+
1. **Index** — Documents are parsed into hierarchical semantic trees with pre-computed navigation indexes and keyword mappings.
77+
2. **Query** — The Orchestrator coordinates multi-document retrieval by dispatching Worker agents. Each Worker navigates the tree using commands, collects evidence, and self-evaluates sufficiency.
78+
3. **Result** — Evidence is deduplicated, ranked by BM25 relevance, and returned as original document text.
79+
80+
## What's Next
7381

74-
- Cross-document relationship graph
75-
- Incremental indexing with content fingerprinting
76-
- Multi-format support (Markdown, PDF, DOCX)
82+
- Cross-document graph-aware retrieval with score boosting
83+
- DOCX format support
84+
- Streaming query results with real-time progress events
7785

7886
The project is open source under Apache-2.0. Contributions welcome!
7987

docs/docs/architecture.mdx

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Vectorless transforms documents into hierarchical semantic trees and uses LLM-po
1616
1717
┌──────────────┐ ┌──────▼───────┐
1818
│ Result │◀────│ Retrieval │
19-
(Answer) │ │ Pipeline │
19+
(Evidence) │ │ Pipeline │
2020
└──────────────┘ └──────────────┘
2121
```
2222

@@ -33,6 +33,7 @@ The indexing pipeline processes documents through ordered stages:
3333
| **Enhance** | 30 | Generate LLM summaries (Full, Selective, or Lazy strategy) |
3434
| **Enrich** | 40 | Calculate metadata, page ranges, resolve cross-references |
3535
| **Reasoning Index** | 45 | Build keyword-to-node mappings, synonym expansion, summary shortcuts |
36+
| **Navigation Index** | 50 | Build NavEntry + ChildRoute data for agent navigation |
3637
| **Optimize** | 60 | Final tree optimization |
3738

3839
Each stage is independently configurable. The pipeline supports incremental re-indexing via content fingerprinting.
@@ -70,11 +71,11 @@ Engine.query()
7071
→ Dispatcher
7172
→ Query Understanding (LLM) → QueryPlan (intent, concepts, strategy)
7273
→ Orchestrator (always — single or multi-doc)
73-
→ Analyze (LLM selects documents + tasks)
74+
→ Analyze (LLM reviews DocCards, selects documents + tasks)
7475
→ Supervisor Loop:
7576
Dispatch Workers → Evaluate (LLM sufficiency check)
7677
→ if insufficient → Replan (LLM) → loop
77-
→ Rerank (dedup → BM25 score → synthesis/fusion)
78+
→ Rerank (dedup → BM25 score → evidence formatting)
7879
```
7980

8081
### Query Understanding
@@ -84,41 +85,75 @@ Every query first passes through LLM-based understanding:
8485
| Field | Description |
8586
|-------|-------------|
8687
| **Intent** | Factual, Analytical, Navigational, or Summary |
87-
| **Complexity** | Simple, Moderate, or Complex |
88-
| **Key Concepts** | LLM-extracted concepts (distinct from keywords) |
8988
| **Strategy Hint** | focused, exploratory, comparative, or summary |
89+
| **Key Concepts** | LLM-extracted concepts (distinct from keywords) |
9090

9191
### Orchestrator (Supervisor)
9292

9393
The Orchestrator is the central coordinator. It always runs — even for single-document queries. Its supervisor loop:
9494

95-
1. **Analyze** — LLM reviews DocCards and selects relevant documents with specific tasks
95+
1. **Analyze** — LLM reviews DocCards (lightweight metadata) and selects relevant documents with specific tasks
9696
2. **Dispatch** — Fan-out Workers in parallel (one per document)
9797
3. **Evaluate** — LLM checks if collected evidence is sufficient to answer the query
9898
4. **Replan** (if insufficient) — LLM identifies missing information and dispatches additional Workers
9999

100+
When the user specifies document IDs directly, the Orchestrator skips the analysis phase and dispatches Workers immediately.
101+
100102
### Worker (Evidence Collector)
101103

102-
Each Worker navigates a single document's tree to collect evidence:
104+
Each Worker navigates a single document's tree to collect evidence through a command-based loop:
103105

104106
1. **Bird's-eye**`ls` the root for an overview
105-
2. **Plan** — LLM generates a navigation plan
106-
3. **Navigate** — Loop: LLM command → execute → repeat (with budget)
107+
2. **Plan** — LLM generates a navigation plan based on keyword index hits
108+
3. **Navigate** — Loop: LLM selects command → execute → observe result → repeat
107109
4. **Return** — Collected evidence only — no answer synthesis
108110

109-
Workers use tree commands (`ls`, `cd`, `cat`, `grep`, `find`, `findtree`) and a `check` command for self-evaluation.
111+
#### Available Commands
112+
113+
| Command | Description |
114+
|---------|-------------|
115+
| `ls` | List children at current position (with summaries and leaf counts) |
116+
| `cd <name>` | Enter a child node |
117+
| `cd ..` | Go back to parent |
118+
| `cat <name>` | Read node content (automatically collected as evidence) |
119+
| `head <name>` | Preview first N lines (does NOT collect evidence) |
120+
| `find <keyword>` | Search the document's ReasoningIndex for a keyword |
121+
| `findtree <pattern>` | Search for nodes by title pattern (case-insensitive) |
122+
| `grep <pattern>` | Regex search across content in current subtree |
123+
| `wc <name>` | Show content size (lines, words, chars) |
124+
| `pwd` | Show current navigation path |
125+
| `check` | Evaluate if collected evidence is sufficient |
126+
| `done` | End navigation |
127+
128+
#### Navigation Strategy
129+
130+
Workers prioritize keyword-based navigation over manual exploration:
131+
132+
1. When keyword index hits are available, Workers use `find` with the exact keyword to jump directly to relevant sections
133+
2. Workers use `ls` when no keyword hints exist or when discovering unknown structure
134+
3. Workers use `findtree` when the section title pattern is known but not the exact name
135+
136+
#### Dynamic Re-planning
137+
138+
After a `check` command finds insufficient evidence, the Worker triggers a re-plan — the LLM generates a new navigation plan based on what's missing. This allows the Worker to adapt its strategy mid-navigation.
110139

111140
### Rerank Pipeline
112141

113142
After all Workers complete, the Orchestrator runs the final pipeline:
114143

115144
1. **Dedup** — Remove duplicate and low-quality evidence
116145
2. **BM25 Scoring** — Rank evidence by keyword relevance
117-
3. **Answer Generation** — LLM synthesizes or fuses evidence into a final answer
146+
3. **Evidence Formatting** — Return original document text with source attribution
147+
148+
The system returns raw evidence text — no LLM synthesis or paraphrasing. This ensures the user sees the exact document content that matches their query.
149+
150+
## DocCard Catalog
151+
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.
118153

119154
## Cross-Document Graph
120155

121-
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.
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.
122157

123158
## Zero Infrastructure
124159

docs/docs/features/cross-document-graph.mdx

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,36 +23,18 @@ Document A ←── 0.72 ──→ Document B
2323

2424
### Graph Building
2525

26-
After each indexing operation, the graph is automatically rebuilt:
26+
After each indexing operation, the graph is automatically rebuilt as a background task:
2727

2828
1. Extract keyword profiles from each document's reasoning index
2929
2. Compute pairwise Jaccard similarity
3030
3. Create edges for document pairs exceeding the similarity threshold
3131
4. Store the graph in the workspace
3232

33-
### Graph-Aware Retrieval
33+
The graph builder uses keyword weights from the ReasoningIndex — keywords that appear in titles get 2.0× weight, summaries 1.5×, and content 1.0×. This ensures that structurally important keywords have more influence on the similarity calculation.
3434

35-
When using the cross-document strategy, the graph boosts scores for connected documents:
35+
### Accessing the Graph
3636

37-
1. Search each document independently
38-
2. Identify high-confidence results (score > 0.5)
39-
3. For each high-confidence result, boost neighbor documents' scores
40-
4. Re-rank the merged result set
41-
42-
```python
43-
from vectorless import Engine, QueryContext
44-
45-
engine = Engine(api_key="sk-...", model="gpt-4o")
46-
47-
# Query across all documents with graph boosting
48-
result = await engine.query(
49-
QueryContext("Compare the approaches")
50-
)
51-
```
52-
53-
## Accessing the Graph
54-
55-
### Python
37+
#### Python
5638

5739
```python
5840
graph = await engine.get_graph()
@@ -67,7 +49,7 @@ if graph:
6749
print(f"{edge.target_doc_id} (weight: {edge.weight:.2f})")
6850
```
6951

70-
### Rust
52+
#### Rust
7153

7254
```rust
7355
if let Some(graph) = engine.get_graph().await? {
@@ -100,3 +82,7 @@ min_keyword_jaccard: 0.1 — Minimum Jaccard similarity threshold
10082
max_keywords_per_doc: 50 — Max keywords extracted per document
10183
max_edges_per_node: 10 — Max edges per document node
10284
```
85+
86+
## Current Status
87+
88+
The graph is built and persisted during indexing. Graph-aware retrieval features (such as score boosting for connected documents) are planned for a future release. Currently, the graph serves as a relationship discovery and inspection tool accessible via the API.

docs/docs/features/summary-strategies.mdx

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 1
44

55
# Summary Strategies
66

7-
Summaries are critical for retrieval quality. The Pilot uses summaries to evaluate candidate nodes during tree navigation. Without summaries, the Pilot can only use node titles for decision-making, which significantly reduces accuracy.
7+
Summaries are critical for retrieval quality. The Worker agent uses summaries in the NavigationIndex to decide which branches to explore and where to navigate. Without summaries, the Worker can only use node titles for decision-making, which significantly reduces accuracy.
88

99
## Available Strategies
1010

@@ -32,7 +32,7 @@ let strategy = SummaryStrategy::selective(100, true);
3232
- `min_tokens` — Minimum content tokens to generate a summary (default: 100)
3333
- `branch_only` — Only generate for non-leaf nodes (default: true)
3434

35-
**Trade-off**: Lower indexing cost, but leaf nodes lack summaries. The Pilot falls back to title-only evaluation at leaf level.
35+
**Trade-off**: Lower indexing cost, but leaf nodes lack summaries. The Worker falls back to title-only evaluation at leaf level.
3636

3737
### Lazy
3838

@@ -56,10 +56,23 @@ let strategy = SummaryStrategy::lazy(true);
5656

5757
## How Summaries Are Used
5858

59-
During retrieval, the Pilot builds context for each candidate node:
59+
During retrieval, the Worker agent reads summary data from the NavigationIndex at each decision point:
6060

61-
1. **Title** — Always available, highest priority signal
62-
2. **Summary** — Used for semantic evaluation at fork points
63-
3. **Content** — Used for BM25 scoring and final result
61+
1. **`ls` output** — Child nodes show their descriptions (derived from summaries) and leaf counts
62+
2. **Navigation decisions** — The LLM evaluates summaries to decide which branch to enter
63+
3. **Keyword index** — Topic tags from summaries are indexed for `find` command lookups
64+
4. **DocCards** — Root-level summaries power the Orchestrator's document selection
6465

65-
When a node has no summary, the Pilot's decision quality degrades. This is why **Full** is the default — it ensures the Pilot always has summaries to work with.
66+
When a node has no summary, the Worker's navigation quality degrades. This is why **Full** is the default — it ensures the Worker always has summary context to work with.
67+
68+
## Navigation-Oriented Summaries
69+
70+
Branch nodes receive structured summaries with three components:
71+
72+
| Component | Purpose | Used By |
73+
|-----------|---------|---------|
74+
| **OVERVIEW** | 2-3 sentence routing summary | Worker's `ls` output |
75+
| **QUESTIONS** | 3-5 typical questions this branch can answer | Keyword index |
76+
| **TAGS** | 2-4 topic keywords | ReasoningIndex `find` command |
77+
78+
This structured format enables the Worker to quickly assess whether a branch is worth exploring without reading its full content.

docs/docs/getting-started.mdx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,7 @@ async fn main() -> vectorless::Result<()> {
8484
let result = engine.query(
8585
QueryContext::new("What is the total revenue?").with_doc_ids(vec![doc_id.to_string()])
8686
).await?;
87-
88-
if let Some(item) = result.single() {
89-
println!("{}", item.content);
90-
}
87+
println!("{}", result.content);
9188

9289
Ok(())
9390
}
@@ -97,4 +94,4 @@ async fn main() -> vectorless::Result<()> {
9794

9895
- [Architecture](/docs/architecture) — Understand the indexing and retrieval pipeline
9996
- [Indexing Overview](/docs/indexing/overview) — Learn about each pipeline stage
100-
- [Retrieval Strategies](/docs/retrieval/strategies)Choose the right strategy for your use case
97+
- [Retrieval Strategies](/docs/retrieval/strategies)Understand how queries are processed

docs/docs/intro.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ It transforms documents into hierarchical semantic trees and uses LLMs to naviga
1212

1313
1. **Parse** — Documents (Markdown, PDF) are parsed into hierarchical semantic trees, preserving structure and relationships between sections.
1414
2. **Index** — Trees are stored with metadata, keywords, and summaries. The pipeline resolves cross-references ("see Section 2.1") and expands keywords with LLM-generated synonyms for improved recall. Incremental indexing skips unchanged files via content fingerprinting.
15-
3. **Query** — An LLM navigates the tree to find the most relevant sections. Multiple search algorithms (Beam Search, MCTS, Greedy) are available, and the Pilot component provides LLM-guided navigation at key decision points.
15+
3. **Query** — An LLM-powered agent navigates the tree to find the most relevant sections. The Orchestrator coordinates multi-document queries, dispatching Workers that use `ls`, `cd`, `cat`, `find`, and `grep` commands to explore the tree and collect evidence.
1616

1717
## Quick Start
1818

@@ -24,7 +24,7 @@ pip install vectorless
2424

2525
```python
2626
import asyncio
27-
from vectorless import Engine, IndexContext
27+
from vectorless import Engine, IndexContext, QueryContext
2828

2929
async def main():
3030
engine = Engine(
@@ -35,7 +35,9 @@ async def main():
3535
result = await engine.index(IndexContext.from_path("./report.pdf"))
3636
doc_id = result.doc_id
3737

38-
answer = await engine.query(doc_id, "What is the total revenue?")
38+
answer = await engine.query(
39+
QueryContext("What is the total revenue?").with_doc_ids([doc_id])
40+
)
3941
print(answer.single().content)
4042

4143
asyncio.run(main())
@@ -74,11 +76,12 @@ async fn main() -> vectorless::Result<()> {
7476
## Features
7577

7678
- **Hierarchical Semantic Trees** — Preserves document structure, not flat chunks
77-
- **LLM-Powered Retrieval**Structural reasoning over the tree, not vector similarity
78-
- **Cross-Reference Navigation** — Automatically resolves "see Section 2.1", "Appendix G" references and follows them during retrieval
79+
- **LLM-Powered Agent Navigation**Worker agents navigate the tree using commands (ls, cd, cat, find, grep), making every retrieval decision through LLM reasoning
80+
- **Cross-Reference Resolution** — Automatically resolves "see Section 2.1", "Appendix G" references during indexing
7981
- **Synonym Expansion** — LLM-generated synonyms for indexed keywords improve recall for differently-worded queries
80-
- **Multi-Algorithm Search**Beam Search, MCTS, Greedy, and ToC Navigator with LLM Pilot guidance
82+
- **Orchestrator Supervisor Loop**Multi-document queries are coordinated by an LLM supervisor that dispatches Workers, evaluates evidence, and replans when needed
8183
- **Cross-Document Graph** — Automatic relationship discovery between documents via shared keywords
8284
- **Incremental Indexing** — Content fingerprinting skips unchanged files
85+
- **DocCard Catalog** — Lightweight document metadata index enables fast multi-document analysis without loading full documents
8386
- **Multi-Format** — Markdown and PDF support
8487
- **Zero Infrastructure** — No vector DB, no embedding models, just an LLM API key

0 commit comments

Comments
 (0)