Official Python SDK for Vectorless — structure-preserving document retrieval without embeddings
Project description
Vectorless Python SDK
Official Python client for Vectorless — structure-preserving document retrieval without embeddings.
Install
pip install vectorless-sdk
Quick Start
from vectorless import VectorlessClient
# Connect to a deployed instance
client = VectorlessClient(
base_url="https://api.vectorless.dev",
api_key="vl_live_...",
)
# Or self-hosted (no API key needed)
client = VectorlessClient(base_url="http://localhost:8080")
# Ingest a document
result = client.ingest_document(
"./report.pdf",
filename="report.pdf",
metadata={"team": "engineering"},
)
# Wait for processing
doc = client.wait_for_ready(result.document_id)
# Get the document tree
tree = client.get_document_tree(doc.id)
for section in tree.sections:
print(" " * section.depth + section.title)
# Query — LLM navigates the tree to find relevant sections
response = client.query(doc.id, "How does authentication work?")
for section in response.sections:
print(f"[{section.title}]")
print(section.content)
print(f"Strategy: {response.strategy}, Time: {response.elapsed_ms}ms")
Async Support
from vectorless import AsyncVectorlessClient
async with AsyncVectorlessClient(
base_url="https://api.vectorless.dev",
api_key="vl_live_...",
) as client:
result = await client.ingest_document(b"# Hello\n\nWorld")
doc = await client.wait_for_ready(result.document_id)
response = await client.query(doc.id, "What is this about?")
Transport Protocols
The SDK supports two wire protocols:
# HTTP/REST (default) — standard REST endpoints
client = VectorlessClient(base_url="http://localhost:8080")
# ConnectRPC — protobuf JSON encoding, native streaming
client = VectorlessClient(base_url="http://localhost:8080", transport="connect")
Streaming Queries
for event in client.query_stream(doc_id, "Explain clustering"):
if event.type == "section_selected" and event.section:
print(f"Found: {event.section.title}")
if event.type == "completed":
print(f"Done in {event.elapsed_ms}ms")
API Reference
| Method | Description |
|---|---|
ingest_document() |
Upload and ingest a document |
get_document() |
Get document metadata and status |
list_documents() |
List documents with pagination |
delete_document() |
Delete a document |
wait_for_ready() |
Poll until document is processed |
get_document_tree() |
Get hierarchical document outline |
get_section() |
Fetch a section with full content |
get_sections() |
Fetch multiple sections |
query() |
Query a document |
query_stream() |
Stream query results |
health() |
Server health check |
version() |
Server version |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vectorless_sdk-1.0.0.tar.gz
(15.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vectorless_sdk-1.0.0.tar.gz.
File metadata
- Download URL: vectorless_sdk-1.0.0.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1ada480eb0ba951dcf53f74cdc340843606a5cf209958d7b00b19e49ef893fa
|
|
| MD5 |
868fac96e17f169e2844b2fbb2f9e3d9
|
|
| BLAKE2b-256 |
1399caf621611f8cd7858a13e4b81d148c0c5e58e51c6f1ae5666456602ee7ea
|
File details
Details for the file vectorless_sdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: vectorless_sdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 20.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
130330d8ffb692afaca164226b8e374ba6b512270d0f4111dbd684d720413c29
|
|
| MD5 |
2eedc40c331be650a15513fa868764c2
|
|
| BLAKE2b-256 |
6c9b56f8f90102ea5356e6b0433ca45ddafd69a20c410a4ad29e247cef44d21d
|