Skip to content

Commit 228f4d8

Browse files
authored
Merge pull request #33 from vectorlessflow/dev
Dev
2 parents d733914 + d181a4d commit 228f4d8

62 files changed

Lines changed: 4935 additions & 6619 deletions

Some content is hidden

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

README.md

Lines changed: 33 additions & 218 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
<div align="center">
22

3-
<img src="https://raw.githubusercontent.com/vectorlessflow/vectorless/main/docs/design/logo-horizontal.svg" alt="Vectorless" width="400">
4-
5-
<h1>Document inteligence engine for AI</h1>
3+
<div align="center">
4+
<img src="https://raw.githubusercontent.com/vectorlessflow/vectorless/main/docs/design/lovable-vectorless.png" alt="Vectorless" width="100" style="vertical-align:middle;">
5+
&nbsp;
6+
<span style="font-size:48px; font-weight:800; vertical-align:middle; color:#AF788B;">
7+
Vectorless
8+
</span>
9+
</div>
610

11+
<h1>Reasoning-native Document Intelligence Engine</h1>
712

813
[![PyPI](https://img.shields.io/pypi/v/vectorless.svg)](https://pypi.org/project/vectorless/)
914
[![Python](https://img.shields.io/pypi/pyversions/vectorless.svg)](https://pypi.org/project/vectorless/)
1015
[![PyPI Downloads](https://static.pepy.tech/badge/vectorless/month)](https://pepy.tech/projects/vectorless)
1116
[![Crates.io](https://img.shields.io/crates/v/vectorless.svg)](https://crates.io/crates/vectorless)
12-
[![Crates.io Downloads](https://img.shields.io/crates/d/vectorless.svg)](https://crates.io/crates/vectorless)
17+
[![Crates.io Downloads](https://img.shields.io/crates/v/vectorless.svg)](https://crates.io/crates/vectorless)
1318
[![Docs](https://docs.rs/vectorless/badge.svg)](https://docs.rs/vectorless)
1419
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
1520
[![Rust](https://img.shields.io/badge/rust-1.85%2B-orange.svg)](https://www.rust-lang.org/)
@@ -18,102 +23,40 @@
1823

1924
**Vectorless** is an ultra-performant reasoning-native document intelligence engine for AI, with the core written in Rust. It transforms documents into rich semantic trees and uses LLMs to intelligently traverse the hierarchy — retrieving the most relevant content through structural reasoning and deep contextual understanding.
2025

21-
⭐ Drop a star to help us grow!
22-
23-
## How It Works
24-
25-
<img src="https://raw.githubusercontent.com/vectorlessflow/vectorless/main/docs/design/how-it-works.svg" alt="How it works">
26-
27-
### 1. Index: Build a Navigable Tree
28-
29-
```
30-
Technical Manual (root)
31-
├── Chapter 1: Introduction
32-
├── Chapter 2: Architecture
33-
│ ├── 2.1 System Design
34-
│ └── 2.2 Implementation
35-
└── Chapter 3: API Reference
36-
```
37-
38-
Each node gets an AI-generated summary, enabling fast navigation.
39-
40-
### 2. Query: Navigate with LLM
41-
42-
When you ask "How do I reset the device?":
43-
44-
1. **Analyze** — Understand query intent and complexity
45-
2. **Navigate** — LLM guides tree traversal
46-
3. **Retrieve** — Return the exact section with context
47-
4. **Verify** — Check if more information is needed
26+
<img src="https://raw.githubusercontent.com/vectorlessflow/vectorless/main/docs/design/positioning.svg" alt="Vectorless" width="550">
4827

49-
## Traditional RAG vs Vectorless
5028

51-
<img src="https://raw.githubusercontent.com/vectorlessflow/vectorless/main/docs/design/comparison.svg" alt="Traditional RAG vs Vectorless">
52-
53-
| Aspect | Traditional RAG | Vectorless |
54-
|--------|----------------|------------|
55-
| **Infrastructure** | Vector DB + Embedding Model | Just LLM API |
56-
| **Document Structure** | Lost in chunking | Preserved |
57-
| **Context** | Fragment only | Section + surrounding context |
58-
| **Setup Time** | Hours to Days | Minutes |
59-
| **Best For** | Unstructured text | Structured documents |
60-
61-
## Example
62-
63-
**Input:**
64-
```
65-
Document: 100-page technical manual (PDF)
66-
Query: "How do I reset the device?"
67-
```
29+
## Quick Start
6830

69-
**Output:**
70-
```
71-
Answer: "To reset the device, hold the power button for 10 seconds
72-
until the LED flashes blue, then release..."
31+
### Install
7332

74-
Source: Chapter 4 > Section 4.2 > Reset Procedure
33+
```bash
34+
pip install vectorless
7535
```
7636

77-
## When to Use
78-
79-
**Good fit:**
80-
- Technical documentation
81-
- Manuals and guides
82-
- Structured reports
83-
- Policy documents
84-
- Any document with clear hierarchy
85-
86-
**Not ideal:**
87-
- Unstructured text (tweets, chat logs)
88-
- Very short documents (< 1 page)
89-
- Pure Q&A datasets without structure
90-
91-
## Quick Start
92-
93-
<details open>
94-
<summary><b>Python</b></summary>
37+
### Set your API key
9538

9639
```bash
97-
pip install vectorless
40+
export OPENAI_API_KEY="sk-..."
9841
```
9942

43+
### Index and Query
44+
10045
```python
10146
from vectorless import Engine, IndexContext
10247

103-
# Create engine (uses OPENAI_API_KEY env var)
48+
# Create engine with a workspace directory
10449
engine = Engine(workspace="./data")
10550

106-
# Index a document
107-
ctx = IndexContext.from_file("./report.pdf")
108-
doc_id = engine.index(ctx)
51+
# Index a document (PDF, Markdown, DOCX, HTML)
52+
doc_id = engine.index(IndexContext.from_file("./report.pdf"))
10953

11054
# Query
11155
result = engine.query(doc_id, "What is the total revenue?")
112-
print(f"Answer: {result.content}")
56+
print(result.content)
57+
print(f"Score: {result.score}")
11358
```
11459

115-
</details>
116-
11760
<details>
11861
<summary><b>Rust</b></summary>
11962

@@ -122,158 +65,30 @@ print(f"Answer: {result.content}")
12265
vectorless = "0.1"
12366
```
12467

125-
```bash
126-
cp vectorless.example.toml ./vectorless.toml
127-
```
128-
12968
```rust
130-
use vectorless::Engine;
69+
use vectorless::client::{Engine, EngineBuilder, IndexContext};
13170

13271
#[tokio::main]
13372
async fn main() -> vectorless::Result<()> {
134-
let client = Engine::builder()
135-
.with_workspace("./workspace")
136-
.build()?;
137-
138-
let doc_id = client.index("./document.pdf").await?;
73+
let engine = EngineBuilder::new()
74+
.with_workspace("./data")
75+
.build()
76+
.await?;
13977

140-
let result = client.query(&doc_id,
141-
"What are the system requirements?").await?;
78+
// Index
79+
let doc_id = engine.index(IndexContext::from_path("./report.pdf")).await?;
14280

81+
// Query
82+
let result = engine.query(&doc_id, "What is the total revenue?").await?;
14383
println!("Answer: {}", result.content);
144-
println!("Source: {}", result.path);
14584

14685
Ok(())
14786
}
14887
```
149-
150-
</details>
151-
152-
## Features
153-
154-
| Feature | Description |
155-
|---------|-------------|
156-
| **Zero Infrastructure** | No vector DB, no embedding model — just an LLM API |
157-
| **Multi-format Support** | PDF, Markdown, DOCX, HTML out of the box |
158-
| **Incremental Updates** | Add/remove documents without full re-index |
159-
| **Traceable Results** | See the exact navigation path taken |
160-
| **Feedback Learning** | Improves from user feedback over time |
161-
| **Multi-turn Queries** | Handles complex questions with decomposition |
162-
163-
## Configuration
164-
165-
### Zero Configuration (Recommended)
166-
167-
Just set `OPENAI_API_KEY` and you're ready to go:
168-
169-
```bash
170-
export OPENAI_API_KEY="sk-..."
171-
```
172-
173-
<details>
174-
<summary><b>Python</b></summary>
175-
176-
```python
177-
from vectorless import Engine
178-
179-
# Uses OPENAI_API_KEY from environment
180-
engine = Engine(workspace="./data")
181-
```
182-
18388
</details>
18489

185-
<details>
186-
<summary><b>Rust</b></summary>
187-
188-
```rust
189-
use vectorless::Engine;
190-
191-
let client = Engine::builder()
192-
.with_workspace("./workspace")
193-
.build().await?;
194-
```
195-
196-
</details>
197-
198-
### Environment Variables
199-
200-
| Variable | Description |
201-
|----------|-------------|
202-
| `OPENAI_API_KEY` | LLM API key |
203-
| `VECTORLESS_MODEL` | Default model (e.g., `gpt-4o-mini`) |
204-
| `VECTORLESS_ENDPOINT` | API endpoint URL |
205-
| `VECTORLESS_WORKSPACE` | Workspace directory |
206-
207-
### Advanced Configuration
208-
209-
For fine-grained control, use a config file:
210-
211-
```bash
212-
cp config.toml ./vectorless.toml
213-
```
214-
215-
<details>
216-
<summary><b>Python</b></summary>
217-
218-
```python
219-
from vectorless import Engine
220-
221-
# Use full configuration file
222-
engine = Engine(config_path="./vectorless.toml")
223-
224-
# Or override specific settings
225-
engine = Engine(
226-
config_path="./vectorless.toml",
227-
model="gpt-4o", # Override model from config
228-
)
229-
```
230-
231-
</details>
232-
233-
<details>
234-
<summary><b>Rust</b></summary>
235-
236-
```rust
237-
use vectorless::Engine;
238-
239-
// Use full configuration file
240-
let client = Engine::builder()
241-
.with_config_path("./vectorless.toml")
242-
.build().await?;
243-
244-
// Or override specific settings
245-
let client = Engine::builder()
246-
.with_config_path("./vectorless.toml")
247-
.with_model("gpt-4o", None) // Override model
248-
.build().await?;
249-
```
250-
251-
</details>
252-
253-
### Configuration Priority
254-
255-
Later overrides earlier:
256-
257-
1. Default configuration
258-
2. Auto-detected config file (`vectorless.toml`, `config.toml`, `.vectorless.toml`)
259-
3. Explicit config file (`config_path` / `with_config_path`)
260-
4. Environment variables
261-
5. Constructor/builder parameters (highest priority)
262-
263-
## Architecture
264-
265-
<img src="https://raw.githubusercontent.com/vectorlessflow/vectorless/main/docs/design/architecture.svg" alt="Architecture">
266-
267-
### Core Components
268-
269-
- **Index Pipeline** — Parses documents, builds tree, generates summaries
270-
- **Retrieval Pipeline** — Analyzes query, navigates tree, returns results
271-
- **Pilot** — LLM-powered navigator that guides retrieval decisions
272-
- **Metrics Hub** — Unified observability for LLM calls, retrieval, and feedback
273-
27490
## Examples
275-
276-
See the [examples/](examples/) directory for more usage patterns.
91+
See [examples/](examples/) for more Rust patterns — streaming, document graph, custom pilot, cross-document retrieval, and more.|
27792

27893
## Contributing
27994

docs/README.md

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)