Skip to content

Commit 992ff15

Browse files
authored
Merge pull request #112 from vectorlessflow/dev
Dev
2 parents e40611a + 4d3f9c5 commit 992ff15

99 files changed

Lines changed: 8409 additions & 3702 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.

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,3 @@ wheels/
8484
.venv/
8585
venv/
8686
ENV/
87-
88-
# Test workspace
89-
workspace*

Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ members = [
1010
"vectorless-core/vectorless-metrics",
1111
"vectorless-core/vectorless-llm",
1212
"vectorless-core/vectorless-storage",
13-
"vectorless-core/vectorless-query",
13+
# Strategy layer moved to Python — crates kept but not compiled:
14+
# "vectorless-core/vectorless-query",
15+
# "vectorless-core/vectorless-agent",
16+
# "vectorless-core/vectorless-retrieval",
1417
"vectorless-core/vectorless-index",
15-
"vectorless-core/vectorless-agent",
16-
"vectorless-core/vectorless-retrieval",
1718
"vectorless-core/vectorless-rerank",
19+
"vectorless-core/vectorless-primitives",
1820
"vectorless-core/vectorless-engine",
1921
"vectorless-core/vectorless-py",
2022
]

README.md

Lines changed: 16 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,43 @@
1-
<div align="center">
2-
3-
<img src="https://vectorless.dev/img/with-title.png" alt="Vectorless" width="400">
4-
5-
<h1>Document Understanding Engine for AI</h1>
6-
<h3>Reason, don't vector · Structure, not chunks · Think, then answer</h3>
1+
<h1>Vectorless</h1>
72

