Official Python SDK for Vectorless — document retrieval for the reasoning era
Project description
Vectorless SDK -- Python
Official Python SDK for Vectorless -- document retrieval for the reasoning era.
Supports both sync and async clients. Full type hints with Pydantic v2.
Installation
pip install vectorless-sdk
# or
uv add vectorless-sdk
Quick Start
from vectorless import VectorlessClient
client = VectorlessClient(api_key="vl_sk_live_...")
# Upload a document
result = client.add_document("document.pdf", options=AddDocumentOptions(
toc_strategy="hybrid",
title="Clinical Guidelines",
))
print(f"Document ID: {result.doc_id}")
print(f"Sections: {result.toc.section_count}")
# Get the table of contents (the document map)
toc = client.get_toc(result.doc_id)
for section in toc.sections:
print(f" {section.title}: {section.summary}")
# Pass the ToC to your LLM, get back section IDs, then fetch them
sections = client.fetch_sections(result.doc_id, ["section-id-1", "section-id-2"])
for section in sections:
print(section.content)
Async Support
from vectorless import AsyncVectorlessClient
async with AsyncVectorlessClient(api_key="vl_sk_live_...") as client:
result = await client.add_document("document.pdf")
toc = await client.get_toc(result.doc_id)
sections = await client.fetch_sections(result.doc_id, ["s1", "s2"])
API Reference
VectorlessClient(api_key, base_url, timeout, max_retries)
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key |
str |
VECTORLESS_API_KEY env |
Your API key |
base_url |
str |
https://api.vectorless.store |
API base URL |
timeout |
float |
30.0 |
Request timeout (seconds) |
max_retries |
int |
3 |
Max retry attempts for 429/5xx |
Methods
| Method | Description |
|---|---|
add_document(source, options?) |
Upload and ingest a document. Waits for processing. |
get_toc(doc_id) |
Get the Table of Contents manifest. |
fetch_section(doc_id, section_id) |
Fetch a single section. |
fetch_sections(doc_id, section_ids) |
Batch fetch multiple sections. |
get_document(doc_id) |
Get document status and metadata. |
list_documents(options?) |
List all documents. |
delete_document(doc_id) |
Delete a document and all sections. |
wait_for_ready(doc_id, timeout, poll_interval) |
Poll until processing completes. |
Error Handling
from vectorless import NotFoundError, RateLimitError, VectorlessError
try:
toc = client.get_toc("invalid-id")
except NotFoundError:
print("Document not found")
except RateLimitError as e:
print(f"Rate limited. Retry after {e.retry_after}s")
except VectorlessError as e:
print(f"API error {e.status}: {e.message}")
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-0.1.0.tar.gz
(52.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-0.1.0.tar.gz.
File metadata
- Download URL: vectorless_sdk-0.1.0.tar.gz
- Upload date:
- Size: 52.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77ed2e007a3b91f42269c565c23cfcdb6af6c51e51e6e6cca9980049f81bf4b2
|
|
| MD5 |
fef7e4549c4b1be975c272c43f4345d7
|
|
| BLAKE2b-256 |
abeb49073920c0adf5b0e36871f30150a484e46a0a8e08a23ca85a5797f0cdb1
|
File details
Details for the file vectorless_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: vectorless_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc8108e688d529fca73b83438917196082f3003ffa05801e3739c1845233af2c
|
|
| MD5 |
828ddae740d66adb16efaa7ea7ebf8fe
|
|
| BLAKE2b-256 |
ec414c213f2e95217cde9bdeae7edd186b458814133a765bf2de5d26642e39c5
|