Documentation

Offline command-line tools

Most tools work directly with database files. The memory client below requires a REST server.

Choose a tool

Stop the server first for offline tools. The shell, import and tuning tools take an exclusive file lock, except vlite-shell --read-only. That and MCP (by default) open a shared-lock read-only snapshot, so they can run beside other readers but not beside a writer.

Build and install

Requires Rust 1.89 or later:

cargo build --locked --features tools --bins
# Optional Parquet and Arrow IPC readers:
cargo build --locked --features import-formats --bins

tools enables JSON and CSV; import-formats adds Arrow and Parquet. Neither is in the default embedded build. Binaries are written to target/debug/. Each tool supports --help and exits nonzero on errors. For packaged binaries, see installation.

Remote agent memory

Build vlite-memory-cli with the existing HTTP proxy feature: cargo build --locked --features mcp-proxy --bin vlite-memory-cli. It requires an explicitly provisioned memory binding on a running server; it never opens a database or supplies a tenant/provider endpoint.

# Set VLITE_URL (for example http://127.0.0.1:8080) and VLITE_TOKEN in the environment; keep the token off the command line.
vlite-memory-cli --url $env:VLITE_URL --binding notes --token-env VLITE_TOKEN remember --request remember.json
vlite-memory-cli --url $env:VLITE_URL --binding notes --token-env VLITE_TOKEN recall --request recall.json

Required flags are --url, --binding, --token-env and --request FILE|-. Verbs: remember, recall, facts, correct-facts, consolidate, forget, receipt, erasure, resume-erasure. Supply the operation's JSON body, including scope, mutation idempotency key, revisions and policies; semantic validation and authorization belong to the server. Request files use native OS paths and preserve bytes; prefix a file name starting with -- with ./. Stdin must be piped as bytes, not through a text-decoding pipeline. Input must be a UTF-8 JSON object without duplicate keys. Request and received response limits are 8,388,608 bytes; compact stdout including its final LF must also fit that limit. Success validation is generic (a duplicate-free JSON object); the server is authoritative for operation schemas. Tokens must contain 1..4096 visible ASCII bytes (0x21..0x7e), without trimming. The credential is never written to stdout or stderr: credential-bearing successes are refused, not rewritten. Diagnostics are redacted and checked after JSON serialization; if even the fixed fallback contains the credential, stderr is empty. HTTPS is required except for loopback HTTP hosts (localhost, 127.0.0.0/8, or ::1); ambient proxies are explicitly disabled. Docker images intentionally do not ship this client.

Success prints exactly one response JSON line; HTTP 202 pending is success. Errors print one coded JSON line {"error":{"code":"<code>","message":"<message>"}} to stderr, unless credential safety requires silence as above. Exit codes: 0 success; 2 usage/input (including exhausted work budgets); 3 authentication/authorization; 4 conflict/ precondition; 5 server deadline/cancel; 6 transport/storage ambiguity or local response-integrity failure; 1 other. Malformed, duplicate-key, non-object, invalid UTF-8, truncated and oversized responses fail locally with empty stdout, including malformed error bodies; validated remote errors retain their mappings. --timeout-ms accepts 1..5000 (default 5000) and changes only the HTTP timeout, never JSON deadline_ms. There are no automatic retries, paging or job loops. After an ambiguous mutation, explicitly use receipt with the original scope, operation and idempotency key before considering resubmission. The first server slice will refuse a receipt lookup of a remember (409 memory_capability_unavailable; its details.feature is remember_receipt_lookup, which the error line does not carry), and the original remember response carries the complete receipt. Pending erasure status and resumption are explicit erasure and resume-erasure calls. Logical deletion is not secure erasure of backups or external copies.

Interactive or scripted shell

vlite-shell --db example.vlite --create 3
vlite-shell --db example.vlite --read-only --script commands.txt
Get-Content commands.txt | vlite-shell --db example.vlite --read-only

--create N creates a new graph-enabled v5 database and refuses an existing path. Without it, the database must exist. Enter one command per line:

help
header
format
collections
stats
use default
put {"id":1,"vector":[1,0,0],"payload":"first","metadata":{"tag":{"type":"string","value":"blue"}}}
get 1
browse 20
search {"vector":[1,0,0],"k":5,"metric":"squared_l2","filters":[{"op":"eq","field":"tag","value":{"type":"string","value":"blue"}}]}
search {"vector":[1,0,0],"k":5,"ann":true,"ef_search":100}
rebuild
delete 1
verify
backup backup.vlite
compact compacted.vlite
upgrade upgraded.vlite
quit

Local key-value shell commands

