Skip to main content

High-performance multi-model database — KV, Graph, SQL, Vector Search, Full-Text Search

Project description

aresadb

Python bindings for AresaDB — a high-performance multi-model database engine in Rust.

Key-Value · Graph · SQL · Vector Search · Full-Text Search — all from Python.

Install

pip install aresadb
# or
uv add aresadb

Quick Start

from aresadb_python import Database

db = Database.create("./mydata", "demo")

# Insert nodes
user = db.insert_dict("user", {"name": "Alice", "age": 30})

# Batch insert
nodes = db.insert_batch([
    ("user", {"name": "Bob", "age": 25}),
    ("user", {"name": "Charlie", "age": 35}),
])

# Get / Update / Delete
node = db.get(user.id)
updated = db.update(user.id, {"name": "Alice", "age": 31})
db.delete(user.id)

# List by type
users = db.get_by_type("user", limit=100)

SQL Queries

result = db.query("SELECT * FROM user WHERE age > 28 ORDER BY name LIMIT 10")
for row in result.rows:
    print(dict(zip(result.columns, row)))

db.query("INSERT INTO product (name, price) VALUES ('Widget', 9.99)")
db.query("UPDATE user SET age = 31 WHERE name = 'Alice'")
db.query("DELETE FROM user WHERE age < 18")

Graph (Edges & Traversal)

alice = db.insert_dict("user", {"name": "Alice"})
bob = db.insert_dict("user", {"name": "Bob"})
charlie = db.insert_dict("user", {"name": "Charlie"})

# Create edges (with optional properties)
edge = db.create_edge(alice.id, bob.id, "follows", {"since": "2024"})

# Batch edges
db.create_edges_batch([
    (bob.id, charlie.id, "follows"),
    (alice.id, charlie.id, "knows"),
])

# Query edges
outgoing = db.get_edges_from(alice.id)
incoming = db.get_edges_to(charlie.id, edge_type="follows")
db.delete_edge(edge.id)

# BFS traversal
result = db.traverse(alice.id, max_depth=3, edge_types=["follows"])
print(f"Visited {len(result.nodes)} nodes over {result.depth} hops")
print(result.adjacency)  # {node_id: [neighbor_ids]}

# Shortest path
path = db.shortest_path(alice.id, charlie.id)
if path:
    print(" -> ".join(n.properties.get("name", n.id) for n in path))

# Connected components
components = db.connected_components("user")
print(f"{len(components)} component(s)")

Secondary Indexes

db.create_index("user", "age")        # B-tree index
results = db.index_lookup("user", "age", 30)
db.list_indexes()                      # [("user", "age")]
db.drop_index("user", "age")

Full-Text Search (BM25)

db.insert("article", '{"title": "Rust", "body": "Rust is a systems language"}')
db.insert("article", '{"title": "Python", "body": "Python is great for ML"}')

db.create_fulltext_index("article", "body")

results = db.fulltext_search("article", "body", "Rust systems", limit=5)
for r in results:
    print(f"Score: {r.score:.3f}  Node: {r.node.properties}")

db.list_fulltext_indexes()  # [("article", "body")]

Vector Search (HNSW)

# Insert with embedding
doc = db.insert_with_embedding(
    "document",
    '{"title": "ML Intro"}',
    "embedding",
    [0.9, 0.1, 0.0, 0.0],
)

# k-NN search (HNSW-accelerated)
results = db.similarity_search(
    query_vector=[1.0, 0.0, 0.0, 0.0],
    node_type="document",
    field="embedding",
    k=10,
    metric="cosine",  # cosine | euclidean | dot | manhattan
)

# Radius search (exact, brute-force)
near = db.similarity_search_radius(
    [1.0, 0.0, 0.0, 0.0], "document", "embedding",
    max_distance=0.5, metric="euclidean",
)

# Retrieve node + embedding
node, vec = db.get_node_with_embedding(doc.id, "embedding")

# Rebuild HNSW index after bulk inserts
stats = db.rebuild_vector_index("document", "embedding")
print(f"{stats.num_vectors} vectors, dim={stats.dimension}")

Introspection

status = db.status()
print(f"{status.name}: {status.node_count} nodes, {status.edge_count} edges, {status.size_bytes} bytes")
print(db.name(), db.path())

Type Stubs

A .pyi stub file ships with the package for full IDE autocompletion and type checking.

Running Tests

