Skip to content
Merged

Dev #82

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
90205d6
feat(document): add navigation module with NavigationIndex structures
zTgx Apr 18, 2026
bf9e6fa
feat(navigation): add custom serialization for NavigationIndex
zTgx Apr 18, 2026
9e9f8be
feat: add serde helpers for HashMap<NodeId, _> serialization
zTgx Apr 18, 2026
577c66e
feat: add indexing pipeline flow example with detailed metrics
zTgx Apr 18, 2026
efa90f9
feat(pipeline): enhance parallel execution to support N-stage groups
zTgx Apr 18, 2026
0e89a3a
test: add comprehensive test suite for optimization and reasoning stages
zTgx Apr 18, 2026
40a7333
feat(index): add routing keywords and question hints to tree nodes
zTgx Apr 18, 2026
eaa700a
docs(indexing): rewrite overview with detailed pipeline documentation
zTgx Apr 18, 2026
31d36e6
Merge pull request #80 from vectorlessflow/feat-indexing-flow
zTgx Apr 18, 2026
82c854a
feat(document): add DocCard and SectionCard for multi-document orches…
zTgx Apr 18, 2026
e15ced7
refactor(index): add Send bound to future types in pipeline orchestrator
zTgx Apr 18, 2026
54230ae
feat(agent): add core retrieval agent architecture
zTgx Apr 18, 2026
4a0ca77
feat(agent): add prompts module with template functions and parsers
zTgx Apr 18, 2026
002607d
feat(agent): implement orchestrator and subagent loops for retrieval
zTgx Apr 18, 2026
6920423
refactor(docs): update color scheme and navbar styling
zTgx Apr 18, 2026
7cbb1cf
refactor(retrieval): simplify complexity detection by removing LLM fa…
zTgx Apr 18, 2026
8a2ffe1
feat(agent): add event system for real-time streaming and progress mo…
zTgx Apr 18, 2026
1674a5e
feat(docs): add dark mode toggle and improve theme colors
zTgx Apr 18, 2026
2b01f18
refactor(rust): reformat code for improved readability
zTgx Apr 18, 2026
338c8ec
feat(config): remove pipeline strategy option from retrieval configur…
zTgx Apr 18, 2026
20b6e34
feat(retrieval-agent): add expanded context analysis for better docum…
zTgx Apr 18, 2026
5e2669f
feat(agent): add new navigation commands for enhanced document explor…
zTgx Apr 18, 2026
7f5e20f
feat(retrieval-agent): add navigation planning and stuck detection
zTgx Apr 18, 2026
9396ec5
refactor(agent): remove unused ToolResultLike wrapper and simplify co…
zTgx Apr 19, 2026
0203971
feat(agent): add LLM call budget and improve navigation control
zTgx Apr 19, 2026
ed27a72
feat(agent): add character limits and truncation for evidence and fee…
zTgx Apr 19, 2026
22d91bc
feat(tree): add max_depth method for calculating tree depth
zTgx Apr 19, 2026
747c14c
feat(llm): add request timeout configuration and implementation
zTgx Apr 19, 2026
873a179
feat(retrieval-agent): improve no evidence handling with informative …
zTgx Apr 19, 2026
a62c0f1
feat(agent): enhance subagent tool with question hints and topic tags
zTgx Apr 19, 2026
c92201c
refactor(retrieval/agent): remove unused visited_titles_text method
zTgx Apr 19, 2026
fefcb46
refactor(rust): clean up code formatting and remove unnecessary line …
zTgx Apr 19, 2026
62aa2c5
feat(retrieval): enhance fast path with keyword hit preservation for …
zTgx Apr 19, 2026
96db575
feat(retrieval): enhance agent orchestration and dynamic re-planning
zTgx Apr 19, 2026
9aafba2
feat(retrieval): add semantic hints and improve ancestor path building
zTgx Apr 19, 2026
c9045db
feat(retrieval): enhance orchestrator with quality filtering and impr…
zTgx Apr 19, 2026
0556633
feat(agent): add detailed metrics and timing for agent operations
zTgx Apr 19, 2026
5e82b69
feat(retrieval): add query complexity detection and adaptive budget a…
zTgx Apr 19, 2026
b077511
feat(retrieval): enhance semantic hints with BM25 scoring
zTgx Apr 19, 2026
e87b02e
refactor(rust): remove content aggregator and unused retrieval compon…
zTgx Apr 19, 2026
cb397dd
refactor: move agent module out of retrieval and add QueryComplexity …
zTgx Apr 19, 2026
2fb58d0
refactor(rust): format code and remove unused imports
zTgx Apr 19, 2026
e323207
feat(index): change synonym expansion to single batch request
zTgx Apr 19, 2026
6e55f57
feat(query): add query understanding and planning module
zTgx Apr 19, 2026
bd4a499
refactor(retrieval): introduce retrieval dispatch layer with preproce…
zTgx Apr 19, 2026
9965b4d
refactor(agent): restructure retrieval architecture with unified orch…
zTgx Apr 19, 2026
f3c9e6d
refactor(scoring): move BM25 keyword extraction from utils to scoring…
zTgx Apr 19, 2026
89e8bfb
feat(rust): replace synthesis with unified rerank pipeline
zTgx Apr 19, 2026
205061d
docs(CLAUDE.md): remove outdated directory structure documentation
zTgx Apr 19, 2026
ddd5c35
refactor(rust): format code with consistent line breaks and imports
zTgx Apr 19, 2026
1e793fd
refactor(agent): remove unused QueryComplexity enum from config
zTgx Apr 19, 2026
d28c50e
docs(CLAUDE.md): remove outdated architecture documentation
zTgx Apr 19, 2026
7f3527d
feat: add evidence tracking and query metrics to Python bindings
zTgx Apr 19, 2026
12b8f34
feat(docs): add narrative reasoning flow demonstration
zTgx Apr 19, 2026
b241bcf
feat(agent): add detailed logging for orchestrator analysis phase
zTgx Apr 19, 2026
a7682d2
feat(examples): update deep retrieval queries
zTgx Apr 19, 2026
c3fb549
Merge pull request #81 from vectorlessflow/retrieval-as-agent
zTgx Apr 19, 2026
86c04bb
docs(README): simplify description and remove outdated sections
zTgx Apr 19, 2026
992291c
docs(samples): add Docker Cheat Sheet sample file
zTgx Apr 19, 2026
e17160b
refactor(engine): simplify query logic and extract helper methods
zTgx Apr 19, 2026
14b2355
refactor(engine): remove unused methods from Engine implementation
zTgx Apr 19, 2026
992891a
refactor(agent): split subagent tools into separate modules
zTgx Apr 19, 2026
978edfc
refactor(orchestrator): split orchestrator module into separate files
zTgx Apr 19, 2026
a81a1e4
refactor(agent): remove query complexity detection and adaptive budge…
zTgx Apr 19, 2026
7f48380
refactor(agent): rename SubAgent to Worker throughout codebase
zTgx Apr 20, 2026
afb0c3c
feat(agent): enhance event system with structured pipeline visibility
zTgx Apr 20, 2026
0d320e9
refactor(agent): restructure configuration and introduce Agent trait
zTgx Apr 20, 2026
6652c9c
refactor(worker): remove heuristic sufficiency check and enforce stri…
zTgx Apr 20, 2026
56dc208
feat(agent): add WorkerOutput and WorkerMetrics structs for evidence-…
zTgx Apr 20, 2026
f9a37ec
feat(agent): refactor worker output structure and improve evidence ha…
zTgx Apr 20, 2026
8af0d39
feat(retrieval): add query understanding pipeline with QueryPlan
zTgx Apr 20, 2026
23a0553
feat(agent): enhance orchestrator analysis with query understanding
zTgx Apr 20, 2026
30f7fcb
feat: add evidence evaluation and replanning modules
zTgx Apr 20, 2026
a2952fe
refactor(orchestrator): replace fast path and integrate phases with s…
zTgx Apr 20, 2026
bde7c7e
refactor(config): remove fast-path configuration and metrics
zTgx Apr 20, 2026
65391c7
feat(docs): update CLAUDE.md with Vectorless principles and architecture
zTgx Apr 20, 2026
a50b1b5
docs(architecture): rewrite retrieval pipeline documentation with LLM…
zTgx Apr 20, 2026
637fc91
refactor(agent): remove unused answer synthesis config and modules
zTgx Apr 20, 2026
76d3a95
refactor(query): remove unused text module
zTgx Apr 20, 2026
86b6702
docs(README): update quick start section and features
zTgx Apr 20, 2026
f17c8b5
refactor(agent): remove orchestrator config and fast-path events
zTgx Apr 20, 2026
7231b10
refactor(rust): replace BM25 scoring with LLM-based confidence
zTgx Apr 20, 2026
d595769
refactor(scoring): remove unused scoring modules and rename score field
zTgx Apr 20, 2026
ca04f70
refactor: format code and remove unused import
zTgx Apr 20, 2026
2b5ad14
feat(indexer): add navigation index support
zTgx Apr 20, 2026
b7e3657
feat(agent): add support for cat command without arguments
zTgx Apr 20, 2026
266e9ff
refactor(agent): remove visited nodes tracking from cd function
zTgx Apr 20, 2026
15695a5
feat(storage): add DocCard catalog to workspace with CRUD operations
zTgx Apr 20, 2026
b74ff62
refactor(llm): remove unused max_tokens parameter and comment out logic
zTgx Apr 20, 2026
9e33ae9
refactor(rerank): remove LLM synthesis and fusion modules
zTgx Apr 20, 2026
979bc47
feat(agent): add logging and truncation for command execution results
zTgx Apr 20, 2026
ec8d17b
feat(examples): add query-only example for vectorless
zTgx Apr 20, 2026
b4d9f57
feat(agent): enhance prompt rules with stricter stopping conditions
zTgx Apr 20, 2026
daa9d9a
feat(agent): add quote stripping functionality for command parsing
zTgx Apr 20, 2026
6fa22b2
feat(agent): add keyword hints support to navigation prompts
zTgx Apr 20, 2026
63bf467
feat(planning): update keyword hints formatting and path separator
zTgx Apr 20, 2026
878324e
chore(release): bump workspace version from 0.1.29 to 0.1.30
zTgx Apr 20, 2026
3d084c3
chore(release): bump version from 0.1.8 to 0.1.9
zTgx Apr 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 36 additions & 13 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,51 @@
# CLAUDE.md