vlite-shell --db PATH accepts kv-get, kv-put, kv-delete, kv-list, kv-get-many and kv-batch. Each takes one JSON object through the end of the line, using exactly the local MCP KV request fields and bounds. The required collection is independent of use NAME; it must already exist and have one dimension. The shell never creates a KV collection implicitly.

kv-put {"collection":"default","namespace":"cache","key":"a","value_base64":"AAEC","expected":"absent"}
kv-get {"collection":"default","namespace":"cache","key":"a"}
kv-list {"collection":"default","namespace":"cache","prefix":"","limit":100}
kv-delete {"collection":"default","namespace":"cache","key":"a","expected":"any"}
kv-batch {"collection":"default","operations":[{"op":"put","namespace":"cache","key":"a","value_base64":"AAEC","expected":"absent"},{"op":"delete","namespace":"cache","key":"b"}]}
kv-get-many {"collection":"default","keys":[{"namespace":"cache","key":"a"},{"namespace":"cache","key":"b"}]}

kv-batch takes collection and operations (up to 1,000 put and delete objects, committed all or nothing). kv-get-many takes collection and keys (up to 1,000 {"namespace","key"} objects). The objects are the REST ones, and the output is the REST body: {"results":[...]} for a batch and {"items":[...],"next_index":null} for a read, where a missing or due key is null and not an error. Each command is one line. A failed batch writes nothing; after commit_indeterminate, read the keys back with kv-get-many before deciding anything.

Each successful command prints one JSON object and exits 0 when the script finishes. Failure exits 1 with error: <code>: <message> on stderr; scripts and non-terminal stdin stop at the first error, while terminal sessions print the error and continue. --read-only refuses kv-put, kv-delete and kv-batch (read_only). No retries occur. Output uses base64 values, decimal-string versions/deadlines and explicit null deadlines. A missing/due get is kv_not_found; a failed expected-version check is precondition_failed. An omitted/null put deadline clears TTL; a due deadline succeeds but hides the key immediately. TTL needs v5 (upgrade_required on older files). Writes acknowledge after commit, synced only under full durability. There are no lease commands or server-forwarded KV commands.

Validated, atomic or resumable imports

vlite-import --db new.vlite --create 3 --input rows.jsonl --format jsonl
vlite-import --db new.vlite --input embeddings.csv --format pgvector
vlite-import --db new.vlite --input vectors.parquet --format parquet
vlite-import --db new.vlite --input flat.faiss --format faiss
# Chunked and resumable; rerun with the same input and options:
vlite-import --db new.vlite --input large.jsonl --format jsonl --chunk-size 1000 --job 42

By default, vlite-import reads and validates the whole input, then commits it as one atomic import. Any parse, dimension, non-finite vector, payload, metadata or frame-size error publishes no rows. Errors report row numbers (the first 20 syntax errors) or stable engine error codes.

Supported input schemas

Line limit. A JSONL or COPY line may hold at most 16 MiB (16,777,216 bytes, excluding the line terminator), which fits the largest record the engine accepts. A longer line is rejected like any other bad row, as rejected row N: line exceeds 16777216 bytes, where N is its physical line number (blank and COPY header lines count). Reading goes on, so later bad lines are reported too (the first 20 rejected rows of any kind), and the import fails with rejected_rows=N; no rows published. CSV, pgvector, FAISS, Parquet and Arrow have no line limit and this cap does not apply to them, because their records are not lines: a quoted CSV cell can span lines, FAISS is binary, and Parquet and Arrow use their own readers. Their records are limited only by the engine, which checks them after the record has been read, and a CSV quote that is never closed makes the rest of the file one record, which is read in full.

Search quality and configuration/database comparison

vlite-quality --db example.vlite --k 10 --samples 8 --json
vlite-quality --db example.vlite --m 8 --other-m 32 --other-ef-search 200 --json
vlite-quality --db before.vlite --other-db after.vlite --json

vlite-quality measures ANN recall and latency on a real database, sweeps parameters, analyzes rank overlap and compares two configurations or two files. It also reports the engine's own quality result. Comparisons run the same queries from the primary file, so IDs must mean the same thing in both files; different dimensions fail. Each side is measured against its own exact baseline. Files open one after another, so two configurations of the same path do not conflict.

Index tuning advisor

vlite-tune --db example.vlite --m 8,16,32 --ef-construction 64,128 --ef-search 20,50,100 --k 10 --samples 8 --target-recall 0.95 --json

vlite-tune sweeps up to 256 parameter combinations. It builds deterministic L2 HNSW indexes in memory for the full collection and queries each with the same seeded sample of stored vectors (samples 1–32, k 1–100). It recommends the cheapest configuration that meets the target recall@k, using the cost mean_query_us + memory_weight * component_MiB (--memory-weight, default 1). If none qualifies, the recommendation is null and the exit status is nonzero.

