|
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> |
7 | 2 |
|
8 | 3 | [](https://pypi.org/project/vectorless/) |
9 | 4 | [](https://pepy.tech/projects/vectorless) |
10 | | -[](https://crates.io/crates/vectorless) |
11 | | -[](https://crates.io/crates/vectorless) |
12 | | -[](https://docs.rs/vectorless) |
13 | | -[](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. |
25 | 5 |
|
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> |
27 | 8 |
|
28 | | -### Four-Artifact Index Architecture |
| 9 | +## Installation |
29 | 10 |
|
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. |
31 | 12 |
|
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 |
82 | 14 |
|
83 | 15 | ```python |
84 | 16 | import asyncio |
85 | | -from vectorless import Engine, IndexContext, QueryContext |
| 17 | +from vectorless import Engine |
86 | 18 |
|
87 | 19 | async def main(): |
88 | 20 | engine = Engine(api_key="sk-...", model="gpt-4o", endpoint="https://api.openai.com/v1") |
89 | 21 |
|
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") |
92 | 24 | doc_id = result.doc_id |
93 | 25 |
|
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) |
99 | 29 |
|
100 | 30 | asyncio.run(main()) |
101 | 31 | ``` |
102 | 32 |
|
103 | | -## Resources |
| 33 | +## Help |
104 | 34 |
|
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. |
110 | 36 |
|
111 | | -## Contributing |
112 | 37 |
|
113 | | -Contributions welcome! If you find this useful, please ⭐ the repo — it helps others discover it. |
114 | | - |
115 | | -## Star History |
| 38 | +## Contributing |
116 | 39 |
|
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. |
124 | 41 |
|
125 | 42 | ## License |
126 | 43 |
|
|
0 commit comments