A hierarchical, reasoning-native document intelligence engine written in Rust.
Vectorless is a reasoning-native document intelligence engine written in Rust.

## Principles

- **Reason, don't vector.** — Every retrieval decision is an LLM decision.
- **Model fails, we fail.** — No silent degradation. No heuristic fallbacks.
- **No thought, no answer.** — Only LLM-reasoned output counts as an answer.

## Project Structure

- `rust/` - Rust core engine
- `src/client/` - Client API (EngineBuilder, Engine)
- `src/config/` - Configuration types
- `src/document/` - Document parsers (Markdown, PDF)
- `src/index/` - Index building and pipeline
- `src/retrieval/` - Retrieval engine (beam search, MCTS, greedy, hybrid strategies)
- `src/storage/` - Storage layer
- `src/llm/` - LLM client abstraction
- `src/client/` - Client API (EngineBuilder, Engine) - facade layer, no business logic
- `src/document/` - Document data structures (DocumentTree, NavigationIndex, ReasoningIndex)
- `src/index/` - Compile pipeline (8-stage, checkpointing, incremental update)
- `src/retrieval/` - Retrieval dispatch layer (preprocessing, dispatch, postprocessing, cache, streaming)
- `src/query/` - Query understanding and planning (intent classification, rewrite, decomposition)
- `src/agent/` - Retrieval execution (Worker: doc navigation, Orchestrator: supervisor loop + multi-doc fusion)
- `src/rerank/` - Result reranking and answer synthesis (dedup, scoring, fusion, synthesis)
- `src/scoring/` - Scoring and ranking strategies (BM25, relevance scoring, score combination)
- `src/llm/` - LLM client (connection pool, memo/caching, throttle/rate-limiting, fallback)
- `src/storage/` - Persistence (Workspace, LRU cache, backend abstraction file/memory)
- `src/graph/` - Cross-document relationship graph
- `src/memo/` - Caching and reasoning memo
- `src/metrics/` - Metrics and usage tracking
- `src/metrics/` - Metrics collection and reporting
- `src/events/` - Event system for progress monitoring
- `src/throttle/` - Rate limiting
- `src/utils/` - Utility functions
- `src/config/` - Configuration types and validation
- `src/error.rs` - Unified error types
- `src/utils/` - Utility functions (token counting, fingerprinting, validation)
- `examples/` - Rust examples (flow, indexing, pdf, batch, etc.)
- `python/` - Python SDK (PyO3 bindings)
- `python/` - Python SDK (PyO3 bindings) + CLI
- `docs/` - Docusaurus documentation site
- `samples/` - Sample files

