Practical overview
When it fits
Use it when a Python application needs a small, file-backed vector index and can supply its own embeddings. The documented tenant helper is relevant when a prototype needs separate vector databases managed in one process.
Who it is for
- Python developers building retrieval-augmented generation prototypes.
- Teams adding local embedding search and metadata filtering to an application.
- Developers who need simple separation between multiple vector stores.
Documented uses
- Store and update embedding vectors alongside application fields.
- Find nearest vectors and optionally restrict query results with a metadata condition.
- Save an index to a local file and reload it later.
- Create and manage separate tenant vector databases.
Requirements & limits
The project is published as a Python library and documents installation from PyPI or source. Its repository identifies the license as MIT.
- The documented runtime requirement is Python 3.9.11 or later, with NumPy as the stated dependency.
- Vectors are stored in a JSON file; the project's example for 100,000 vectors at dimension 1,024 reports an index of roughly 520 MB.
- The library stores and searches supplied embeddings; it does not document embedding generation.
- The multi-tenant helper provides basic tenant database management and a configurable in-memory capacity.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Create, populate and query a local vector index
Store embedding records in a JSON-backed index and retrieve nearest matches, optionally filtered by a field.
Before you start
- Python 3.9.11 or later
- NumPy
- nano-vectordb installed from PyPI or source
- Embedding vectors as NumPy arrays with a consistent dimension
Steps
Install the package with the command below.
pip install nano-vectordbImport
NanoVectorDBand NumPy, then initialize the database with the embedding dimension and a storage-file path.Pass records containing a
__vector__NumPy array and any metadata fields toupsert;__id__may be supplied, otherwise an ID is generated.Call
querywith an embedding; usetop_kor afilter_lambdato limit results or apply a metadata condition.Call
save()to create or overwrite the JSON index file; initializing from that file loads the index.
Expected outcome
A local, file-persisted vector index that can return nearest-vector matches and support metadata-filtered queries.
Guide limitations
- The library expects the application to provide embeddings; embedding generation is not part of this documented workflow.
- The README's example benchmark reports a roughly 520 MB JSON index for 100,000 vectors at dimension 1,024, so file size can be substantial.
Manage separate tenant vector databases
Create and access separate vector databases through the documented multi-tenant helper.
Before you start
- Python 3.9.11 or later
- NumPy
- nano-vectordb installed
- The vector dimension for the tenant databases
Steps
Import
MultiTenantNanoVDBand initialize it with the vector dimension.Call
create_tenant()and useget_tenant(tenant_id)to obtain that tenant'sNanoVectorDB.Use the returned database for supported operations such as upsert and query.
Call
save()on the multi-tenant manager to save it; use its tenant-management methods to check or delete a tenant.
Expected outcome
A manager for separate tenant vector databases, with a configurable limit on the number kept in memory.
Guide limitations
- The README describes this as naive multi-tenancy; it does not document a hosted service or broader tenant security controls.
- The
max_capacitysetting limits tenant databases held in memory.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- gusye1234/nano-vectordb · Official homepage title · retained in its source language