cd python/
uv venv .venv && source .venv/bin/activate
uv pip install maturin pytest
maturin develop --release
pytest tests/ -v

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aresadb-2.0.0a2.tar.gz (350.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

aresadb-2.0.0a2-cp313-cp313-macosx_11_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

aresadb-2.0.0a2-cp313-cp313-macosx_10_12_x86_64.whl (5.7 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

aresadb-2.0.0a2-cp312-cp312-manylinux_2_38_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.38+ x86-64

aresadb-2.0.0a2-cp312-cp312-manylinux_2_38_aarch64.whl (8.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.38+ ARM64

aresadb-2.0.0a2-cp312-cp312-macosx_11_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

aresadb-2.0.0a2-cp312-cp312-macosx_10_12_x86_64.whl (5.7 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

aresadb-2.0.0a2-cp311-cp311-macosx_11_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

aresadb-2.0.0a2-cp311-cp311-macosx_10_12_x86_64.whl (5.7 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

aresadb-2.0.0a2-cp310-cp310-macosx_11_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

aresadb-2.0.0a2-cp310-cp310-macosx_10_12_x86_64.whl (5.7 MB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

aresadb-2.0.0a2-cp39-cp39-macosx_11_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

aresadb-2.0.0a2-cp39-cp39-macosx_10_12_x86_64.whl (5.7 MB view details)

Uploaded CPython 3.9macOS 10.12+ x86-64

File details

Details for the file aresadb-2.0.0a2.tar.gz.

File metadata

  • Download URL: aresadb-2.0.0a2.tar.gz
  • Upload date:
  • Size: 350.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aresadb-2.0.0a2.tar.gz
Algorithm Hash digest
SHA256 0ff371d5ced584b2b52e3a3d987c6d9ad6e60f1dbb567f62e5422904c5cf5793
MD5 d49b2225f3cd53e2442b38d269e07923
BLAKE2b-256 480a0e3e2991e062ebbcbaaae956dca6d09f8b6ec1774770908c2010bb75b334

See more details on using hashes here.

Provenance

The following attestation bundles were made for aresadb-2.0.0a2.tar.gz:

Publisher: release.yml on yoreai/aresadb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aresadb-2.0.0a2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for aresadb-2.0.0a2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1fb3fbea1e582b42ebc8d4261e03692d21fb2bb460197f36bd4351fbaf506bc6
MD5 b2e842ec0f2a74dd7388bdf00d74a0b0
BLAKE2b-256 24628dcc6a63f7df2cafd41cf717e9d8451fe00650039b6866365ff2540dc562

See more details on using hashes here.

Provenance

The following attestation bundles were made for aresadb-2.0.0a2-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on yoreai/aresadb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aresadb-2.0.0a2-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for aresadb-2.0.0a2-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9ec7510a7e67ac0ae2c2424c8f027470edc35c8d7cfa635986f63088a8798ef3
MD5 efd92ae1828e5851146a0dc354651de3
BLAKE2b-256 00154600236dfd4a92c0fbc046c50816c6c635989492eef64496e2697d0fdd63

See more details on using hashes here.

Provenance

The following attestation bundles were made for aresadb-2.0.0a2-cp313-cp313-macosx_10_12_x86_64.whl:

Publisher: release.yml on yoreai/aresadb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aresadb-2.0.0a2-cp312-cp312-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for aresadb-2.0.0a2-cp312-cp312-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 c8c960f83e23c80974c4309da5b3797ab0d0a034e9117cc653d3f450d43de395
MD5 8e16460b1347a84b89f3d0c6011b3583
BLAKE2b-256 6d5b5f3af81d58d05a6a40f6068930c81a737a1704da4fa37db5d6d1ed26e046

See more details on using hashes here.

Provenance

The following attestation bundles were made for aresadb-2.0.0a2-cp312-cp312-manylinux_2_38_x86_64.whl:

Publisher: release.yml on yoreai/aresadb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aresadb-2.0.0a2-cp312-cp312-manylinux_2_38_aarch64.whl.

File metadata

File hashes

Hashes for aresadb-2.0.0a2-cp312-cp312-manylinux_2_38_aarch64.whl
Algorithm Hash digest
SHA256 f7877248eaedf51b685132076b2bff70cd0ec032ef758d4d873173942e6928eb
MD5 479bc34c407b6222f2e5ed16f6595b09
BLAKE2b-256 f841ce7617df966fe5ab38003bc1df594e626eb45cbed0a1bb2557b0281cd273

See more details on using hashes here.

Provenance

The following attestation bundles were made for aresadb-2.0.0a2-cp312-cp312-manylinux_2_38_aarch64.whl:

Publisher: release.yml on yoreai/aresadb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aresadb-2.0.0a2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for aresadb-2.0.0a2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e9513562e53d0d1629e705f73890d04056b02f3f094160e095ca215affc9c881
MD5 10e191fa2e52329785de7e8284863735
BLAKE2b-256 2cd16102164bb0e5bf086b8f87014b3d5e8f0b0c9809f45971bb5e74bf9e7849

See more details on using hashes here.

Provenance

The following attestation bundles were made for aresadb-2.0.0a2-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on yoreai/aresadb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aresadb-2.0.0a2-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for aresadb-2.0.0a2-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ba168a1e1873ae3492a10045ca45c94fb8ff1db0567c45453c3ec5b0cfdbc4e6
MD5 76098aff5c05f1531a8e65c6dbd50f0d
BLAKE2b-256 2b83e7ed8e7c2e36851876312c2a846872f0af50009aedf37383451707bb24c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for aresadb-2.0.0a2-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: release.yml on yoreai/aresadb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aresadb-2.0.0a2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for aresadb-2.0.0a2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2c225c216a0457ee5f04294d991012365a7aca1be7bf432c9fdf9fd563a30d11
MD5 6245476df1b4dc4cfd6f254f93f7576c
BLAKE2b-256 db10f732f347275c1cc5ce41b08d3907b252a53c7ea926724e500516a4b81e62

See more details on using hashes here.

Provenance

The following attestation bundles were made for aresadb-2.0.0a2-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on yoreai/aresadb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aresadb-2.0.0a2-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for aresadb-2.0.0a2-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8fb93bfaea6ae32d24e1cde3fbf8fa227fcacba417731ff2b477782aed5102db
MD5 b5be3e66f5ed041b44f79b9b25379b9a
BLAKE2b-256 e856752a52409b06faaa1116ca5f87e76e9267929042dfbb21790313f0912a07

See more details on using hashes here.

Provenance

The following attestation bundles were made for aresadb-2.0.0a2-cp311-cp311-macosx_10_12_x86_64.whl:

Publisher: release.yml on yoreai/aresadb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aresadb-2.0.0a2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for aresadb-2.0.0a2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 91b9ec001adfdcfd0f051e745cbd861d2f1e2e00c9db0dfb813b1915e153484b
MD5 179d5815a7a94454f8b70ccb1be47361
BLAKE2b-256 d35d0cf6131e92ae3558d6270501cd0a42cdbd356ee2f6c9de35c5c67517e55d

See more details on using hashes here.

Provenance

The following attestation bundles were made for aresadb-2.0.0a2-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: release.yml on yoreai/aresadb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aresadb-2.0.0a2-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for aresadb-2.0.0a2-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 fec73baf31b0093cf549ea9ef662025a12d6454d51e8c828f62356e75edf7d9f
MD5 06d316a632f0f5a5814f5d100a823f2d
BLAKE2b-256 bf44146950ad7fcff6e70b008a545caf981450e654fcc08f11fb8bab78e5fb79

See more details on using hashes here.

Provenance

The following attestation bundles were made for aresadb-2.0.0a2-cp310-cp310-macosx_10_12_x86_64.whl:

Publisher: release.yml on yoreai/aresadb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aresadb-2.0.0a2-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for aresadb-2.0.0a2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a70423a09f20fc38327ead7a78c5f8c65690b96f46bc743ab01719e8c75fb59a
MD5 3f3bbf483cdfe89d84b45db15ddb98aa
BLAKE2b-256 799b2fa701286414e946de2ed249822aa04e7148acb6ce13b24f031ab706846a

See more details on using hashes here.

Provenance

The following attestation bundles were made for aresadb-2.0.0a2-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: release.yml on yoreai/aresadb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aresadb-2.0.0a2-cp39-cp39-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for aresadb-2.0.0a2-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8dee4c11874369f11fb9ff14df27a46e3048b790968df6136e842bfd172d844b
MD5 e65b512b5127f77f186226d180e0078b
BLAKE2b-256 15d9357f046f9c4cfe585a5fc233793c11f8b0b32f6454cefc677eda2fc3991e

See more details on using hashes here.

Provenance

The following attestation bundles were made for aresadb-2.0.0a2-cp39-cp39-macosx_10_12_x86_64.whl:

Publisher: release.yml on yoreai/aresadb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page