cortexdb-client
Typed gRPC client for CortexDB — a
pure-Go, single-file AI memory and knowledge graph database, served as a
sidecar (cortexdb-grpc).
Quick start
Start the sidecar (one binary, one SQLite file):
CORTEXDB_PATH=my.db CORTEXDB_GRPC_TOKEN=s3cret
# listening on 127.0.0.1:47821
Talk to it from Rust:
use ;
async
Services: .knowledge(), .memory(), .graph() (SPARQL/RDF/SHACL/inference/
ontology), .graphrag(), .tools() (generic tool dispatch), .admin().
managed-server feature
With the managed-server feature the crate can resolve (env → PATH → download
from GitHub Releases) and spawn the sidecar itself, authenticated with a fresh
random token:
use Sidecar;
let sidecar = ensure.await?;
let running = sidecar.spawn.await?;
let client = running.client.await?;
Embeddings
The sidecar runs in lexical mode by default. Point it at any OpenAI-compatible embeddings endpoint to enable vector retrieval (e.g. Ollama):
OPENAI_BASE_URL=http://localhost:11434/v1 \
CORTEXDB_EMBED_MODEL=embeddinggemma \
CORTEXDB_EMBED_DIM=768 \
Regenerating the protobuf code
Generated code is committed (src/gen/), so building this crate never needs
protoc. To regenerate after a proto change: cargo run -p gen from
clients/rust/.