Documentation
Offline command-line tools
Most tools work directly with database files. The memory client below requires a REST server.
Choose a tool
- Shell: inspect records, run searches and perform maintenance.
- Import: validate and load vectors from JSONL, CSV, Parquet, Arrow or FAISS.
- Search quality: measure recall and compare databases or index configurations.
- Index tuning: find HNSW parameters for a target recall.
- MCP and agent skills: connect an agent to a database through a separate stdio server.
- Graph operations: typed reads and atomic writes on graph-enabled files.
- Remote agent memory: authenticated one-shot REST operations.
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
- Search accepts typed filters and the exact metrics
squared_l2,cosineandinner_product. ANN supports L2 and cosine. - JSON arguments run to the end of the line, so strings need no shell quoting.
Lines starting with
#are comments. - A command line may hold at most 16 MiB (16,777,216 bytes, excluding the line
terminator). That covers the largest command, a
putwith 65,536 dimensions of 30 characters each, a 1 MiB payload that needs the most escaping and 64 KiB of metadata, which is about 8.7 MB. A longer line fails withinvalid_input: line exceeds 16777216 byteslike any other command error: scripts and non-terminal stdin stop there, as before.vlite-importapplies the same 16 MiB limit to JSONL and COPY lines (see Supported input schemas). - Scripts and stdin stop at the first error; earlier writes stay committed. The interactive shell prints errors and continues.
browse LIMIT [AFTER_ID]returns 1–1,000 rows in ascending ID order and printsnext_afterfor the next page. Payloads display as lossy UTF-8.--read-onlyblocks put, delete, create and copy-out maintenance; ANN and rebuild change only in-memory indexes. For a shared-lock reader, useDatabase::open_read_onlyorvlite-mcp.
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.
- Imports need format v4. Upgrade older files with
vlite-maintain upgrade.--collection NAMEselects an existing named collection. - One atomic import holds at most 4,095 rows (one slot is reserved for the checkpoint) and must fit the engine's 16 MiB frame budget. The byte precheck is conservative and may reject inputs just below the limit.
- Larger inputs need
--chunk-size 1..4095. All rows are still validated first, but I/O failures or checkpoint conflicts can leave earlier chunks committed. There is no transaction across chunks. --job IDmakes chunked imports resumable. A retry resubmits the last committed chunk with its engine digest, skips earlier chunks, and can replay a finished job without writes. Keep the input, collection, chunk size and job ID unchanged. Earlier skipped chunks cannot be revalidated, and aborted jobs cannot resume.- Empty inputs import zero rows without creating a job. Success prints the job ID, row count (including earlier committed rows on retry) and chunks as JSON.
- The whole input is held in memory; this is not a streaming loader.
- Repeated IDs follow ordered upsert semantics: later rows replace earlier
ones.
--createnever overwrites an existing path.
Supported input schemas
- JSONL: one object per line with
id(u64 JSON number),vector(float array), and optionalpayload(UTF-8 string) andmetadata(typed object). Emit large IDs as exact JSON integers. Unknown fields fail validation. - CSV / pgvector CSV: header
id,vectorplus optionalpayloadandmetadatacolumns, in any order. The vector is a quoted literal such as"[1,2,3]"; metadata is quoted typed JSON. - PostgreSQL COPY text (
--format copy): tab-separatedid, vector literal and optional payload. An optionalCOPY ... FROM stdin;header and\.terminator are recognized. Payloads support\\,\t,\n,\rand\N(empty); other escapes, layouts and SQL dumps are not supported. - Parquet (
import-formats): columnsid(uint64 or nonnegative int64),vector(list, large list or fixed-size list of float32/float64, or a UTF-8 JSON array), and optional UTF-8payloadandmetadata. Null IDs, vectors or elements are rejected; null optional columns are empty. Float64 values convert to f32 and overflow is rejected. Uncompressed and Snappy only. - Arrow IPC (
import-formats): file or stream framing with the Parquet schema. Compressed IPC is not supported. - FAISS flat: native little-endian, 64-bit
write_indexoutput forIxF2(IndexFlatL2) orIxFI(IndexFlatIP). Length, dimension and finiteness are checked; trailing data is rejected. IDs are assigned from zero with empty payload and metadata. Only vectors are imported, so choose L2 or inner product at search time. IVF, PQ, HNSW, IDMap, GPU, transforms, endian conversion and 32-bit layouts are not supported. See FAISS's serializer.
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.
- Recall@k is intersection ÷ exact count. Overlap is intersection ÷ union (Jaccard).
- Rank correlation is the Pearson correlation of rank positions on shared IDs.
Fewer than two shared IDs give
null; the aggregate averages defined values. - Reports use L2.
--jsonprints compact JSON; otherwise output is labeled text.
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 server: one local stdio server with seven read-only tools
and two opt-in write tools. Download a native binary or build
vlite-mcp. - Agent skills: install
vlite-rag,vlite-mcp,vlite-opsandvlite-index-tuningas complete folders in your assistant's skill directory.
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"}.
- Access. Reads use
Database::open_read_only(shared lock), never write, and fail withlockedwhile a writer owns the file. Writes require--writableand take the exclusive lock for one command; they fail withlockedwhile any other handle is open.--writableon a read, or its absence on a write, is ausageerror. - Graph-enabled files only. Files are never converted. Graph commands on a
vector-only file fail with
graphs_not_enabled, andinitrefuses an existing path. Copy a v4/v5 file into a graph-enabled one withvlite-maintain enable-graph SOURCE DESTINATION. Encrypted files are not supported. - Bounded reads. Queries accept
"limits"(fields ofGraphLimits; omitted fields use defaults; values above the ceiling fail withgraph_limit_exceeds_ceilingand are never clamped) and"projection"("all","none"or{"only":[...]}). Every result carriesgraph,view_sequence,complete,truncation,statsandcursor. Pass a returned lowercase-hexcursorwith the same request to continuefind-nodesorneighbors; a write in between fails withgraph_cursor_stale.--explainreturns the normalized query, effective limits, projection and index choices without reading nodes or edges. - Query text.
querytakes{"graph","query","params","limits"};paramsbinds$namevalues and a missing or unused one is an error.RETURN, a*1..Nhop range andLIMITset the projection,max_hopsandmax_output_nodes; output equals the equivalent typed command. Text errors (graph_query_syntax,graph_query_unsupported,graph_query_parameter,graph_query_limit) name the byte offset and occur before the file opens. - Output. Success prints one JSON object on stdout and exits 0. Failure
prints
{"error":{"code":"...","message":"..."}}on stderr and exits 1. Codes includeusage,invalid_request(malformed JSON, unknown or repeated fields, keys or operations, malformed IDs or cursors),invalid_input(values the library rejects, such as invalid keys, labels, query bounds or a cursor from another query), the REST graph codes (for examplegraph_not_found,graph_node_not_found,graph_attached_record),locked,precondition_failedandio_error. IDs, revisions and sequences are decimal strings in output and accepted as strings or JSON integers, so values up to 2^64-1 keep full precision. Counts and limits are numbers. Enumerations use"name"or{"name":{...}}.
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.