A lean RDF-star triplestore with native HNSW vector indexing. Graph traversal and vector similarity in a single SPARQL query.
AI Agent?
SutraDB is serverless by default, like SQLite. Just open a .sdb file — no server needed. Install, configure, and query entirely from the command line.
Vector embeddings are stored as RDF triples and indexed by HNSW. Not a sidecar — a first-class part of the graph. One query language for both.
VECTOR_SIMILAR and VECTOR_SCORE extend standard SPARQL. Traverse the graph, jump into vector space, come back — all in one query.
Like SQLite for graph+vector data. Open a .sdb file, query it. No daemon, no config. Server mode is opt-in when you need HTTP access.
Triples about triples, natively. Annotate edges with confidence scores, embeddings, provenance — no reification hacks.
SPO/POS/OSP indexes on interned u64 IDs. HNSW with cosine/euclidean/dot product. No bloat, no ORMs, no magic.
A superset of RDF 1.2 and SPARQL 1.1. Any valid standard query works. Extensions add what the standards can't express.
Everything the W3C standards do, plus what they can't.
RDF 1.2: triple terms in object position only
+ SutraDB: triple terms in any position (RDF-star)
+ Native vector literals (sutra:f32vec)
+ HNSW index per vector predicate
SPARQL 1.1: SELECT, FILTER, OPTIONAL, UNION...
+ VECTOR_SIMILAR() — ANN search in graph patterns
+ VECTOR_SCORE() — similarity ranking in ORDER BY
+ ef:= and k:= query hints for HNSW tuning
Find academic papers similar to a query vector that cite papers by a specific author:
PREFIX ex: <http://example.org/> SELECT ?paper ?title WHERE { # Jump into vector space: find similar papers VECTOR_SIMILAR(?paper ex:hasEmbedding "0.23 -0.11 0.87 ..."^^sutra:f32vec, 0.85) # Back to graph: filter by citation chain ?paper ex:cites ?cited . ?cited ex:author <http://example.org/Vaswani> . ?paper ex:title ?title . } ORDER BY DESC(VECTOR_SCORE(?paper ex:hasEmbedding "0.23 -0.11 0.87 ..."^^sutra:f32vec)) LIMIT 10
SutraDB is in Developer Preview. Download the latest build or compile from source.
File format: .sdb — a superset of RDF containing triples + HNSW vector indexes.
Query directly (no server needed): sutra query "SELECT * WHERE { ?s ?p ?o } LIMIT 10"
|
Optional server: sutra serve --port 3030
Need replication, clustering, or multi-tenant deployments? Ask about RamaDB for larger installations.