### Retrieval Call Flow

```
Engine.query()
→ retrieval/dispatcher
→ query/understand() → QueryPlan (LLM intent + concepts + strategy)
→ Orchestrator (always, single or multi-doc)
→ analyze(QueryPlan) → dispatch plan
→ supervisor loop:
dispatch Workers → evaluate() →
if insufficient → replan() → loop
→ rerank/ (dedup → BM25 score → synthesis/fusion)
```

## Build Commands

```bash
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["rust", "python"]
resolver = "2"

[workspace.package]
version = "0.1.29"
version = "0.1.30"
edition = "2024"
authors = ["zTgx <beautifularea@gmail.com>"]
license = "Apache-2.0"
Expand Down
97 changes: 4 additions & 93 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,58 +13,15 @@

</div>

**Vectorless** is a reasoning-native document engine designed to be the foundational layer for AI applications that need structured access to documents, with the core written in Rust. It does not use vector databases, embeddings, or similarity search. Instead, it will reason through any of your structured documents — **PDFs, Markdown, reports, contracts** — and retrieve only what's relevant. Nothing more, nothing less.
**Vectorless** is a reasoning-native document engine with the core written in Rust. It will reason through any of your structured documents — **PDFs, Markdown, reports, contracts** — and retrieve only what's relevant. Nothing more, nothing less.

- **Reason, don't vector.** — Retrieval is guided by reasoning over document structure.
- **Model fails, we fail.** — No silent degradation. No heuristic fallbacks.
- **No thought, no answer.** — Only LLM-reasoned output counts as an answer.


## How It Works

<div align="center">
<img src="https://vectorless.dev/img/workflow.svg" alt="Vectorless Workflow" width="900">
</div>

<div align="center">
<img src="https://vectorless.dev/img/demo.gif" alt="Vectorless Demo" width="900">
</div>

## Quick Start

### Rust

```toml
[dependencies]
vectorless = "0.1"
```

```rust
use vectorless::{EngineBuilder, IndexContext, QueryContext};

