Skip to main content

Crate graphmind_sdk

Crate graphmind_sdk 

Source
Expand description

Graphmind SDK — Client library for the Graphmind Graph Database

Provides two client implementations:

  • EmbeddedClient — In-process, no network. Uses GraphStore and QueryEngine directly. Ideal for tests, examples, and embedded applications.

  • RemoteClient — Connects to a running Graphmind server via HTTP. For production client applications.

Both implement the GraphmindClient trait for a unified API.

Extension traits (EmbeddedClient only):

  • AlgorithmClient — PageRank, WCC, SCC, BFS, Dijkstra, and more
  • VectorClient — Vector index creation, insertion, and k-NN search

§Quick Start

use graphmind_sdk::{EmbeddedClient, GraphmindClient};

#[tokio::main]
async fn main() {
    let client = EmbeddedClient::new();

    // Create data
    client.query("default", r#"CREATE (n:Person {name: "Alice"})"#)
        .await.unwrap();

    // Query data
    let result = client.query_readonly("default", "MATCH (n:Person) RETURN n.name")
        .await.unwrap();
    println!("Found {} records", result.len());
}

Re-exports§

pub use client::GraphmindClient;
pub use embedded::EmbeddedClient;
pub use error::GraphmindError;
pub use error::GraphmindResult;
pub use models::QueryResult;
pub use models::SdkEdge;
pub use models::SdkNode;
pub use models::ServerStatus;
pub use models::StorageStats;
pub use remote::RemoteClient;
pub use algo::AlgorithmClient;
pub use vector_ext::VectorClient;

Modules§

algo
AlgorithmClient — extension trait for graph algorithms (EmbeddedClient only)
client
GraphmindClient trait — the unified interface for embedded and remote modes
embedded
EmbeddedClient — in-process graph database client
error
Error types for the Graphmind SDK
models
Data models for the Graphmind SDK
pca
Principal Component Analysis (PCA)
remote
RemoteClient — network client for a running Graphmind server
vector_ext
VectorClient — extension trait for vector search operations (EmbeddedClient only)

Structs§

ABCSolver
AgentConfig
Configuration for Agentic features
AgentRuntime
Runtime for executing agents
AutoEmbedConfig
Configuration for Auto-Embed features
BatSolver
CacheStats
Lock-free cache hit/miss counters.
CuckooSolver
DESolver
Edge
A directed edge in the property graph
EdgeId
Unique identifier for an edge
EdgeType
Edge type (relationship type, e.g., “KNOWS”, “WORKS_AT”) Implements REQ-GRAPH-003: Edges with types
FireflySolver
FlowResult
GASolver
GWOSolver
GraphStore
In-memory graph storage engine.
GraphView
A dense, integer-indexed view of the graph topology using Compressed Sparse Row (CSR) format.
IndexKey
Key for identifying a vector index: (Label, PropertyKey)
Individual
Represents a candidate solution in the optimization space.
JayaSolver
Label
Node label (e.g., “Person”, “Employee”) Implements REQ-GRAPH-002: Nodes with labels
MSTResult
MultiObjectiveIndividual
Represents a candidate solution in a multi-objective space.
MultiObjectiveResult
The result of a multi-objective optimization run (Pareto Front).
NLQConfig
Configuration for NLQ features
NLQPipeline
NSGA2Solver
Node
A node in the property graph
NodeId
Unique identifier for a node
OptimizationResult
The result of an optimization run.
PSOSolver
PageRankConfig
PageRank configuration
PathResult
Result of a pathfinding algorithm
PcaConfig
PCA configuration
PcaResult
PCA result containing components and explained variance
PersistenceManager
Integrated persistence manager combining WAL, storage, and tenancy
PersistentStorage
RocksDB-based persistent storage
QueryEngine
Query engine - high-level interface for executing queries
RaoSolver
RecordBatch
A batch of records (result set)
SASolver
SccResult
Result of SCC algorithm
SimpleProblem
A simple problem defined by a closure.
SolverConfig
Configuration for the solver.
TLBOSolver
ToolConfig
Tool definition for agents
VectorIndex
Wrapper around HNSW index
VectorIndexManager
Manager for all vector indices in the system
Wal
Write-Ahead Log manager
WccResult
Result of WCC algorithm

Enums§

DistanceMetric
Distance metric for vector search
GraphError
Errors that can occur during graph operations
LLMProvider
LLM Provider options
NLQError
PcaSolver
Solver strategy for PCA.
PersistenceError
Persistence errors
PropertyValue
Property value type supporting multiple data types
StorageError
Storage errors
VectorError
Vector index errors
WalEntry
Write-Ahead Log entry types
WalError
WAL errors

Constants§

VERSION
Version information

Traits§

MultiObjectiveProblem
Defines a multi-objective optimization problem.
Problem
Defines the optimization problem.

Functions§

bfs
Breadth-First Search (Unweighted Shortest Path)
build_view
Build a GraphView from the store for algorithm execution
count_triangles
Triangle Counting
dijkstra
Dijkstra’s Algorithm (Weighted Shortest Path)
edmonds_karp
Edmonds-Karp Algorithm for Max Flow
page_rank
Calculate PageRank for the graph view
pca
Run PCA on a feature matrix.
prim_mst
Prim’s Algorithm for Minimum Spanning Tree
strongly_connected_components
Strongly Connected Components (SCC) using Tarjan’s algorithm
weakly_connected_components
Weakly Connected Components (WCC)

Type Aliases§

Array1
one-dimensional array
GraphResult
NLQResult
PersistenceResult
PropertyMap
Property map for storing node and edge properties
StorageResult
VectorResult
WalResult