zlf reads one JSON request per line on stdin and writes one JSON response per line on stdout.
echo '{"command":"init","path":"./zlf-db"}' | target/release/zlf
| Command | Purpose |
|---|---|
init |
Initialize a database |
add_node, get_node |
Create/read nodes |
add_edge, get_edge, edge_ids |
Create/read/resolve edges |
patch_node_properties, set_node_property, remove_node_property |
Mutate node properties |
patch_edge_properties, set_edge_property, remove_edge_property |
Mutate edge properties |
query |
Execute a Prolog query/directive/rule |
search |
BM25 text search |
put_index_profile, activate_index_profile, list_index_profiles |
Manage profiles |
index_status, wait_indexes |
Observe index lifecycle |
vector_index_status, rebuild_vector_index |
Observe/request optional HNSW publication |
import, export |
JSON graph import/export |
embed |
Generate an embedding when enabled |
config |
Read/write zlf.json configuration |
echo '{"command":"add_node","path":"./zlf-db","labels":["person"],"properties":{"name":"Alice"}}' | target/release/zlf
echo '{"command":"query","path":"./zlf-db","query":"? property(Id, name, Name)."}' | target/release/zlf
echo '{"command":"search","path":"./zlf-db","query":"software engineer"}' | target/release/zlf
Index lifecycle:
{"command":"put_index_profile","path":"./zlf-db","profile":{...}}
{"command":"activate_index_profile","path":"./zlf-db","name":"knowledge","version":1}
{"command":"list_index_profiles","path":"./zlf-db"}
{"command":"index_status","path":"./zlf-db","target":"bm25"}
{"command":"wait_indexes","path":"./zlf-db","targets":["bm25"],"minimum_sequence":1,"timeout_ms":1000}
Vector (optional HNSW):
echo '{"command":"rebuild_vector_index","path":"./zlf-db"}' | target/release/zlf
echo '{"command":"vector_index_status","path":"./zlf-db"}' | target/release/zlf
{"type":"success","data":{}}
{"type":"error","code":"QUERY_FAILED","message":"..."}
query command routes a bare ground unreserved P/3+ fact statement to the FactStore (not to a compiled rule); non-ground heads keep rule semantics.node/edge/... statement in query follows the pre-existing rule-store path; use add_node/add_edge/REPL fact input to write graph structure through the storage writer.