VittoriaDB Python SDK
Python client for VittoriaDB — an embedded vector database shipped as a single Go binary. The SDK talks to the server over HTTP: collections, vectors, semantic search, server-side embeddings, document upload, and RAG-friendly content storage. Optional auto-start downloads a matching release binary (when available) and manages the process lifecycle.
Documentation
| Topic | Where |
|---|---|
| REST API (paths, JSON bodies, filters) | docs/api.md |
| Embeddings & vectorizers | docs/embeddings.md |
| Installation & troubleshooting | docs/installation.md |
| Server & YAML configuration | docs/configuration.md |
| Content storage for RAG | docs/content-storage.md |
CLI (run, backup, restore, …) |
docs/cli.md |
| Examples (Python / Go / curl) | examples/README.md |
Features
| Area | What the SDK exposes |
|---|---|
| Collections | Create / list / delete; DistanceMetric, IndexType (FLAT, HNSW, IVF prototype) |
| Vectors | insert, insert_batch, get, delete, search with optional metadata |
| Embeddings | insert_text, insert_text_batch, search_text when the collection has a VectorizerConfig |
| Documents | upload_file / upload_files — PDF, DOCX, TXT, MD, HTML (server-side processors) |
| Metadata filters | Flat dict ({"category": "tech"}) or structured filter JSON; use search(..., use_post=True) for POST search bodies |
| Indexes | HNSW tuning via config; IVF tuning via Configure.Index.ivf_flat(nlist=, nprobe=) |
| Observability | health(), stats() (DatabaseStats: totals, latency, QPS), prometheus_metrics() → GET /metrics text |
| Configuration | config() → unified server config + feature flags (requires compatible server) |
| Errors | Typed exceptions: ConnectionError, CollectionError, VectorError, SearchError, BinaryError |
Backup and restore are not HTTP APIs: use the vittoriadb CLI (backup / restore). Stop the server before restore.
Installation
pip install vittoriadb
On install, the package tries to download a platform binary from GitHub Releases at tag v<sdk-version> (e.g. v0.7.0). If that asset is missing, you’ll see a warning — install the binary manually or put vittoriadb on your PATH.
Quick start
Connect
import vittoriadb
# Managed local server (downloads binary when release exists)
db = vittoriadb.connect()
# Existing server
db = vittoriadb.connect(url="http://localhost:8080", auto_start=False)
db.close()
Vectors and similarity search
collection = db.create_collection(
name="docs",
dimensions=384,
metric="cosine",
)
collection.insert(
"doc1",
vector=[0.1] * 384,
metadata={"title": "Hello", "category": "demo"},
)
results = collection.search(
vector=[0.1] * 384,
limit=5,
filter={"category": "demo"},
include_metadata=True,
)
# Structured / nested filters: POST search
results = collection.search(
vector=[0.1] * 384,
limit=5,
use_post=True,
filter={
"and": [
{"field": "category", "operator": "eq", "value": "demo"},
]
},
)
Server-side embeddings
from vittoriadb.configure import Configure
collection = db.create_collection(
name="smart",
dimensions=384,
vectorizer_config=Configure.Vectors.auto_embeddings(),
)
collection.insert_text(
"a1",
"Your text here.",
metadata={"source": "wiki"},
)
hits = collection.search_text("your query", limit=5)
Observability
h = db.health() # HealthStatus
s = db.stats() # DatabaseStats: queries_total, avg_query_latency, queries_per_sec, …
text = db.prometheus_metrics() # Prometheus exposition from GET /metrics
IVF index (prototype)
from vittoriadb import IndexType
from vittoriadb.configure import Configure
collection = db.create_collection(
name="ivf_demo",
dimensions=64,
index_type=IndexType.IVF,
config=Configure.Index.ivf_flat(nlist=16, nprobe=2),
)
RAG and content storage
Enable ContentStorageConfig on create_collection to persist chunk text for retrieval (include_content=True on search_text). See docs/content-storage.md.
from vittoriadb import ContentStorageConfig
collection = db.create_collection(
name="rag",
dimensions=384,
vectorizer_config=Configure.Vectors.auto_embeddings(),
content_storage=ContentStorageConfig(enabled=True, field_name="_content"),
)
collection.insert_text("id1", "Long passage …", metadata={"title": "Doc"})
for r in collection.search_text("query", limit=3, include_content=True):
if r.has_content():
print(r.content)
Vectorizer presets (Configure.Vectors)
| Method | Use case |
|---|---|
auto_embeddings(...) |
Default server-side pipeline (often Sentence Transformers–backed on server) |
sentence_transformers(model=, dimensions=) |
Explicit ST model |
openai_embeddings(api_key=, …) |
OpenAI API |
huggingface_embeddings(api_key=, …) |
Hugging Face Inference API |
ollama_embeddings(model=, dimensions=, base_url=) |
Local Ollama |
Details: docs/embeddings.md.
Index tuning
HNSW — pass index_type="hnsw" or IndexType.HNSW and config keys such as m, ef_construction, ef_search (see API / server defaults).
IVF — index_type=IndexType.IVF and config=Configure.Index.ivf_flat(nlist=16, nprobe=2) (prototype index on server).
Configuration inspection
info = db.config() # dict: unified config + metadata from GET /config
API overview
VittoriaDB
| Method | Description |
|---|---|
connect(url=, auto_start=, port=, host=, data_dir=, extra_args=) |
Client instance |
create_collection(...) |
New collection |
get_collection(name) |
Handle to existing collection |
list_collections() |
List CollectionInfo |
delete_collection(name) |
Drop collection |
health() |
HealthStatus |
stats() |
DatabaseStats |
prometheus_metrics() |
Raw Prometheus text |
config() |
Server configuration JSON |
close() |
Cleanup / stop auto-started server |
Collection
| Method | Description |
|---|---|
insert(id, vector, metadata=) |
Single vector |
insert_batch(vectors) |
Batch |
insert_text / insert_text_batch |
Server-side embedding |
search(vector, limit=, filter=, use_post=, …) |
Similarity search |
search_text(query, limit=, filter=, …) |
Query embedding + search |
upload_file / upload_files |
Document → chunks + vectors |
get / delete / count |
CRUD helpers |
Exported types include Vector, SearchResult, CollectionInfo, HealthStatus, DatabaseStats, DistanceMetric, IndexType, VectorizerConfig, ContentStorageConfig, and configuration/error types listed in vittoriadb.__all__.
Contributing & license
- Issues: GitHub Issues
- Dev setup: DEVELOPMENT.md
- License: MIT
Changelog (high level)
- 0.7.0 — Aligned with VittoriaDB v0.7.0 GitHub release assets; same feature set as 0.6.x (filters,
use_post,prometheus_metrics,Configure.Index.ivf_flat,HealthStatus/DatabaseStats); documentation table and API overview updated. - 0.6.x — Metadata filters, observability helpers, IVF config in client; README refresh.
- 0.5.x — Unified server configuration;
config(); performance-related server features.
Full release notes: GitHub Releases.
Metadata
Release files for vittoriadb 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vittoriadb-0.7.0.tar.gz | 19.1 kB | Without provenance | Details for vittoriadb-0.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vittoriadb-0.7.0-py3-none-any.whl | Python 3 | none | any | Details for vittoriadb-0.7.0-py3-none-any.whl |
Total release size: 4.1 MB
Release files / vittoriadb-0.7.0.tar.gz
| Download URL | vittoriadb-0.7.0.tar.gz |
|---|---|
| Size | 19.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ebdb08d972fa24c4e401200f57031b34d505646a994ce2d3116209ff3d4d4d4
|
|
BLAKE2b-256 checksum How to use checksums |
006557e856a1836d6bbd93c1870118e11935eabaa8cc92592516e513050db1d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.5
|
Release files / vittoriadb-0.7.0-py3-none-any.whl
| Download URL | vittoriadb-0.7.0-py3-none-any.whl |
|---|---|
| Size | 4.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6d57ff997df543279e4361ce9e284289b558b4bfddec32dd2b843e983f62111e
|
|
BLAKE2b-256 checksum How to use checksums |
0cc2bcaaf58acfaf3c932e9277cd03e00ba16e9a227d8be2c3cf51fc1413c66d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.5
|
Security for vittoriadb 0.7.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.