ITZMA is still taking shape, and its API can change between releases. Version 0.2.1: serde_with security fix
Object-native search infrastructure
ITZMA

An open-source vector database built on object storage

ITZMA runs inside your Rust or Python application and stores its data in your object bucket. Search dense and sparse vectors, filter by typed attributes, and read and write from multiple processes without running a separate database server.

Inspired
by a deeper
land

Object Storage Native

Object storage is the durable source of truth. A write is in the bucket before the call returns.

Supported storage backends

Dense and Sparse Search

Each segment indexes its dense vectors with HNSW or SQ8, and sparse vectors sit beside them.

Built in Rust

The library is memory-safe Rust compiled to native code, with Python bindings on top.

Cloud-Native by Design

Many processes can read and write the same bucket at once, with no coordinator, lock or leader.

How ITZMA works

A library in your process. The bucket holds the data.

There is no server between the caller and the data: any process that can reach the bucket can write, and any process can query. Correctness rests on two things the object store already does, put-if-absent and conditional update.

How an embedded vector database works
How ITZMA works: your Rust or Python app calls ITZMA; dense, sparse and attribute searches converge at exact reranking and top-k; writes flow through the log, compaction, segments and index build into object storage. How ITZMA works: your Rust or Python app calls ITZMA; dense, sparse and attribute searches converge at exact reranking and top-k; writes flow through the log, compaction, segments and index build into object storage.
Getting started

Create, write, query.

Dimension, metric and the type of every attribute are fixed for the life of the namespace. One write call is one atomic batch, and it returns its sequence number. Hits come back closest first.

Build semantic search in Python

A handle holds no lock. Any number of handles, in one process or many, can work on one namespace, and a query that starts after a write returned sees it.

import itzma
from itzma import attr

store = itzma.Store("memory://")  # or "file:///var/lib/itzma", "s3://bucket/prefix", "gs://bucket/prefix", "az://container/prefix"
schema = itzma.Schema(dim=3, metric=itzma.Metric.COSINE, attrs={"year": itzma.AttrType.NUMBER})
ns = itzma.Namespace.create(store, "articles", schema)

ns.upsert([
    {"id": "intro", "vector": [0.9, 0.1, 0.0], "attrs": {"year": 2024}},
    {"id": "faq", "vector": [0.0, 1.0, 0.2], "attrs": {"year": 2021}},
])
hits = ns.query([1.0, 0.0, 0.0], top_k=2, filter=attr("year") >= 2022)
print(hits.ids, hits.distances)
let store = Arc::new(InMemory::new());

// Dimension, metric and the type of every attribute are fixed for the life
// of the namespace.
let schema = Schema::new(3, Metric::Cosine)
    .with_attrs(AttrSchema::new().field("title", AttrType::Text));
let ns = Namespace::create(store.clone(), "articles", schema).await?;

// One call is one atomic write. It returns the sequence number.
let seq = ns
    .upsert(vec![
        Document {
            id: "intro".into(),
            vector: vec![0.9, 0.1, 0.0],
            attrs: Some(serde_json::json!({ "title": "Introduction" })),
            sparse: None,
        },
        Document {
            id: "faq".into(),
            vector: vec![0.0, 1.0, 0.2],
            attrs: None,
            sparse: None,
        },
    ])
    .await?;
assert_eq!(seq, 1);

// Closest first. Lower distance means closer, for every metric.
let hits = ns.query(&[1.0, 0.0, 0.0], 2).await?;
Indexing

HNSW or SQ8, chosen per segment.

A namespace can hold both, and a rebuild can switch one segment’s kind. Candidates are reranked on their exact vectors, so the answer never carries an approximate distance.

How vector search works on object storage
An HNSW index over 2,000 2D points (M=16, M0=32, ef_construction=200) in three layers: 2,000 nodes on layer 0, 131 on layer 1 and 17 on layer 2. A query’s route starts at the entry point on layer 2 and descends to its nearest neighbor on layer 0. An HNSW index over 2,000 2D points (M=16, M0=32, ef_construction=200) in three layers: 2,000 nodes on layer 0, 131 on layer 1 and 17 on layer 2. A query’s route starts at the entry point on layer 2 and descends to its nearest neighbor on layer 0.
An SQ8 index over the same 2,000 points, built with nlist set to 8 (a segment this small gets one partition by default), so a query probes 6 partitions by default. For the row nearest each centroid it shows the original floats, the one-byte codes, the values decoded as min + code × scale, and an error within half a step. An SQ8 index over the same 2,000 points, built with nlist set to 8 (a segment this small gets one partition by default), so a query probes 6 partitions by default. For the row nearest each centroid it shows the original floats, the one-byte codes, the values decoded as min + code × scale, and an error within half a step.
HNSWSQ8
DefaultYesNo
How a query readsFetches the segment’s whole index object in one requestReads only the partitions a query probes
Best whenThe index object is warm in a cacheReads are uncached
Build timeLongerShorter
Recall@10, SIFT1M0.987 (32 segments)0.99 or more
Recall@10, GloVe-250.984 (32 segments)0.99 or more

A clustered index is approximate unless nprobe reaches its partition count; recall is measured on SIFT1M and GloVe-25 only.

What it does

Vector search inside your application

Use ITZMA to store embeddings and retrieve similar documents for semantic search and retrieval-augmented generation (RAG). Your application supplies the embeddings. ITZMA handles vector storage, indexing, filtering, and retrieval.

  • Retrieval inside your app

    It is a library that runs in your process. Open a namespace, and S3, Google Cloud Storage or Azure Blob Storage (or a local directory, or memory) holds the data.

  • Dense and sparse together

    A row can carry a sparse vector of (term id, weight) pairs beside its dense one. Sparse queries are exact, and the inverted index is optional.

  • Filtered search

    Attributes are typed and declared when the namespace is created. Filter on them alone, or use them to narrow a vector query.

  • Many writers, no coordinator

    Upserts and deletes go in batches, and many writers can send them at once. Idempotency keys are optional.

esc

Loading the docs…