Your first multimodal dataset
The gRPC examples require the downloadable API definitions and SHRIKEDB_API_DIR setup. This walkthrough adds a tiny product dataset to the server’s default database. It uses reserved example IDs 42, 9001, and 3001; use a disposable database or choose unused IDs before running it.
The dataset contains:
-
KV payloads for product documents,
-
vectors for semantic search,
-
graph edges for relationships,
-
Cypher queries that combine them.
It uses gRPC so the same flow works from a binary or container.
You need grpcurl, jq, and base64 installed for the shell examples.
1. Create A Schema
grpcurl -plaintext \
-import-path "$SHRIKEDB_API_DIR" -proto shrikedb.v2.proto \
-d '{
"schema": {
"id": 42,
"name": "products",
"fields": {
"kind": "string",
"name": "string",
"price": "number"
}
}
}' \
127.0.0.1:50251 shrikedb.v2.ShrikeDbService/CreateSchema
2. Store A Product Payload In KV
The value field is base64 because protobuf JSON encodes bytes as base64.
PutKeyValue writes to the default KV namespace; its schemaId field does
not select a different namespace in this API.
PRODUCT_JSON='{"uid":9001,"kind":"Product","name":"Vintage Leather Jacket","price":180}'
PRODUCT_B64="$(printf '%s' "$PRODUCT_JSON" | base64 -w0)"
grpcurl -plaintext \
-import-path "$SHRIKEDB_API_DIR" -proto shrikedb.v2.proto \
-d "{
\"subjectId\": {\"id\": 0},
\"schemaId\": 42,
\"key\": {\"id\": 9001},
\"value\": \"${PRODUCT_B64}\"
}" \
127.0.0.1:50251 shrikedb.v2.ShrikeDbService/PutKeyValue
Read it back:
grpcurl -plaintext \
-import-path "$SHRIKEDB_API_DIR" -proto shrikedb.v2.proto \
-d '{"subjectId":{"id":0},"key":{"id":9001}}' \
127.0.0.1:50251 shrikedb.v2.ShrikeDbService/GetKeyValue
3. Insert A Vector
grpcurl -plaintext \
-import-path "$SHRIKEDB_API_DIR" -proto shrikedb.v2.proto \
-d '{
"entityId": {"id": 9001},
"indexName": "products_mm_vec",
"vector": [0.12, 0.08, -0.44, 0.91],
"schemaId": 42
}' \
127.0.0.1:50251 shrikedb.v2.ShrikeDbService/InsertVector
Search it:
grpcurl -plaintext \
-import-path "$SHRIKEDB_API_DIR" -proto shrikedb.v2.proto \
-d '{
"indexName": "products_mm_vec",
"queryVector": [0.10, 0.09, -0.40, 0.88],
"k": 5,
"efSearch": 64
}' \
127.0.0.1:50251 shrikedb.v2.ShrikeDbService/VectorSearchPacked
4. Add A Graph Edge In A Transaction
Start a transaction:
TXN_ID="$(
grpcurl -plaintext \
-import-path "$SHRIKEDB_API_DIR" -proto shrikedb.v2.proto \
-d '{"subjectId":{"id":0},"timeoutMs":30000}' \
127.0.0.1:50251 shrikedb.v2.ShrikeDbService/BeginTransaction |
jq -r '.transactionId.id'
)"
Insert an edge from product 9001 to brand 3001:
grpcurl -plaintext \
-import-path "$SHRIKEDB_API_DIR" -proto shrikedb.v2.proto \
-d "{
\"transactionId\": {\"id\":\"${TXN_ID}\"},
\"subject\": {\"id\":9001},
\"predicate\": \"MADE_BY\",
\"object\": {\"id\":3001}
}" \
127.0.0.1:50251 shrikedb.v2.ShrikeDbService/TransactionInsertGraphEdge
Commit:
grpcurl -plaintext \
-import-path "$SHRIKEDB_API_DIR" -proto shrikedb.v2.proto \
-d "{\"transactionId\":{\"id\":\"${TXN_ID}\"}}" \
127.0.0.1:50251 shrikedb.v2.ShrikeDbService/CommitTransaction
5. Query The Graph
grpcurl -plaintext \
-import-path "$SHRIKEDB_API_DIR" -proto shrikedb.v2.proto \
-d '{"query":"MATCH (p)-[:MADE_BY]->(b) RETURN p, b LIMIT 10"}' \
127.0.0.1:50251 shrikedb.v2.ShrikeDbService/ExecuteCypher
6. Combine Vector, Graph, And KV
grpcurl -plaintext \
-import-path "$SHRIKEDB_API_DIR" -proto shrikedb.v2.proto \
-d '{
"query": "CALL vector.knn(\"products_mm_vec\", [0.10, 0.09, -0.40, 0.88], 10, {ef: 64}) YIELD node, score MATCH (node)-[:MADE_BY]->(brand) CALL kv.get(\"default\", node) YIELD value AS product_json RETURN node, brand, score, product_json LIMIT 5"
}' \
127.0.0.1:50251 shrikedb.v2.ShrikeDbService/ExecuteCypher
The vector identifies product 9001; the relationship connects it to brand 3001; the KV lookup retrieves the stored JSON payload. Verify the three stages separately if the combined query is empty.
Verify persistence
Save the returned identifiers and payload. Stop and restart the server using the same data directory, then repeat the KV read, named-vector search, and graph query. See Verify an installation for the full installation check.