Skip to main content

samyama — Python SDK for the Samyama Graph Database

Python bindings for Samyama, a property-graph database with a Cypher query engine. The extension module is built from Rust with PyO3 on top of crates/samyama-sdk, so the embedded mode runs the engine in-process — no server, no network.

Install

pip install samyama

Wheels are abi3 and work on CPython 3.8+.

The package also installs samyama_aio (asyncio wrapper), samyama_nb (notebook helpers) and samyama_mcp (an MCP server, entry point samyama-mcp-serve).

Connect

Two modes. Embedded runs the engine inside your process:

from samyama import SamyamaClient

client = SamyamaClient.embedded()

Remote talks to a running Samyama server over HTTP:

from samyama import SamyamaClient

client = SamyamaClient.connect(
    "http://localhost:8080",
    timeout_seconds=30.0,          # whole-request deadline
    connect_timeout_seconds=5.0,   # TCP connect only
    max_retries=2,
    retry_base_delay_ms=100,
)

Both return the same SamyamaClient, with the same query methods. Graph algorithms (page_rank, wcc, scc, bfs, dijkstra, pca, triangle_count) and the vector methods (create_vector_index, add_vector, vector_search) are embedded-only and raise RuntimeError on a remote client.

First query

from samyama import SamyamaClient

client = SamyamaClient.embedded()

client.query('CREATE (:Person {name: "Alice"})-[:KNOWS]->(:Person {name: "Bob"})')

result = client.query_readonly(
    "MATCH (a:Person)-[:KNOWS]->(b:Person) RETURN a.name, b.name"
)

print(result.columns)   # ['a.name', 'b.name']
for row in result.records:
    print(row)          # ['Alice', 'Bob']
print(len(result))      # 1

query is read-write, query_readonly is read-only. Both take an optional graph argument, which defaults to "default"; this build serves a single graph and rejects any other name.

A QueryResult exposes columns, records, nodes, edges, and len().

Other methods on the client: status() (returns a ServerStatus with status, version, nodes, edges), ping(), list_graphs(), delete_graph(graph="default").

asyncio

samyama_aio wraps the same client, running each call on a worker thread so the event loop is not blocked:

import asyncio
from samyama_aio import AsyncSamyamaClient

async def main():
    client = await AsyncSamyamaClient.embedded()
    await client.query('CREATE (:Person {name: "Alice"})')
    result = await client.query_readonly("MATCH (n:Person) RETURN n.name")
    print(result.records)   # [['Alice']]

asyncio.run(main())

AsyncSamyamaClient.connect(url, **kwargs) takes the same keyword arguments as SamyamaClient.connect.

More

Apache-2.0.

Metadata

Release files for samyama 1.11.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 samyama 1.11.0
File Size Uploaded
samyama-1.11.0.tar.gz 6.5 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for samyama 1.11.0
File
samyama-1.11.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
samyama-1.11.0-cp38-abi3-manylinux_2_28_x86_64.whl CPython 3.8 abi3 Linux glibc 2.28+ x86-64 Details
samyama-1.11.0-cp38-abi3-manylinux_2_28_aarch64.whl CPython 3.8 abi3 Linux glibc 2.28+ ARM64 Details
samyama-1.11.0-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details
samyama-1.11.0-cp38-abi3-macosx_10_15_x86_64.whl CPython 3.8 abi3 macOS 10.15+ x86-64 Details

Total release size: 61.7 MB

Release files / samyama-1.11.0.tar.gz

Download URL samyama-1.11.0.tar.gz
Size 6.5 MB
Tags Source
SHA-256 checksum
How to use checksums
471c1e6493022bcb0586096feb2f464da2a335b91b666a7171427bbc954d49ce
BLAKE2b-256 checksum
How to use checksums
460a937f7ec751f258019b041aefa2aa4d3229d04e5b50edc14525f8a52bfc66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 5, 2026.

Transparency log

Release files / samyama-1.11.0-cp38-abi3-win_amd64.whl

Download URL samyama-1.11.0-cp38-abi3-win_amd64.whl
Size 10.1 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
d0e79fb5806e12630dabe35814542576deffa932cb9329117e7fd93daf5bf5b9
BLAKE2b-256 checksum
How to use checksums
379e63e22c00bc5e48977b5844efdf6202e9651ac7e18de623328f88ff4c7b23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 5, 2026.

Transparency log

Release files / samyama-1.11.0-cp38-abi3-manylinux_2_28_x86_64.whl

Download URL samyama-1.11.0-cp38-abi3-manylinux_2_28_x86_64.whl
Size 12.1 MB
Tags CPython 3.8 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
142a033f0fc7a9a7789dfdd654c7e7fc29c390d23a212086b9e2ef9613d4d73f
BLAKE2b-256 checksum
How to use checksums
eea0a4a20c530b40821608734d13aab311835ea49f51d6ccbc5b236c6b50dd50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 5, 2026.

Transparency log

Release files / samyama-1.11.0-cp38-abi3-manylinux_2_28_aarch64.whl

Download URL samyama-1.11.0-cp38-abi3-manylinux_2_28_aarch64.whl
Size 12.0 MB
Tags CPython 3.8 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
156dc505baef2c63057f561397b421035d3f537c141c4939ffb57705cf9f8a2d
BLAKE2b-256 checksum
How to use checksums
7d3dc9d6f0236783e3a35ee2e814337dbcfd42e8597d785a802b6d01c7932bcd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 5, 2026.

Transparency log

Release files / samyama-1.11.0-cp38-abi3-macosx_11_0_arm64.whl

Download URL samyama-1.11.0-cp38-abi3-macosx_11_0_arm64.whl
Size 10.3 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2e42697d542eee2629da22424cd11f0ab850a4797663d48239fb80621ba72144
BLAKE2b-256 checksum
How to use checksums
0bac6d0b000fd97cf0826f9943a754761ffc702fccdc5d43219dffea6b0c6eb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 5, 2026.

Transparency log

Release files / samyama-1.11.0-cp38-abi3-macosx_10_15_x86_64.whl

Download URL samyama-1.11.0-cp38-abi3-macosx_10_15_x86_64.whl
Size 10.9 MB
Tags CPython 3.8 abi3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
12b61ba27315f323d5137c547e2e29b79f10f128d368dacb437de6ec78ddbc2a
BLAKE2b-256 checksum
How to use checksums
372b623ae1d83bb66a034ed6cb7a1449a1cb96ae8bab1c67373e4c1e3587e372
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.11.0 This release

6 release files

1.10.0

5 release files

1.9.0

6 release files

1.8.0

6 release files

1.7.1

2 release files

0.6.1

2 release files

0.6.0

1 release file

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