Prerequisites
- Rust 1.89+ (stable, edition 2024)
- Cargo (included with Rust)
Build
git clone https://github.com/TyKolt/kremis.git
cd kremis
cargo build --release
cargo test --workspace
First Run
Initialize the database
cargo run -p kremis -- init
Ingest sample data
The repository includes sample signals with 3 entities (Alice, Bob, Kremis) and their relationships.cargo run -p kremis -- ingest -f examples/sample_signals.json -t json
Start the HTTP server
cargo run -p kremis -- server
The server starts on http://localhost:8080 by default.Query the graph
In a separate terminal:# Health check
curl http://localhost:8080/health
# Look up entity 1 (Alice)
curl -X POST http://localhost:8080/query \
-H "Content-Type: application/json" \
-d '{"type": "lookup", "entity_id": 1}'
# Traverse from node 0, depth 3
curl -X POST http://localhost:8080/query \
-H "Content-Type: application/json" \
-d '{"type": "traverse", "node_id": 0, "depth": 3}'
# Get properties of node 0
curl -X POST http://localhost:8080/query \
-H "Content-Type: application/json" \
-d '{"type": "properties", "node_id": 0}'
CLI commands and the HTTP server cannot run simultaneously — redb holds an exclusive lock. Stop the server before using CLI commands like ingest, status, or export.
Docker
docker build -t kremis .
docker run -d -p 8080:8080 -v kremis-data:/data kremis
With configuration:
docker run -d -p 8080:8080 \
-v kremis-data:/data \
-e KREMIS_API_KEY=your-secret \
-e KREMIS_CORS_ORIGINS="https://example.com" \
kremis
Multi-stage build (~136 MB image). Data persists in /data volume. Built-in healthcheck on /health.
Next Steps