#[tokio::main]
async fn main() -> vectorless::Result<()> {
let engine = EngineBuilder::new()
.with_key("sk-...")
.with_model("gpt-4o")
.with_endpoint("https://api.openai.com/v1")
.build()
.await?;

// Index a document
let result = engine.index(IndexContext::from_path("./report.pdf")).await?;
let doc_id = result.doc_id().unwrap();

// Query
let result = engine.query(
QueryContext::new("What is the total revenue?")
.with_doc_ids(vec![doc_id.to_string()])
).await?;
println!("{}", result.content);

Ok(())
}
```

### Python

```bash
pip install vectorless
```
Expand All @@ -89,52 +46,6 @@ async def main():
asyncio.run(main())
```

## Core Concepts

### Semantic Tree Index

When you index a document, Vectorless builds a tree structure that mirrors the document's hierarchy:

```
Annual Report 2024
├── Executive Summary
│ ├── Financial Highlights
│ └── Strategic Outlook
├── Financial Statements
│ ├── Revenue Analysis ← "What is the total revenue?" lands here
│ ├── Operating Expenses
│ └── Net Income
└── Risk Factors
├── Market Risks
└── Regulatory Risks
```

Each node contains a summary generated by the LLM. During retrieval, the engine uses these summaries to reason about which path to follow — just like a human would scan a table of contents.

