Skip to main content

Python SDK for the Graphmind Graph Database — embedded and remote modes

Project description

Graphmind Graph Database

Version Rust License

Graphmind is a high-performance, distributed graph database written in Rust with ~90% OpenCypher support, Redis protocol compatibility, and a built-in web visualizer. It combines property graph storage, vector search, graph algorithms, and natural language querying in a single binary.

Screenshots

Graph Explorer Shortest Path Node Inspector
Graph Explorer Shortest Path Node Inspector
Circular Layout Hierarchical Layout Query Editor
Circular Hierarchical Query Editor
Schema Browser Admin Panel Settings
Schema Admin Settings

Install

Docker (recommended)

docker run -d --name graphmind \
  -p 6379:6379 -p 8080:8080 \
  -v graphmind-data:/data \
  fabischk/graphmind:latest

Binary

# Quick install script (Linux/macOS)
curl -sSL https://raw.githubusercontent.com/fab679/graphmind/main/dist/install.sh | bash

# Or download directly from GitHub Releases:
# https://github.com/fab679/graphmind/releases/latest
# Linux:  graphmind-v0.7.0-x86_64-unknown-linux-gnu.tar.gz
# macOS:  graphmind-v0.7.0-aarch64-apple-darwin.tar.gz
# Intel:  graphmind-v0.7.0-x86_64-apple-darwin.tar.gz

Cargo

cargo install graphmind

From Source

git clone https://github.com/fab679/graphmind.git
cd graphmind
cd ui && npm install && npm run build && cd ..
cargo build --release
./target/release/graphmind

Quick Start

# Start the server (RESP on :6379, HTTP on :8080)
graphmind

# Open the web visualizer
open http://localhost:8080

Create data and query

redis-cli -p 6379

# Create nodes and relationships
GRAPH.QUERY default "CREATE (a:Person {name: 'Alice', age: 30})"
GRAPH.QUERY default "CREATE (b:Person {name: 'Bob', age: 25})"
GRAPH.QUERY default "MATCH (a:Person {name: 'Alice'}), (b:Person {name: 'Bob'}) CREATE (a)-[:KNOWS]->(b)"

# Query
GRAPH.QUERY default "MATCH (p:Person)-[:KNOWS]->(friend) RETURN p.name, friend.name"

Load demo data

curl -X POST http://localhost:8080/api/script \
  -H 'Content-Type: application/json' \
  --data-binary @scripts/social_network_demo.cypher

SDK Examples

Python

pip install graphmind
from graphmind import GraphmindClient

db = GraphmindClient.embedded()  # or .remote("localhost", 8080)

db.query("""
    CREATE (a:Person {name: 'Alice', age: 30});
    CREATE (b:Person {name: 'Bob', age: 25});
    MATCH (a:Person {name: 'Alice'}), (b:Person {name: 'Bob'})
    CREATE (a)-[:KNOWS]->(b)
""")

result = db.query_readonly("MATCH (n:Person) RETURN n.name, n.age")
print(result)

TypeScript

npm install graphmind-sdk
import { GraphmindClient } from 'graphmind-sdk';

const client = new GraphmindClient({ url: 'http://localhost:8080' });

await client.query(`
  CREATE (a:Person {name: "Alice", age: 30});
  CREATE (b:Person {name: "Bob", age: 25});
  MATCH (a:Person {name: "Alice"}), (b:Person {name: "Bob"})
  CREATE (a)-[:KNOWS]->(b)
`);

const result = await client.query('MATCH (n:Person) RETURN n.name, n.age');

Rust

[dependencies]
graphmind-sdk = "0.7.0"
use graphmind_sdk::EmbeddedClient;

let mut client = EmbeddedClient::new();
client.query("default", "
    CREATE (a:Person {name: 'Alice', age: 30});
    CREATE (b:Person {name: 'Bob', age: 25});
    MATCH (a:Person {name: 'Alice'}), (b:Person {name: 'Bob'})
    CREATE (a)-[:KNOWS]->(b)
")?;

let result = client.query_readonly("default", "MATCH (n:Person) RETURN n.name, n.age")?;

redis-cli / Any Redis Client

redis-cli -p 6379
> GRAPH.QUERY default "MATCH (n) RETURN labels(n), count(n)"
import redis
r = redis.Redis(port=6379)
r.execute_command('GRAPH.QUERY', 'default', 'MATCH (n:Person) RETURN n.name')

REST API

curl -X POST http://localhost:8080/api/query \
  -H 'Content-Type: application/json' \
  -d '{"query": "MATCH (n) RETURN n LIMIT 10"}'

Configuration

Variable Default Description
GRAPHMIND_HOST 127.0.0.1 RESP server bind address
GRAPHMIND_PORT 6379 RESP server port
GRAPHMIND_HTTP_PORT 8080 HTTP/visualizer port
GRAPHMIND_DATA_DIR ./graphmind_data Data directory
GRAPHMIND_AUTH_TOKEN (none) Enable auth with this token
GRAPHMIND_LOG_LEVEL info Log level

See dist/config.toml for a full config file example.

Key Features

  • OpenCypher -- ~90% coverage (MATCH, CREATE, MERGE, WITH, UNWIND, UNION, 30+ functions)
  • RESP Protocol -- Works with any Redis client
  • Vector Search -- Built-in HNSW indexing
  • NLQ -- Natural language to Cypher via OpenAI, Gemini, Ollama, or Claude
  • Graph Algorithms -- PageRank, BFS, Dijkstra, WCC, SCC, and more
  • Multi-Tenancy -- Isolated graph namespaces with per-tenant quotas
  • High Availability -- Raft consensus for cluster replication
  • Web Visualizer -- Interactive graph explorer with D3.js force graph
  • MCP Server -- Auto-generate AI agent tools from graph schema

Documentation

License

Apache License 2.0

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

graphmind-0.8.1.tar.gz (8.0 MB view details)

Uploaded Source

Built Distribution

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

graphmind-0.8.1-cp312-cp312-manylinux_2_28_x86_64.whl (7.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

File details

Details for the file graphmind-0.8.1.tar.gz.

File metadata

  • Download URL: graphmind-0.8.1.tar.gz
  • Upload date:
  • Size: 8.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.6

File hashes

Hashes for graphmind-0.8.1.tar.gz
Algorithm Hash digest
SHA256 c1b30abbc6435966b3fc3f47429074b3be5c4410ce65c3e89dc14faecca94c44
MD5 84119b2ee8902b3d94f5fefe40216d84
BLAKE2b-256 322ce52862bd550d22584b705b7513ee40c31bc99d237417999453c63c1bd73a

See more details on using hashes here.

File details

Details for the file graphmind-0.8.1-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for graphmind-0.8.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 658478204de1315a60d45c5eaad498cfef2aa4cfbf315579040f6f7a46be69ef
MD5 ec1d85409295ddc01f61b26d5edaa007
BLAKE2b-256 1289adaa2be9f71abf460db34624568937924f17ff3f2c53545f5e41a65dab34

See more details on using hashes here.

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