Skip to main content

sutradb

Python client for SutraDB — an RDF-star triplestore with native HNSW vector indexing.

Installation

pip install sutradb

Quick Start

from sutradb import SutraClient

client = SutraClient("http://localhost:3030")

# Check server health
if client.health():
    print("SutraDB is running")

# Run a SPARQL query
results = client.sparql("""
    SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10
""")
for binding in results["results"]["bindings"]:
    print(binding["s"]["value"], binding["p"]["value"], binding["o"]["value"])

# Insert triples
client.insert_triples("""
    <http://example.org/paper/1> <http://example.org/title> "Attention Is All You Need" .
    <http://example.org/paper/1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Paper> .
""")

# Declare a vector predicate
client.declare_vector(
    predicate="http://example.org/hasEmbedding",
    dimensions=1536,
)

# Insert a vector
client.insert_vector(
    predicate="http://example.org/hasEmbedding",
    subject="http://example.org/paper/1",
    vector=[0.23, -0.11, 0.87, ...],  # 1536-dimensional vector
)

# Batch insert vectors
entries = [
    ("http://example.org/paper/1", [0.23, -0.11, ...]),
    ("http://example.org/paper/2", [0.45, 0.02, ...]),
]
result = client.insert_vectors_batch("http://example.org/hasEmbedding", entries)
print(f"Inserted {result['inserted']} vectors")

License

Apache-2.0

Metadata

Release files for sutradb 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sutradb 0.4.0
File Size Uploaded
sutradb-0.4.0.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sutradb 0.4.0
File Interpreter ABI Platform
sutradb-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.2 kB

Release files / sutradb-0.4.0.tar.gz

Download URL sutradb-0.4.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4a0c322b9304a999b71d17ad31414614cf29d25af705f8413b34b8d11874c297
BLAKE2b-256 checksum
How to use checksums
6e6ed8da4b16d9bfb4f94851cd40bf2d7d49fcc758edac6fc0c971e0be821c41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 9, 2026.

Transparency log

Release files / sutradb-0.4.0-py3-none-any.whl

Download URL sutradb-0.4.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b2cc2762b32ab1ef4a13fd38817e66f10b274822d4a66b7b1fcf077b77b96c4
BLAKE2b-256 checksum
How to use checksums
d9f84d71e1c13185deeda3c03f50a9d6447748ca362122f0a6443cf2971570a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.7

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page