### Cross-Document Graph

When multiple documents are indexed, Vectorless builds a relationship graph connecting them through shared keywords and concepts. This enables queries across your entire document collection.

```python
# Query across all indexed documents
result = await engine.query(
QueryContext("Compare revenue trends across all reports")
)
```

### Workspace Persistence

Indexed documents are stored in a workspace — there's no need to reprocess files between sessions:

```python
engine = Engine(api_key="sk-...", model="gpt-4o", endpoint="https://api.openai.com/v1")

# List all indexed documents
docs = await engine.list()
for doc in docs:
print(f"{doc.name} ({doc.format}) — {doc.page_count} pages")
```

## What It's For

Vectorless is designed for applications that need **precise** document retrieval:
Expand Down
71 changes: 54 additions & 17 deletions docs/docs/architecture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,66 @@ TreeNode

## Retrieval Pipeline

The retrieval pipeline consists of four phases:
The retrieval pipeline is a supervisor loop driven entirely by LLM reasoning. Every decision — which documents to query, how to navigate, whether evidence is sufficient — is made by the model, not by heuristics.

1. **Analyze** — Detect query complexity, extract keywords, decompose complex queries
2. **Plan** — Select retrieval strategy and search algorithm
3. **Search** — Execute tree traversal with Pilot guidance
4. **Evaluate** — Score, deduplicate, and aggregate results
### Principles

### Pilot
- **Reason, don't vector.** — Every retrieval decision is an LLM decision.
- **Model fails, we fail.** — No silent degradation. No heuristic fallbacks.
- **No thought, no answer.** — Only LLM-reasoned output counts as an answer.

The Pilot is the core intelligence component. It provides LLM-guided navigation at key decision points:
### Flow

- **Fork points** — When multiple children exist, Pilot evaluates which path to follow
- **Backtracking** — When a path yields insufficient results, Pilot suggests alternatives
- **Binary pruning** — Quick relevance filter for nodes with many children
```text
Engine.query()
→ Dispatcher
→ Query Understanding (LLM) → QueryPlan (intent, concepts, strategy)
→ Orchestrator (always — single or multi-doc)
→ Analyze (LLM selects documents + tasks)
→ Supervisor Loop:
Dispatch Workers → Evaluate (LLM sufficiency check)
→ if insufficient → Replan (LLM) → loop
→ Rerank (dedup → BM25 score → synthesis/fusion)
```

### Query Understanding

Every query first passes through LLM-based understanding:

| Field | Description |
|-------|-------------|
| **Intent** | Factual, Analytical, Navigational, or Summary |
| **Complexity** | Simple, Moderate, or Complex |
| **Key Concepts** | LLM-extracted concepts (distinct from keywords) |
| **Strategy Hint** | focused, exploratory, comparative, or summary |

### Orchestrator (Supervisor)

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

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

### Worker (Evidence Collector)

Each Worker navigates a single document's tree to collect evidence:

1. **Bird's-eye** — `ls` the root for an overview
2. **Plan** — LLM generates a navigation plan
3. **Navigate** — Loop: LLM → command → execute → repeat (with budget)
4. **Return** — Collected evidence only — no answer synthesis

Workers use tree commands (`ls`, `cd`, `cat`, `grep`, `find`, `findtree`) and a `check` command for self-evaluation.

### Rerank Pipeline

### Search Algorithms
After all Workers complete, the Orchestrator runs the final pipeline:

| Algorithm | Description | Use Case |
|-----------|-------------|----------|
| **Beam Search** | Explores multiple paths with backtracking | General purpose (recommended) |
| **MCTS** | Monte Carlo Tree Search with UCT selection | Complex multi-hop queries |
| **Pure Pilot** | Greedy single-path, Pilot at every level | High-accuracy, higher token cost |
| **ToC Navigator** | Table-of-contents based location | Broad queries ("what is this about?") |
1. **Dedup** — Remove duplicate and low-quality evidence
2. **BM25 Scoring** — Rank evidence by keyword relevance
3. **Answer Generation** — LLM synthesizes or fuses evidence into a final answer

## Cross-Document Graph

Expand Down
Loading
Loading