83
[![PyPI](https://img.shields.io/pypi/v/vectorless.svg)](https://pypi.org/project/vectorless/)
94
[![PyPI Downloads](https://static.pepy.tech/badge/vectorless/month)](https://pepy.tech/projects/vectorless)
10-
[![Crates.io](https://img.shields.io/crates/v/vectorless.svg)](https://crates.io/crates/vectorless)
11-
[![Crates.io Downloads](https://img.shields.io/crates/d/vectorless.svg)](https://crates.io/crates/vectorless)
12-
[![Docs](https://docs.rs/vectorless/badge.svg)](https://docs.rs/vectorless)
13-
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
14-
15-
</div>
16-
17-
**Vectorless** is a document understanding engine for AI. It compiles documents into structured trees of meaning, then dispatches multiple agents to reason through headings, sections, and paragraphs — evaluating how each part relates to the whole. The problem it solves is not "where to look", but "what does this mean in context". Every answer is a reasoning act, not a retrieval result.
18-
19-
Light up a star and shine with us! ⭐
20-
21-
## Three Rules
22-
- **Reason, don't vector.** Understanding is reasoning, not similarity.
23-
- **Model fails, we fail.** No heuristic fallbacks, no silent degradation.
24-
- **No thought, no answer.** Only reasoned output counts as an answer.
255

26-
## How It Works
6+
<p>Knowing by reasoning, not vectors.</p>
7+
<p>Deep and reliable. Vectorless plays nicely with your documents. Ask questions in plain language; get answers by reasoning with Vectorless.</p>
278

28-
### Four-Artifact Index Architecture
9+
## Installation
2910

30-
When a document is indexed, the compile pipeline builds four artifacts:
11+
Install using `pip install -U vectorless`. For more details, see the [Installation](https://vectorless.dev/docs/installation) section in the documentation.
3112

32-
```
33-
Content Layer Navigation Layer Reasoning Index Document Card
34-
DocumentTree NavigationIndex ReasoningIndex DocCard
35-
(TreeNode) (NavEntry, ChildRoute) (topic_paths, hot_nodes) (title, overview,
36-
│ │ │ question hints)
37-
│ │ │ │
38-
Agent reads Agent reads every Agent's targeted Orchestrator reads
39-
only on cat decision round search tool (grep) for multi-doc routing
40-
```
41-
42-
- **Content Layer** — The raw document tree. The agent only accesses this when reading specific paragraphs (`cat`).
43-
- **Navigation Layer** — Each non-leaf node stores an overview, question hints, and child routes (title + description). The agent reads this every round to decide where to go next.
44-
- **Reasoning Index** — Keyword-topic mappings with weights. Provides the agent's `grep` tool with structured keyword data for targeted search within a document.
45-
- **DocCard** — A compact document-level summary. The Orchestrator reads DocCards to decide which documents to navigate in multi-document queries, without loading full documents.
46-
47-
This separation means the agent makes routing decisions from lightweight metadata, not by scanning full content.
48-
49-
### Agent-Based Understanding
50-
51-
```
52-
Engine.query("What drove the revenue decline?")
53-
54-
├─ Query Understanding ── intent, concepts, strategy (LLM)
55-
56-
├─ Orchestrator ── analyzes query, dispatches Workers
57-
│ │
58-
│ ├─ Worker 1 ── ls → cd "Financials" → ls → cd "Revenue" → cat
59-
│ └─ Worker 2 ── ls → cd "Risk Factors" → grep "decline" → cat
60-
│ │
61-
│ └─ evaluate ── insufficient? → replan → dispatch new paths → loop
62-
63-
└─ Synthesis ── dedup, evidence scoring, reasoned answer with source chain
64-
```
65-
66-
Worker navigation commands:
67-
68-
| Command | Action | Reads |
69-
|---------|--------|-------|
70-
| `ls` | List child sections | Navigation Layer (ChildRoute) |
71-
| `cd` | Enter a child section | Navigation Layer |
72-
| `cat` | Read content at current node | Content Layer (DocumentTree) |
73-
| `grep` | Search by keyword | Reasoning Index (topic_paths) |
74-
75-
The Orchestrator evaluates Worker results after each round. If evidence is insufficient, it **replans** — adjusting strategy, dispatching new paths, or deepening exploration. This continues until enough evidence is collected.
76-
77-
## Quick Start
78-
79-
```bash
80-
pip install vectorless
81-
```
13+
## A Simple Example
8214

8315
```python
8416
import asyncio
85-
from vectorless import Engine, IndexContext, QueryContext
17+
from vectorless import Engine
8618

8719
async def main():
8820
engine = Engine(api_key="sk-...", model="gpt-4o", endpoint="https://api.openai.com/v1")
8921

90-
# Index a document
91-
result = await engine.index(IndexContext.from_path("./report.pdf"))
22+
# Compile a document
23+
result = await engine.compile(path="./report.pdf")
9224
doc_id = result.doc_id
9325

94-
# Query
95-
result = await engine.query(
96-
QueryContext("What is the total revenue?").with_doc_ids([doc_id])
97-
)
98-
print(result.single().content)
26+
# Ask a question
27+
response = await engine.ask("What is the total revenue?", doc_ids=[doc_id])
28+
print(response.single().content)
9929

10030
asyncio.run(main())
10131
```
10232

103-
## Resources
33+
## Help
10434

105-
- [Documentation](https://vectorless.dev) — Guides, architecture, API reference
106-
- [Rust API Docs](https://docs.rs/vectorless) — Auto-generated crate documentation
107-
- [PyPI](https://pypi.org/project/vectorless/) — Python package
108-
- [Crates.io](https://crates.io/crates/vectorless) — Rust crate
109-
- [Examples](examples/) — Complete usage patterns for Python and Rust
35+
See [documentation](https://vectorless.dev/docs/getting-started) for more details.
11036

111-
## Contributing
11237

113-
Contributions welcome! If you find this useful, please ⭐ the repo — it helps others discover it.
114-
115-
## Star History
38+
## Contributing
11639

117-
<a href="https://www.star-history.com/?repos=vectorlessflow%2Fvectorless&type=date&legend=top-left">
118-
<picture>
119-
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=vectorlessflow/vectorless&type=date&theme=dark&legend=top-left" />
120-
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=vectorlessflow/vectorless&type=date&legend=top-left" />
121-
<img alt="Star History Chart" src="https://api.star-history.com/chart?repos=vectorlessflow/vectorless&type=date&legend=top-left" />
122-
</picture>
123-
</a>
40+
Contributions welcome! See [Contributing](CONTRIBUTING.md) for setup and guidelines.
12441

12542
## License
12643

docs/docs/api-reference.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
sidebar_position: 9
33
title: API Reference
4-
description: Complete API reference for Vectorless Rust crate and Python SDK.
4+
description: Complete API reference for the Vectorless Python SDK.
55
---
66

77
# API Reference
@@ -10,8 +10,7 @@ description: Complete API reference for Vectorless Rust crate and Python SDK.
1010
1111
In the meantime, you can refer to the following resources:
1212

13-
- **Rust crate docs**: [docs.rs/vectorless](https://docs.rs/vectorless) — auto-generated documentation from source code
1413
- **Python SDK docs**: Available via `help(vectorless)` in an interactive Python session
1514
- **Source code**: [github.com/vectorlessflow/vectorless](https://github.com/vectorlessflow/vectorless)
1615

17-
For usage examples, see [Quick Query](/docs/examples/quick-query), [Multi-Document](/docs/examples/multi-document), and [Batch Indexing](/docs/examples/batch-indexing).
16+
For usage examples, see [Quick Query](/docs/examples/quick-query), [Multi-Document](/docs/examples/multi-document), and [Batch Compiling](/docs/examples/batch-indexing).

docs/docs/architecture.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ The retrieval pipeline is a supervisor loop driven entirely by LLM reasoning. Ev
6767
### Flow
6868

6969
```text
70-
Engine.query()
70+
Engine.ask()
7171
→ Dispatcher
7272
→ Query Understanding (LLM) → QueryPlan (intent, concepts, strategy)
7373
→ Orchestrator (always — single or multi-doc)

docs/docs/examples/batch-indexing.mdx

Lines changed: 11 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,24 @@
22
sidebar_position: 3
33
---
44

5-
# Batch Indexing
5+
# Batch Compiling
66

7-
Index multiple documents efficiently with progress tracking and error handling.
8-
9-
## Python
7+
Compile multiple documents efficiently with progress tracking and error handling.
108

119
```python
1210
import asyncio
13-
from vectorless import Engine, IndexContext, IndexOptions
11+
from vectorless import Engine
1412

1513
async def main():
1614
engine = Engine(
1715
api_key="sk-...",
1816
model="gpt-4o",
1917
)
2018

21-
# Index a directory of documents
22-
result = await engine.index(
23-
IndexContext.from_dir("./documents/")
24-
)
19+
# Compile a directory of documents
20+
result = await engine.compile(directory="./documents/")
2521

26-
print(f"Indexed {len(result.items)} documents")
22+
print(f"Compiled {len(result.items)} documents")
2723
print(f"Failures: {len(result.failed)}")
2824

2925
for item in result.items:
@@ -37,50 +33,19 @@ async def main():
3733
for fail in result.failed:
3834
print(f"{fail.source}: {fail.error}")
3935

40-
# List all indexed documents
41-
docs = await engine.list()
42-
print(f"\nTotal indexed: {len(docs)} documents")
36+
# List all compiled documents
37+
docs = await engine.list_documents()
38+
print(f"\nTotal compiled: {len(docs)} documents")
4339

4440
asyncio.run(main())
4541
```
4642

47-
## Rust
48-
49-
```rust
50-
use vectorless::{Engine, EngineBuilder, IndexContext};
51-
52-
#[tokio::main]
53-
async fn main() -> vectorless::Result<()> {
54-
let engine = EngineBuilder::new()
55-
.with_key("sk-...")
56-
.with_model("gpt-4o")
57-
.build()
58-
.await?;
59-
60-
// Index a directory
61-
let result = engine.index(IndexContext::from_dir("./documents/")).await?;
62-
63-
println!("Indexed {} documents", result.items.len());
64-
println!("Failures: {}", result.failed.len());
65-
66-
for item in &result.items {
67-
println!(" ✓ {} ({:?}) → {}", item.name, item.format, item.doc_id);
68-
}
69-
70-
// List all documents
71-
let docs = engine.list().await?;
72-
println!("Total indexed: {} documents", docs.len());
73-
74-
Ok(())
75-
}
76-
```
77-
7843
## Error Handling
7944

80-
Each item in the result is either successful or failed. Failures don't prevent other documents from being indexed:
45+
Each item in the result is either successful or failed. Failures don't prevent other documents from being compiled:
8146

8247
```python
83-
result = await engine.index(IndexContext.from_paths(mixed_paths))
48+
result = await engine.compile(paths=mixed_paths)
8449

8550
# Successful items
8651
for item in result.items:

docs/docs/examples/multi-document.mdx

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,26 @@ sidebar_position: 2
44

55
# Multi-Document Retrieval
66

7-
Query across multiple indexed documents using the cross-document strategy with graph-based score boosting.
8-
9-
## Python
7+
Query across multiple compiled documents using the cross-document strategy with graph-based score boosting.
108

119
```python
1210
import asyncio
13-
from vectorless import (
14-
Engine, IndexContext, QueryContext,
15-
IndexOptions,
16-
)
11+
from vectorless import Engine
1712

1813
async def main():
1914
engine = Engine(
2015
api_key="sk-...",
2116
model="gpt-4o",
2217
)
2318

24-
# Index multiple documents
19+
# Compile multiple documents
2520
docs = ["./report-q1.pdf", "./report-q2.pdf", "./report-q3.pdf"]
2621
doc_ids = []
2722

2823
for path in docs:
29-
result = await engine.index(IndexContext.from_path(path))
24+
result = await engine.compile(path=path)
3025
doc_ids.append(result.doc_id)
31-
print(f"Indexed: {path}{result.doc_id}")
26+
print(f"Compiled: {path}{result.doc_id}")
3227

3328
# Check the cross-document graph
3429
graph = await engine.get_graph()
@@ -40,25 +35,26 @@ async def main():
4035
print(f" {doc_id[:8]}... → {edge.target_doc_id[:8]}... ({edge.weight:.2f})")
4136

4237
# Query across all documents
43-
result = await engine.query(
44-
QueryContext("Compare quarterly revenue trends")
45-
.with_doc_ids(doc_ids)
38+
response = await engine.ask(
39+
"Compare quarterly revenue trends",
40+
doc_ids=doc_ids,
4641
)
4742

48-
for item in result.items:
49-
print(f"\n[{item.doc_id[:8]}...] Score: {item.score:.2f}")
43+
for item in response.items:
44+
print(f"\n[{item.doc_id[:8]}...] Confidence: {item.confidence:.2f}")
5045
print(item.content[:300])
5146

5247
# Or query entire workspace
53-
result = await engine.query(
54-
QueryContext("What documents discuss risk factors?")
48+
response = await engine.ask(
49+
"What documents discuss risk factors?",
50+
workspace_scope=True,
5551
)
5652

57-
print(f"\nFound in {len(result.items)} document(s)")
53+
print(f"\nFound in {len(response.items)} document(s)")
5854

5955
# Cleanup
6056
for doc_id in doc_ids:
61-
await engine.remove(doc_id)
57+
await engine.remove_document(doc_id)
6258

6359
asyncio.run(main())
6460
```
@@ -67,19 +63,8 @@ asyncio.run(main())
6763

6864
### Document Graph
6965

70-
After indexing, documents are connected in a graph based on shared keywords. The graph enables:
66+
After compiling, documents are connected in a graph based on shared keywords. The graph enables:
7167

7268
- **Score boosting** — High-confidence results in one document boost neighbor documents
7369
- **Relationship discovery** — Automatically find related documents
7470
- **Cross-referencing** — Results from connected documents are surfaced together
75-
76-
### Merge Strategies
77-
78-
The cross-document strategy supports multiple merge modes:
79-
80-
| Strategy | Description |
81-
|----------|-------------|
82-
| **TopK** | Return top-K results across all documents |
83-
| **BestPerDocument** | Best result from each document |
84-
| **WeightedByRelevance** | Weight by each document's best score |
85-
| **GraphBoosted** | Use graph connections to boost scores |

0 commit comments

Comments
 (0)