Neumann uses a SQL-inspired query language extended with graph, vector, blob, vault, cache, and chain commands. All commands are case-insensitive.
SELECT [DISTINCT] columns
FROM table [alias]
[JOIN table ON condition | USING (columns)]
[WHERE condition]
[GROUP BY columns]
[HAVING condition]
[ORDER BY columns [ASC|DESC] [NULLS FIRST|LAST]]
[LIMIT n]
[OFFSET n]Columns can be *, expressions, or expr AS alias. Supports subqueries in FROM
and WHERE clauses.
Join types: INNER, LEFT, RIGHT, FULL, CROSS, NATURAL.
SELECT u.name, o.total
FROM users u
LEFT JOIN orders o ON u.id = o.user_id
WHERE o.total > 100
ORDER BY o.total DESC
LIMIT 10INSERT INTO table [(columns)] VALUES (values), ...
INSERT INTO table [(columns)] SELECT ...INSERT INTO users (id, name, age) VALUES (1, 'Alice', 30)
INSERT INTO users VALUES (2, 'Bob', 25), (3, 'Carol', 28)UPDATE table SET column = value, ... [WHERE condition]UPDATE users SET age = 31 WHERE name = 'Alice'DELETE FROM table [WHERE condition]DELETE FROM users WHERE age < 18CREATE TABLE [IF NOT EXISTS] name (
column type [constraints],
...
[table_constraints]
)Column types: INT, INTEGER, BIGINT, SMALLINT, FLOAT, DOUBLE, REAL,
DECIMAL(p,s), NUMERIC(p,s), VARCHAR(n), CHAR(n), TEXT, BOOLEAN, DATE,
TIME, TIMESTAMP, BLOB.
Column constraints: NOT NULL, NULL, UNIQUE, PRIMARY KEY,
DEFAULT expr, CHECK(expr), REFERENCES table(column) [ON DELETE|UPDATE action].
Table constraints: PRIMARY KEY (columns), UNIQUE (columns),
FOREIGN KEY (columns) REFERENCES table(column), CHECK(expr).
Referential actions: CASCADE, RESTRICT, SET NULL, SET DEFAULT, NO ACTION.
CREATE TABLE orders (
id INT PRIMARY KEY,
user_id INT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
total FLOAT DEFAULT 0.0,
created TIMESTAMP,
UNIQUE (user_id, created)
)DROP TABLE [IF EXISTS] name [CASCADE]DROP TABLE IF EXISTS orders CASCADECREATE [UNIQUE] INDEX [IF NOT EXISTS] name ON table (columns)CREATE INDEX idx_users_name ON users (name)
CREATE UNIQUE INDEX idx_email ON users (email)DROP INDEX [IF EXISTS] name
DROP INDEX ON table(column)DROP INDEX idx_users_name
DROP INDEX ON users(email)SHOW TABLESLists all relational tables.
DESCRIBE TABLE name
DESCRIBE NODE label
DESCRIBE EDGE typeShows the schema of a table, node label, or edge type.
DESCRIBE TABLE users
DESCRIBE NODE person
DESCRIBE EDGE reports_toNODE CREATE label { key: value, ... }Creates a node with the given label and properties.
NODE CREATE person { name: 'Alice', role: 'Engineer', team: 'Platform' }NODE GET idRetrieves a node by its ID.
NODE GET 'abc-123'NODE DELETE idDeletes a node by its ID.
NODE DELETE 'abc-123'NODE LIST [label] [LIMIT n] [OFFSET m]Lists nodes, optionally filtered by label.
NODE LIST person LIMIT 10
NODE LISTEDGE CREATE from_id -> to_id : edge_type [{ key: value, ... }]Creates a directed edge between two nodes.
EDGE CREATE 'alice-id' -> 'bob-id' : reports_to { since: '2024-01' }EDGE GET idRetrieves an edge by its ID.
EDGE DELETE idDeletes an edge by its ID.
EDGE LIST [type] [LIMIT n] [OFFSET m]Lists edges, optionally filtered by type.
EDGE LIST reports_to LIMIT 20NEIGHBORS id [OUTGOING|INCOMING|BOTH] [: edge_type]
[BY SIMILARITY [vector] LIMIT n]Finds neighbors of a node. The optional BY SIMILARITY clause enables cross-engine
queries that combine graph traversal with vector similarity.
NEIGHBORS 'alice-id' OUTGOING : reports_to
NEIGHBORS 'node-1' BOTH BY SIMILARITY [0.1, 0.2, 0.3] LIMIT 5PATH [SHORTEST|ALL|WEIGHTED|ALL_WEIGHTED|VARIABLE] from_id TO to_id
[MAX_DEPTH n] [MIN_DEPTH n] [WEIGHT property]Finds paths between two nodes.
PATH SHORTEST 'alice-id' TO 'ceo-id'
PATH WEIGHTED 'a' TO 'b' WEIGHT cost MAX_DEPTH 5
PATH ALL 'start' TO 'end' MIN_DEPTH 2 MAX_DEPTH 4PAGERANK [DAMPING d] [TOLERANCE t] [MAX_ITERATIONS n]
[DIRECTION OUTGOING|INCOMING|BOTH] [EDGE_TYPE type]Computes PageRank scores for all nodes.
PAGERANK DAMPING 0.85 MAX_ITERATIONS 100
PAGERANK EDGE_TYPE collaboratesBETWEENNESS [SAMPLING_RATIO r]
[DIRECTION OUTGOING|INCOMING|BOTH] [EDGE_TYPE type]Computes betweenness centrality for all nodes.
BETWEENNESS SAMPLING_RATIO 0.5CLOSENESS [DIRECTION OUTGOING|INCOMING|BOTH] [EDGE_TYPE type]Computes closeness centrality for all nodes.
EIGENVECTOR [MAX_ITERATIONS n] [TOLERANCE t]
[DIRECTION OUTGOING|INCOMING|BOTH] [EDGE_TYPE type]Computes eigenvector centrality for all nodes.
LOUVAIN [RESOLUTION r] [MAX_PASSES n]
[DIRECTION OUTGOING|INCOMING|BOTH] [EDGE_TYPE type]Detects communities using the Louvain algorithm.
LOUVAIN RESOLUTION 1.0 MAX_PASSES 10LABEL_PROPAGATION [MAX_ITERATIONS n]
[DIRECTION OUTGOING|INCOMING|BOTH] [EDGE_TYPE type]Detects communities using label propagation.
GRAPH CONSTRAINT CREATE name ON NODE|EDGE [(label)] property UNIQUE|EXISTS|TYPE 'type'Creates a property constraint on nodes or edges.
GRAPH CONSTRAINT CREATE unique_email ON NODE (person) email UNIQUE
GRAPH CONSTRAINT CREATE requires_name ON NODE name EXISTSGRAPH CONSTRAINT DROP nameGRAPH CONSTRAINT LISTLists all graph constraints.
GRAPH CONSTRAINT GET nameGRAPH INDEX CREATE NODE PROPERTY property
GRAPH INDEX CREATE EDGE PROPERTY property
GRAPH INDEX CREATE LABEL
GRAPH INDEX CREATE EDGE_TYPECreates a graph property or label index.
GRAPH INDEX DROP NODE property
GRAPH INDEX DROP EDGE propertyGRAPH INDEX SHOW NODE
GRAPH INDEX SHOW EDGEGRAPH AGGREGATE COUNT NODES [label]
GRAPH AGGREGATE COUNT EDGES [type]GRAPH AGGREGATE COUNT NODES person
GRAPH AGGREGATE COUNT EDGES reports_toGRAPH AGGREGATE SUM|AVG|MIN|MAX|COUNT NODE property [label] [WHERE condition]
GRAPH AGGREGATE SUM|AVG|MIN|MAX|COUNT EDGE property [type] [WHERE condition]GRAPH AGGREGATE AVG NODE age person
GRAPH AGGREGATE SUM EDGE weight collaborates WHERE weight > 0.5GRAPH PATTERN MATCH (pattern) [LIMIT n]
GRAPH PATTERN COUNT (pattern)
GRAPH PATTERN EXISTS (pattern)Matches structural patterns in the graph.
GRAPH PATTERN MATCH (a:person)-[:reports_to]->(b:person) LIMIT 10
GRAPH PATTERN EXISTS (a:person)-[:mentors]->(b:person)GRAPH BATCH CREATE NODES [(label { props }), ...]GRAPH BATCH CREATE EDGES [(from -> to : type { props }), ...]GRAPH BATCH DELETE NODES [id1, id2, ...]GRAPH BATCH DELETE EDGES [id1, id2, ...]GRAPH BATCH UPDATE NODES [(id { props }), ...]EMBED STORE key [vector] [IN collection]Stores a vector embedding with an associated key.
EMBED STORE 'doc1' [0.1, 0.2, 0.3, 0.4]
EMBED STORE 'doc2' [0.5, 0.6, 0.7, 0.8] IN my_collectionEMBED GET key [IN collection]Retrieves a stored embedding.
EMBED GET 'doc1'EMBED DELETE key [IN collection]Deletes a stored embedding.
EMBED BUILD INDEX [IN collection]Builds or rebuilds the HNSW index for similarity search.
EMBED BATCH [('key1', [v1, v2, ...]), ('key2', [v1, v2, ...])] [IN collection]Stores multiple embeddings in a single operation.
EMBED BATCH [('doc1', [0.1, 0.2]), ('doc2', [0.3, 0.4])]SIMILAR key|[vector] [LIMIT n] [METRIC COSINE|EUCLIDEAN|DOT_PRODUCT]
[CONNECTED TO node_id] [IN collection] [WHERE condition]Finds similar embeddings by key or vector. The optional CONNECTED TO clause
combines vector similarity with graph connectivity for cross-engine queries.
SIMILAR 'doc1' LIMIT 5
SIMILAR [0.1, 0.2, 0.3] LIMIT 10 METRIC COSINE
SIMILAR [0.1, 0.2, 0.3] LIMIT 5 CONNECTED TO 'alice-id'
SIMILAR 'doc1' LIMIT 10 IN my_collection WHERE score > 0.8SHOW EMBEDDINGS [LIMIT n]Lists stored embeddings.
SHOW VECTOR INDEXShows information about the HNSW index.
COUNT EMBEDDINGSReturns the number of stored embeddings.
ENTITY CREATE key { properties } [EMBEDDING [vector]]Creates a unified entity with optional embedding. A unified entity spans all engines: it is stored as relational data, as a graph node, and optionally as a vector embedding.
ENTITY CREATE 'alice' { name: 'Alice', role: 'Engineer' } EMBEDDING [0.1, 0.2, 0.3]ENTITY GET keyRetrieves a unified entity with all its data across engines.
ENTITY UPDATE key { properties } [EMBEDDING [vector]]Updates an existing unified entity.
ENTITY UPDATE 'alice' { role: 'Senior Engineer' } EMBEDDING [0.15, 0.25, 0.35]ENTITY DELETE keyDeletes a unified entity from all engines.
ENTITY CONNECT from_key -> to_key : edge_typeCreates a relationship between two unified entities.
ENTITY CONNECT 'alice' -> 'bob' : reports_toENTITY BATCH CREATE [{ key: 'k1', props... }, { key: 'k2', props... }]Creates multiple unified entities in a single operation.
FIND NODE [label] [WHERE condition] [LIMIT n]
FIND EDGE [type] [WHERE condition] [LIMIT n]
FIND ROWS FROM table [WHERE condition] [LIMIT n]
FIND PATH from_label -[edge_type]-> to_label [WHERE condition] [LIMIT n]Cross-engine search that queries across relational, graph, and vector engines.
FIND NODE person WHERE name = 'Alice'
FIND EDGE reports_to LIMIT 10
FIND ROWS FROM users WHERE age > 25
FIND PATH person -[reports_to]-> person LIMIT 5VAULT SET key valueStores an encrypted secret.
VAULT SET 'api_key' 'sk-abc123'VAULT GET keyRetrieves a decrypted secret (requires appropriate access).
VAULT GET 'api_key'VAULT DELETE keyDeletes a secret.
VAULT LIST [pattern]Lists secrets, optionally filtered by pattern.
VAULT LIST
VAULT LIST 'api_*'VAULT ROTATE key new_valueRotates a secret to a new value while maintaining the same key.
VAULT ROTATE 'api_key' 'sk-new456'VAULT GRANT entity ON keyGrants an entity access to a secret.
VAULT GRANT 'alice' ON 'api_key'VAULT REVOKE entity ON keyRevokes an entity's access to a secret.
VAULT REVOKE 'bob' ON 'api_key'CACHE INITInitializes the LLM response cache.
CACHE STATSShows cache hit/miss statistics.
CACHE CLEARClears all cache entries.
CACHE EVICT [n]Evicts the least recently used entries. If n is provided, evicts that many.
CACHE GET keyRetrieves a cached response by exact key.
CACHE GET 'what is machine learning?'CACHE PUT key valueStores a response in the cache.
CACHE PUT 'what is ML?' 'Machine learning is...'CACHE SEMANTIC GET query [THRESHOLD n]Performs a semantic similarity lookup in the cache. Returns the closest matching cached response if it exceeds the similarity threshold.
CACHE SEMANTIC GET 'explain machine learning' THRESHOLD 0.85CACHE SEMANTIC PUT query response EMBEDDING [vector]Stores a response with its embedding for semantic matching.
CACHE SEMANTIC PUT 'what is ML?' 'Machine learning is...' EMBEDDING [0.1, 0.2, 0.3]BLOB INITInitializes the blob storage engine.
BLOB PUT filename [DATA value | FROM path]
[TYPE content_type] [BY creator] [LINK entity, ...] [TAG tag, ...]Uploads a blob with optional metadata.
BLOB PUT 'report.pdf' FROM '/tmp/report.pdf' TYPE 'application/pdf' TAG 'quarterly'
BLOB PUT 'config.json' DATA '{"key": "value"}' BY 'admin'BLOB GET artifact_id [TO path]Downloads a blob. If TO is specified, writes to the given file path.
BLOB GET 'art-123'
BLOB GET 'art-123' TO '/tmp/download.pdf'BLOB DELETE artifact_idDeletes a blob.
BLOB INFO artifact_idShows metadata for a blob (size, checksum, creation date, tags, links).
BLOB LINK artifact_id TO entityLinks a blob to an entity.
BLOB LINK 'art-123' TO 'alice'BLOB UNLINK artifact_id FROM entityRemoves a link between a blob and an entity.
BLOB LINKS artifact_idLists all entities linked to a blob.
BLOB TAG artifact_id tagAdds a tag to a blob.
BLOB TAG 'art-123' 'important'BLOB UNTAG artifact_id tagRemoves a tag from a blob.
BLOB VERIFY artifact_idVerifies the integrity of a blob by checking its checksum.
BLOB GC [FULL]Runs garbage collection on blob storage. FULL performs a thorough sweep.
BLOB REPAIRRepairs blob storage by fixing inconsistencies.
BLOB STATSShows blob storage statistics (total count, size, etc.).
BLOB META SET artifact_id key valueSets a custom metadata key-value pair on a blob.
BLOB META SET 'art-123' 'department' 'engineering'BLOB META GET artifact_id keyGets a custom metadata value from a blob.
BLOBS [pattern]Lists all blobs, optionally filtered by filename pattern.
BLOBS FOR entityLists blobs linked to a specific entity.
BLOBS FOR 'alice'BLOBS BY TAG tagLists blobs with a specific tag.
BLOBS BY TAG 'quarterly'BLOBS WHERE TYPE = content_typeLists blobs with a specific content type.
BLOBS WHERE TYPE = 'application/pdf'BLOBS SIMILAR TO artifact_id [LIMIT n]Finds blobs similar to a given blob.
CHECKPOINT [name]Creates a named checkpoint (snapshot) of the current state.
CHECKPOINT 'before-migration'
CHECKPOINTCHECKPOINTS [LIMIT n]Lists all available checkpoints.
ROLLBACK TO checkpoint_idRestores the database to a previous checkpoint.
ROLLBACK TO 'before-migration'The chain subsystem provides a tensor-native blockchain with Raft consensus.
BEGIN CHAIN TRANSACTIONStarts a new chain transaction. All subsequent mutations are buffered until commit.
COMMIT CHAINCommits the current chain transaction, appending a new block.
ROLLBACK CHAIN TO heightRolls back the chain to a specific block height.
CHAIN HEIGHTReturns the current chain height (number of blocks).
CHAIN TIPReturns the most recent block.
CHAIN BLOCK heightRetrieves a block at the given height.
CHAIN BLOCK 42CHAIN VERIFYVerifies the integrity of the entire chain.
CHAIN HISTORY keyGets the history of changes for a specific key across all blocks.
CHAIN HISTORY 'users/alice'CHAIN SIMILAR [embedding] [LIMIT n]Searches the chain by embedding similarity.
CHAIN SIMILAR [0.1, 0.2, 0.3] LIMIT 5CHAIN DRIFT FROM height TO heightComputes drift metrics between two chain heights.
CHAIN DRIFT FROM 10 TO 50SHOW CODEBOOK GLOBALShows the global codebook used for tensor compression.
SHOW CODEBOOK LOCAL domainShows the local codebook for a specific domain.
SHOW CODEBOOK LOCAL 'embeddings'ANALYZE CODEBOOK TRANSITIONSAnalyzes transitions between codebook states.
CLUSTER CONNECT addressConnects to a cluster node.
CLUSTER CONNECT 'node2@192.168.1.10:7000'CLUSTER DISCONNECTDisconnects from the cluster.
CLUSTER STATUSShows the current cluster status (membership, leader, term).
CLUSTER NODESLists all cluster nodes and their states.
CLUSTER LEADERShows the current cluster leader.
Neumann includes experimental support for Cypher-style graph queries.
[OPTIONAL] MATCH pattern [WHERE condition]
RETURN items [ORDER BY items] [SKIP n] [LIMIT n]Pattern matching query with Cypher syntax.
MATCH (p:Person)-[:REPORTS_TO]->(m:Person)
RETURN p.name, m.name
MATCH (a:Person)-[:KNOWS*1..3]->(b:Person)
WHERE a.name = 'Alice'
RETURN b.name, COUNT(*) AS depth
ORDER BY depth
LIMIT 10Relationship patterns: -[r:TYPE]-> (outgoing), <-[r:TYPE]- (incoming),
-[r:TYPE]- (undirected). Variable-length: -[*1..5]->.
CREATE (pattern)Creates nodes and relationships.
CREATE (p:Person { name: 'Dave', role: 'Designer' })
CREATE (a)-[:KNOWS]->(b)[DETACH] DELETE variablesDeletes nodes or relationships. DETACH DELETE also removes all relationships.
MERGE (pattern) [ON CREATE SET ...] [ON MATCH SET ...]Upsert: matches an existing pattern or creates it.
MERGE (p:Person { name: 'Alice' })
ON CREATE SET p.created = '2024-01-01'
ON MATCH SET p.updated = '2024-06-01'These commands are available in the interactive shell but are not part of the query language.
| Command | Description |
|---|---|
help |
Show available commands |
exit / quit |
Exit the shell |
clear |
Clear the screen |
tables |
Alias for SHOW TABLES |
save 'path' |
Save data to binary file |
load 'path' |
Load data from binary file |
Start the shell with WAL (write-ahead log) for durability:
neumann --wal-dir ./data