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.13.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.13.0
File Size Uploaded Provenance Actions
samyama-1.13.0.tar.gz 6.7 MB With provenance Details for samyama-1.13.0.tar.gz

Built distributions (wheels)

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

Total release size: 59.6 MB

Release files / samyama-1.13.0.tar.gz

Download URL samyama-1.13.0.tar.gz
Size 6.7 MB
Tags Source
SHA-256 checksum
How to use checksums
e4448be7784355390563f52878c0602a2bc989ba67802f9bce31a83e7a3d0fcf
BLAKE2b-256 checksum
How to use checksums
01980a820e89c26bcf5e57584b5f83f5642c6d9c922575e3a8c9d183a79747bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 27, 2026.

Transparency log

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

Download URL samyama-1.13.0-cp38-abi3-win_amd64.whl
Size 9.6 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f9f31e37af9f311036bdeb650617de99218db4027ec294822bf2f6b48b090f4a
BLAKE2b-256 checksum
How to use checksums
d3831817115214b2332beed6426128f1d26514d63db2a9563785ac79039bcad2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 27, 2026.

Transparency log

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

Download URL samyama-1.13.0-cp38-abi3-manylinux_2_28_x86_64.whl
Size 11.7 MB
Tags CPython 3.8 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
973b0dd6d8f05a033a502707811a8fec4acd3db9876dfcef51366f4bae4ea9c4
BLAKE2b-256 checksum
How to use checksums
d73888eba43b1e697e40db048eabee7d76804aa8ff5b08201da3c182a0a72d1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 27, 2026.

Transparency log

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

Download URL samyama-1.13.0-cp38-abi3-manylinux_2_28_aarch64.whl
Size 11.5 MB
Tags CPython 3.8 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
18de78c4abcce625411de3ea0686add242c1f5e6453a326f164fede8c7359fd2
BLAKE2b-256 checksum
How to use checksums
65a1ed77aaededf58e6ca766f64ccb2d5fb43cabbac7925627b7a022fa569450
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 27, 2026.

Transparency log

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

Download URL samyama-1.13.0-cp38-abi3-macosx_11_0_arm64.whl
Size 9.8 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6b18841752aab51340dc9307541a0bdc123bb5b2944529eee195e136015db484
BLAKE2b-256 checksum
How to use checksums
524e775ee7f813e4ebc4dbc6f4be72b1be1a6643b1025a7f707e8623cedd425d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 27, 2026.

Transparency log

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

Download URL samyama-1.13.0-cp38-abi3-macosx_10_15_x86_64.whl
Size 10.4 MB
Tags CPython 3.8 abi3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
f6dc4a8edb6e1496ea5e0ce05636d3ca348e09ae691a35d14100c981256045f5
BLAKE2b-256 checksum
How to use checksums
fdf78a6e752cbdf1adba47f9a39cb560a8fd3377fdd35a65659fdfdc39cee553
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 27, 2026.

Transparency log

Security for samyama 1.13.0

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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for samyama-1.13.0.tar.gz

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 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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