Reports include build time, mean and p95 latency, recall, Jaccard overlap, rank correlation and estimated component bytes (vectors and graph links only, not peak RSS). Stored-vector queries find themselves, which can overstate recall, so validate with production queries. The file is not changed.

MCP server and agent skills

These have their own guides:

MCP opens the database file directly, not through REST. Installing a skill does not start the server or grant write access.

Graph operations

vlite-graph-cli runs one typed property-graph operation per invocation on a graph-enabled file. It needs the json feature (graph is compiled into every build since v0.5.1). Release archives ship it since v0.5.0. The Docker image's API server (vlite-server) has graph; vlite-graph-cli is not in the image, and packages do not include the CLI. To build it from a checkout:

cargo build --locked --features json --bin vlite-graph-cli
# or install it into ~/.cargo/bin from the checkout
cargo install --locked --path . --features json --bin vlite-graph-cli

Usage: vlite-graph-cli --db PATH [--writable] [--explain] COMMAND [REQUEST]. REQUEST is one JSON object; - reads it from stdin (at most 64 MiB) and omitting it means {}. Each command maps to one vlite::property_graph call. query takes one read-only graph query text that translates to exactly one typed read; it adds no other capability.

Command Access Library call
graphs read list_graphs
get-node, get-edge, find-nodes, neighbors, traverse, shortest-path read GraphRef::query (with --explain: GraphRef::explain)
query read GraphRef::query_text (with --explain: GraphRef::explain_text)
init write Database::create (new file only)
create-graph, drop-graph write create_graph, drop_graph (empty graphs only)
batch write GraphMut::write_batch (one atomic frame)
vlite-graph-cli --db kb.vlite --writable init '{"dimensions":3}'
vlite-graph-cli --db kb.vlite --writable create-graph '{"graph":"kb"}'
Get-Content ops.json | vlite-graph-cli --db kb.vlite --writable batch -
vlite-graph-cli --db kb.vlite graphs
vlite-graph-cli --db kb.vlite neighbors '{"graph":"kb","node":{"key":"api"},"direction":"both"}'
vlite-graph-cli --db kb.vlite --explain traverse '{"graph":"kb","start":[{"key":"api"}],"limits":{"max_hops":3}}'
vlite-graph-cli --db kb.vlite query '{"graph":"kb","query":"MATCH (a KEY $k)-[:READS*1..3]->(b:Database) RETURN b LIMIT 20","params":{"k":{"type":"string","value":"api"}}}'

ops.json holds one batch of at most 4,096 operations. They apply in order and commit together or not at all:

{"graph":"kb","ops":[
  {"op":"create_node","key":"api","labels":["Service"],"properties":{"tier":{"type":"integer","value":"1"}}},
  {"op":"create_node","key":"db","labels":["Database"]},
  {"op":"create_edge","key":"api-db","source":"api","relationship":"READS","destination":"db"},
  {"op":"put_vector","collection":"default","id":"7","vector":[1,0,0],"payload":"runbook","metadata":{}},
  {"op":"attach","node":"api","collection":"default","record":"7"}
]}

Batch operations: create_node, upsert_node, patch_node (add_labels, remove_labels, set, unset), delete_node, create_edge, patch_edge, delete_edge, attach, detach, put_vector (Mutation::PutWithMetadata when metadata is given, otherwise Mutation::Put; payload is UTF-8 text) and delete_vector. Nodes are addressed by key, edges by {"id":...} or {"key":...}. expected is "any" (default), "absent" or {"revision":"N"}.

Tests

Tool tests use small fixtures generated in the test: CSV, JSONL, COPY, both FAISS flat metrics and, with import-formats, Arrow and Parquet.

cargo test --locked --features tools --test shell_cli --test import_tools --test tune_cli
cargo test --locked --all-features --test shell_cli --test import_tools --test tune_cli
cargo test --locked --features json --test graph_cli

Contributors validate a full change with:

cargo test --locked --all-targets --all-features
cargo test --locked -p vlite-graph
cargo test --locked --test graph_storage --test graph_compat --test graph_traversal --test graph_maintenance --test graph_recovery
cargo clippy --locked --all-targets --all-features -- -D warnings
cargo fmt --check
docker compose --profile test run --build --rm tests
python3 tests/rest_e2e.py
python3 tests/tls_e2e.py

Browser acceptance tests need Playwright on the Docker host (inside WSL when Docker runs there):

python3 -m pip install -r tests/requirements-dashboard.txt
python3 -m playwright install --with-deps chromium
python3 tests/dashboard_e2e.py

Website and documentation checks live in tests/site_links.py, tests/release_docs.py and tests/content_budget.py. See development and testing for what each suite covers, including the seeded crash-recovery histories.

View or edit this page on GitHub ↗