| Crates.io | sochdb-grpc |
| lib.rs | sochdb-grpc |
| version | 0.4.3 |
| created_at | 2026-01-12 17:13:03.457484+00 |
| updated_at | 2026-01-23 20:37:31.154684+00 |
| description | SochDB gRPC services for cross-language clients (Thick Server / Thin Client architecture) |
| homepage | https://sochdb.dev |
| repository | https://github.com/sochdb/sochdb |
| max_upload_size | |
| id | 2038234 |
| size | 298,552 |
SochDB gRPC Server - Production-ready gRPC services for cross-language database access. Implements the Thick Server / Thin Client architecture where business logic resides in the server, and clients connect via gRPC or IPC.
cargo install sochdb-grpc
Or add to your Cargo.toml:
[dependencies]
sochdb-grpc = "0.3.4"
# Start gRPC server on default port (50051)
sochdb-grpc-server
# Custom port
sochdb-grpc-server --port 8080
# Unix domain socket
sochdb-grpc-server --socket /tmp/sochdb.sock
SOCHDB_LOG=debug # Enable debug logging
SOCHDB_PORT=50051 # Server port
SOCHDB_HOST=0.0.0.0 # Bind address
Key-value operations with atomic batch writes:
rpc Get(GetRequest) returns (GetResponse);
rpc Put(PutRequest) returns (PutResponse);
rpc BatchPut(BatchPutRequest) returns (BatchPutResponse);
rpc Delete(DeleteRequest) returns (DeleteResponse);
rpc Scan(ScanRequest) returns (ScanResponse);
Temporal graph operations with time-travel queries:
rpc AddEdge(AddEdgeRequest) returns (AddEdgeResponse);
rpc AddTemporalEdge(AddTemporalEdgeRequest) returns (AddTemporalEdgeResponse);
rpc QueryGraph(QueryGraphRequest) returns (QueryGraphResponse);
rpc QueryTemporalGraph(QueryTemporalGraphRequest) returns (QueryTemporalGraphResponse);
Temporal Query Example:
use sochdb_grpc::graph_server::GraphService;
// Query: "Was door_1 open 30 minutes ago?"
let request = QueryTemporalGraphRequest {
namespace: "agent_memory".to_string(),
edge_type: Some("state".to_string()),
query_mode: TemporalQueryMode::PointInTime as i32,
timestamp: (now - 30 * 60 * 1000), // 30 mins ago
};
let response = graph_service.query_temporal_graph(request).await?;
Vector search and embedding operations:
rpc CreateCollection(CreateCollectionRequest) returns (CreateCollectionResponse);
rpc Insert(InsertRequest) returns (InsertResponse);
rpc Search(SearchRequest) returns (SearchResponse);
rpc Delete(DeleteRequest) returns (DeleteResponse);
Namespace isolation for multi-tenancy:
rpc CreateNamespace(CreateNamespaceRequest) returns (CreateNamespaceResponse);
rpc ListNamespaces(ListNamespacesRequest) returns (ListNamespacesResponse);
rpc DeleteNamespace(DeleteNamespaceRequest) returns (DeleteNamespaceResponse);
LLM context formatting and optimization:
rpc FormatContext(FormatContextRequest) returns (FormatContextResponse);
rpc ConvertWireFormat(ConvertWireFormatRequest) returns (ConvertWireFormatResponse);
Format Benefits:
Advanced features for production deployments:
Model Context Protocol integration for agent workflows.
Thick Server / Thin Client:
Dual-Mode Access:
Proto definitions available at: proto/sochdb.proto
Generate clients:
# Python
python -m grpc_tools.protoc -I./proto --python_out=. --grpc_python_out=. proto/sochdb.proto
# Node.js
npm install @grpc/grpc-js @grpc/proto-loader
grpc_tools_node_protoc --js_out=import_style=commonjs,binary:. --grpc_out=grpc_js:. proto/sochdb.proto
# Go
protoc --go_out=. --go-grpc_out=. proto/sochdb.proto
# Build
cd sochdb-grpc
cargo build --release
# Run with debug logging
RUST_LOG=debug cargo run -- --port 50051
# Test
cargo test
See CONTRIBUTING.md
Apache-2.0
Current: 0.3.4
What's New in 0.3.4: