CypherService
OpenCypher-compatible query execution service. Each call runs one statement that commits on its own. Interactive transactions run on a session (coordinode.v1.session.SessionService), whose one stream keeps a transaction's commands in the order they were sent.
Proto source
Transport
All methods are available via:
- gRPC on port 7080 — native high-performance API
- REST/JSON on port 7081 — HTTP/JSON transcoding via embedded structured-proxy
Query Parameters (REST)
Named parameters are passed in the parameters map. Each value is a JSON object with a single key matching the PropertyValue proto field name:
{
"query": "MATCH (n:Concept {name: $name}) RETURN n",
"parameters": {
"name": { "stringValue": "machine learning" },
"limit": { "intValue": "10" },
"threshold": { "floatValue": 0.4 },
"active": { "boolValue": true },
"question_vector": { "vectorValue": { "values": [0.1, 0.2, 0.3] } },
"tags": { "listValue": { "values": [{"stringValue": "ml"}, {"stringValue": "ai"}] } }
}
}Available parameter types:
| JSON key | Proto field | Example |
|---|---|---|
stringValue | string | { "stringValue": "alice" } |
intValue | int64 | { "intValue": "42" } |
floatValue | double | { "floatValue": 0.95 } |
boolValue | bool | { "boolValue": true } |
vectorValue | Vector | { "vectorValue": { "values": [0.1, 0.2] } } |
listValue | PropertyList | { "listValue": { "values": [...] } } |
bytesValue | bytes | { "bytesValue": "<base64>" } |
Vector parameters: use
vectorValue, notlistValue.vectorValuemaps to the dedicatedVectorproto type and enables vector index pushdown in the query planner.
Methods
ExecuteCypher
Execute an OpenCypher query and return results.
HTTP: POST /v1/query/cypher
Request: ExecuteCypherRequest
| Field | Type | Description |
|---|---|---|
query | string | OpenCypher query string. |
parameters | map<string, PropertyValue> | Named query parameters bound at execution time. |
read_preference | ReadPreference | Which cluster node may serve this read. UNSPECIFIED takes the server's configured default, PRIMARY (leader-only reads) unless the operator set another. Use SECONDARY_PREFERRED for read scale-out in 3-node CE cluster. A value the server does not know is rejected with INVALID_ARGUMENT. |
read_concern | ReadConcern | Data consistency guarantee for this read. An omitted message or an UNSPECIFIED level takes the server's configured default, LOCAL (whatever this node has applied) unless the operator set another. Use MAJORITY for reads that must not see rolled-back data. Use LINEARIZABLE for strictest freshness (leader only, adds ~1 RTT). A level the server does not know is rejected with INVALID_ARGUMENT. |
write_concern | WriteConcern | Durability guarantee for write statements (CREATE / MERGE / SET / DELETE). Omitted takes the server's configured default; that is MAJORITY with the write journaled on each counted member unless the operator set another. Present with w unset means MAJORITY. Ask for a weaker concern explicitly, per request (acks: 1, acks: 0, journal: MEMORY), for writes that may be lost with their leader. Causal statements (a read concern with after_ts or after_position) require write_concern MAJORITY. The server rejects writes with lower durability there because a non-majority write may never be replicated: if the leader crashes before drain, its receipt becomes a dangling causal dependency that a follower read can never satisfy. Read-only queries ignore this field. |
vector_consistency | VectorConsistency | Vector consistency of this statement, below a vector_consistency hint in its query. UNSPECIFIED leaves it to the server: the mode the query's read consistency implies. A node passing a session's statement to the leader carries the session's setting here. |
vector_build_wait_ms | uint32 | How long this statement waits for a vector index still being built, in milliseconds, below a vector_build_wait hint in its query. Absent takes the server's vector_build_wait_ms; 0 refuses a building index at once. |
query_memory_limit_mb | uint32 | Memory limit of this statement, in MiB: what its operators, access paths and buffered results may hold at once. Absent takes the server's query_memory_limit_mb. Zero or a value past the administrative ceiling (4096 MiB) is rejected with INVALID_ARGUMENT. A statement that needs more fails with RESOURCE_EXHAUSTED, reason EXCEEDS_MEMORY_BUDGET, and returns no partial result. A node passing a session's statement to the leader carries the session's setting here. The statement's deadline is the call's gRPC deadline. |
operation | OperationRef | The client operation this statement carries out. Its writes take effect at most once however the request is retried: a retry of a statement that already took effect runs nothing and is refused with FAILED_PRECONDITION, reason OPERATION_SETTLED. Absent runs the statement unbound. |
Response: ExecuteCypherResponse
| Field | Type | Description |
|---|---|---|
columns | string[] | — |
rows | Row[] | — |
stats | QueryStats | — |
ExplainCypher
Explain an OpenCypher query plan without executing.
HTTP: POST /v1/query/cypher/explain
Request: ExplainCypherRequest
| Field | Type | Description |
|---|---|---|
query | string | — |
parameters | map<string, PropertyValue> | — |
Response: ExplainCypherResponse
| Field | Type | Description |
|---|---|---|
plan | QueryPlan | — |
Types
CausalReceipt
What a completed statement tells its caller for later causal reads. A causal session keeps the largest operation_time it has received and passes it as ReadConcern.after_ts.
| Field | Type | Description |
|---|---|---|
operation_time | uint64 | For a write, the commit timestamp of its own writes; for a read, the timestamp its view was taken at: every commit at or below it that was visible to the read. HLC microseconds. Zero when the statement has none: a write answered before it committed (a volatile journal level, or acks: 0), which gives no causal dependency to wait for. |
position | HistoryPosition | Where the write's own entry is in its history's log. Absent for a read, and outside a replicated group. |
ExecuteCypherRequest
| Field | Type | Description |
|---|---|---|
query | string | OpenCypher query string. |
parameters | map<string, PropertyValue> | Named query parameters bound at execution time. |
read_preference | ReadPreference | Which cluster node may serve this read. UNSPECIFIED takes the server's configured default, PRIMARY (leader-only reads) unless the operator set another. Use SECONDARY_PREFERRED for read scale-out in 3-node CE cluster. A value the server does not know is rejected with INVALID_ARGUMENT. |
read_concern | ReadConcern | Data consistency guarantee for this read. An omitted message or an UNSPECIFIED level takes the server's configured default, LOCAL (whatever this node has applied) unless the operator set another. Use MAJORITY for reads that must not see rolled-back data. Use LINEARIZABLE for strictest freshness (leader only, adds ~1 RTT). A level the server does not know is rejected with INVALID_ARGUMENT. |
write_concern | WriteConcern | Durability guarantee for write statements (CREATE / MERGE / SET / DELETE). Omitted takes the server's configured default; that is MAJORITY with the write journaled on each counted member unless the operator set another. Present with w unset means MAJORITY. Ask for a weaker concern explicitly, per request (acks: 1, acks: 0, journal: MEMORY), for writes that may be lost with their leader. Causal statements (a read concern with after_ts or after_position) require write_concern MAJORITY. The server rejects writes with lower durability there because a non-majority write may never be replicated: if the leader crashes before drain, its receipt becomes a dangling causal dependency that a follower read can never satisfy. Read-only queries ignore this field. |
vector_consistency | VectorConsistency | Vector consistency of this statement, below a vector_consistency hint in its query. UNSPECIFIED leaves it to the server: the mode the query's read consistency implies. A node passing a session's statement to the leader carries the session's setting here. |
vector_build_wait_ms | uint32 | How long this statement waits for a vector index still being built, in milliseconds, below a vector_build_wait hint in its query. Absent takes the server's vector_build_wait_ms; 0 refuses a building index at once. |
query_memory_limit_mb | uint32 | Memory limit of this statement, in MiB: what its operators, access paths and buffered results may hold at once. Absent takes the server's query_memory_limit_mb. Zero or a value past the administrative ceiling (4096 MiB) is rejected with INVALID_ARGUMENT. A statement that needs more fails with RESOURCE_EXHAUSTED, reason EXCEEDS_MEMORY_BUDGET, and returns no partial result. A node passing a session's statement to the leader carries the session's setting here. The statement's deadline is the call's gRPC deadline. |
operation | OperationRef | The client operation this statement carries out. Its writes take effect at most once however the request is retried: a retry of a statement that already took effect runs nothing and is refused with FAILED_PRECONDITION, reason OPERATION_SETTLED. Absent runs the statement unbound. |
ExecuteCypherResponse
| Field | Type | Description |
|---|---|---|
columns | string[] | — |
rows | Row[] | — |
stats | QueryStats | — |
ExplainCypherRequest
| Field | Type | Description |
|---|---|---|
query | string | — |
parameters | map<string, PropertyValue> | — |
ExplainCypherResponse
| Field | Type | Description |
|---|---|---|
plan | QueryPlan | — |
HistoryId
The consensus history a log position counts entries of: one group of one deployment. Positions of different histories are not comparable, and a deployment formed anew is a different history even for the same group.
| Field | Type | Description |
|---|---|---|
deployment | bytes | The deployment's identity, 16 bytes, as the serving member reports it. |
group | uint64 | The group within the deployment. |
HistoryPosition
A position in one history's log.
| Field | Type | Description |
|---|---|---|
history | HistoryId | The history index counts entries of. |
index | uint64 | The log index. |
MultiVector
An ordered set of equal-width vectors representing one item, as produced by late-interaction retrieval models (ColBERT v2, MaxSim) where a document is several token-level embeddings rather than one pooled vector.
Every row carries the same number of dimensions; the sender enforces that invariant, so a receiver may read rows[0] for the width.
| Field | Type | Description |
|---|---|---|
rows | Vector[] | — |
OperationRef
A reference to one client operation: what a client persists before sending a write and sends again with every retry of it, on any connection and to any member.
| Field | Type | Description |
|---|---|---|
issuer | bytes | The logical client: 16 bytes the client chooses once and keeps across its restarts (a random value, or a digest of a stable application identity). Independent clients use different issuers; a connection, session or server is not an issuer. |
incarnation | uint64 | The issuer's incarnation the number belongs to, from EnrollIssuerResponse. |
sequence | uint64 | The operation's number within the incarnation, allocated by the client: starting at EnrollIssuerResponse.next_sequence, each new write takes the next number, and a retry of a write keeps its number. Numbers are an identity, not an execution order: writes with different numbers may run concurrently and complete in any order. |
deployment | bytes | The deployment that enrolled the incarnation, 16 bytes, from EnrollIssuerResponse.deployment. A server of another deployment refuses the reference with INVALID_ARGUMENT, reason FOREIGN_OPERATION, rather than admit it as a new operation. |
Path
A graph path: the alternating node/relationship sequence produced by shortestPath(...) and by a variable-length MATCH p = (a)-[*]->(b).
rels has exactly one fewer entry than nodes on a non-empty path, and the n-th hop connects nodes[n] to nodes[n+1]. An empty path (a single node, zero hops) carries one node and no relationships.
| Field | Type | Description |
|---|---|---|
nodes | uint64[] | Node ids along the path, start to end. |
rels | PathRel[] | Relationship hops, in the same order. |
PathRel
One relationship hop inside a Path: its type and endpoint node ids. Relationship properties are not carried; fetch them by endpoint pair when they are needed.
| Field | Type | Description |
|---|---|---|
edge_type | string | — |
source | uint64 | — |
target | uint64 | — |
QueryPlan
| Field | Type | Description |
|---|---|---|
operator | string | — |
details | map<string, string> | — |
children | QueryPlan[] | — |
estimated_rows | double | — |
QueryStats
| Field | Type | Description |
|---|---|---|
nodes_created | int64 | — |
nodes_deleted | int64 | — |
edges_created | int64 | — |
edges_deleted | int64 | — |
properties_set | int64 | — |
execution_time_ms | int64 | — |
receipt | CausalReceipt | The statement's causal receipt: what a causal session folds into the after_ts (and, for a write, after_position) of its next statement. |
served_by_leader | bool | True when the read was served by the Raft leader. False for follower reads (read_preference = SECONDARY or NEAREST). |
commit_ts | uint64 | The HLC timestamp this statement's writes landed at, for a statement that committed on its own. Zero for a read, and for a statement inside an interactive transaction, whose timestamp belongs to the commit that ends it (coordinode.v1.session.Committed.commit_ts). This is the version of what the statement wrote: the same number Node.version reports and a session Commit's expect is stated against. A client that writes and then means to write again conditionally already holds what to state, with no read in between. |
read_as_of_ts | uint64 | Set by a member that does not run the version its group runs and so is read-only: the commit timestamp of the last entry it applied, which this read reflects and nothing after. Zero for a read served by a member that runs its group's version. A read that must be current is refused by such a member instead (FAILED_PRECONDITION, reason MEMBER_READ_ONLY). |
ReadConcern
Read concern configuration.
| Field | Type | Description |
|---|---|---|
level | ReadConcernLevel | Consistency level for this read. UNSPECIFIED defaults to LOCAL. |
after_ts | uint64 | Causal lower bound (afterClusterTime): the read is taken at a timestamp at or after this one, where every commit at or below it is applied. Set to the largest CausalReceipt.operation_time the session has received, from writes and reads alike, for read-your-writes and monotonic reads. HLC microseconds; 0 = no bound. Valid with level MAJORITY or SNAPSHOT (without at_timestamp); LOCAL or LINEARIZABLE with a causal bound is rejected with FAILED_PRECONDITION. A member that cannot meet the bound yet refuses the read with UNAVAILABLE, reason READ_NOT_READY, unless wait_ms lets it wait; it never answers from an earlier point. |
after_position | HistoryPosition | Causal position: the read is served only where this history has applied the entry, typically a write's CausalReceipt.position. A position of another history than the serving member's (another deployment or group, or a standalone server, which has no log) is rejected with FAILED_PRECONDITION. Same rules as after_ts otherwise. |
wait_ms | uint32 | How long, in milliseconds, the read may wait for a causal bound the serving member does not meet yet. 0 = no waiting: the read is refused as not ready at once. The wait never lowers the bound: when it runs out the read is refused the same way. It lasts no longer than the call: the call's deadline ends it with DEADLINE_EXCEEDED, reason QUERY_DEADLINE_EXCEEDED, and cancelling the call or the session statement with CANCELLED, reason QUERY_CANCELLED. The server sets no limit of its own on it. A waiting read holds one of the member's command places, so a member out of them refuses a further command before it runs with RESOURCE_EXHAUSTED, reason MEMBER_BUSY. |
at_timestamp | uint64 | Snapshot pin: read the database as of this HLC timestamp (microseconds since Unix epoch, leader-assigned). Only valid with level = SNAPSHOT. Setting this with any other level returns FAILED_PRECONDITION. 0 = no pin (latest snapshot of the chosen level applies). Typical use: time-travel reads ("what did this query return at 2026-05-15 12:00:00?"). The timestamp must be within the MVCC retention window; older snapshots are GC'd. Reads beyond retention return UNAVAILABLE. Distinct from after_ts: after_ts is a lower bound (any eligible view at or after it), at_timestamp is a pin (read exactly this version). The two are mutually exclusive. |
Row
| Field | Type | Description |
|---|---|---|
values | PropertyValue[] | — |
Timestamp
An instant on the time axis of a TIMESTAMP property.
| Field | Type | Description |
|---|---|---|
unix_micros | int64 | Microseconds since the Unix epoch (1970-01-01T00:00:00Z), signed: an instant before the epoch is negative. Microseconds are the database's own resolution, so the value round-trips exactly; a client converts it to its native type (a nanosecond type reaches it losslessly). |
WriteConcern
Write concern configuration for a write statement or a session default.
Two independent axes, as in MongoDB: w (how many members acknowledge) and journal (what state each of them holds the write in). w is either a count of members or a named mode; the two never share a number space, so acks: 3 is three members in a group of any size and can never be confused with a mode. Leaving w unset selects the default, MAJORITY; asking for fire-and-forget is always explicit (acks: 0). Neither axis is ever silently changed to satisfy the other: a combination the server cannot honour is rejected with INVALID_ARGUMENT.
| Field | Type | Description |
|---|---|---|
journal | Journal | The state each counted member holds the write in. Omitted = JOURNAL. CACHE and MEMORY are accepted only with acks: 0 or acks: 1: a volatile state cannot be confirmed across members, so combining them with acks above 1 or with MAJORITY is rejected with INVALID_ARGUMENT. |
timeout_ms | uint32 | Time in milliseconds to wait for w to be satisfied; 0 = no timeout. On timeout the call fails, but the write is NOT rolled back: it may still commit afterwards. |
acks | uint32 | Number of members, the leader included, that must hold the write in the journal state before the caller is answered. 0 = fire-and-forget: the write still goes through the leader and the log, the caller is answered at once and is not told whether it committed. 1 = the leader alone (rollback possible if the leader fails before replication). N = N members. A value above the group's member count is rejected with INVALID_ARGUMENT. |
mode | WriteConcernMode | A named rule instead of a count. See WriteConcernMode. |
Enums
Journal
The state each acknowledging member must hold the write in before it counts towards w. Independent of w: w says how many members, journal says how durably each of them holds the write.
A write concern decides when the caller is answered, never whether the write is replicated: every write enters the group's log through the leader and is applied on every member. CACHE and MEMORY answer before the write is in the log and keep it in a volatile overlay until the drain proposes it; a leader crash before the drain loses every write still in that overlay. Use them for telemetry, hot counters and session state only, never for source-of-truth data.
| Value | Number | Description |
|---|---|---|
JOURNAL_UNSPECIFIED | 0 | Same as JOURNAL: the default when the field is omitted. |
JOURNAL_JOURNAL | 1 | The write is fsynced to the member's journal (the Raft log) before it is counted. Survives process crash and power failure. |
JOURNAL_CACHE | 2 | The write is in the member's RAM + NVMe overlay (~100µs) before it is counted. Survives a process crash, not a power failure before the drain. |
JOURNAL_MEMORY | 3 | The write is in the member's RAM-only overlay (~1µs) before it is counted. Visible at once to local readers that accept volatile data; lost on process crash before the drain. |
ReadConcernLevel
Read concern levels.
| Value | Number | Description |
|---|---|---|
READ_CONCERN_LEVEL_UNSPECIFIED | 0 | — |
READ_CONCERN_LEVEL_LOCAL | 1 | Read from local replica (may be stale). |
READ_CONCERN_LEVEL_MAJORITY | 2 | Read data committed by majority. |
READ_CONCERN_LEVEL_LINEARIZABLE | 3 | Linearizable read (strongest guarantee). |
READ_CONCERN_LEVEL_SNAPSHOT | 4 | Read from a consistent MVCC snapshot. |
ReadPreference
Read preference for routing read operations.
| Value | Number | Description |
|---|---|---|
READ_PREFERENCE_UNSPECIFIED | 0 | — |
READ_PREFERENCE_PRIMARY | 1 | — |
READ_PREFERENCE_PRIMARY_PREFERRED | 2 | — |
READ_PREFERENCE_SECONDARY | 3 | — |
READ_PREFERENCE_SECONDARY_PREFERRED | 4 | — |
READ_PREFERENCE_NEAREST | 5 | — |
VectorConsistency
How a vector search treats the read's snapshot: the same modes as the query hint vector_consistency('...') and the session command SET vector_consistency = '...'. A hint in the query wins over this setting.
| Value | Number | Description |
|---|---|---|
VECTOR_CONSISTENCY_UNSPECIFIED | 0 | Unset: left to the next level down, the session's setting and then the mode the query's read consistency implies. |
VECTOR_CONSISTENCY_CURRENT | 1 | The index's current state with no visibility filter: fastest, best recall, may include writes newer than the snapshot. |
VECTOR_CONSISTENCY_SNAPSHOT | 2 | Index candidates filtered by visibility at the snapshot. |
VECTOR_CONSISTENCY_EXACT | 3 | Every vector of the label at the snapshot, without the index: exact, and its cost grows with the label. |
WriteConcernMode
Named write concern modes: rules for w that are not a fixed count of members.
| Value | Number | Description |
|---|---|---|
WRITE_CONCERN_MODE_UNSPECIFIED | 0 | Not a valid choice on the wire: a WriteConcern whose w is unset means the default, MAJORITY. Set mode explicitly to one of the values below. |
WRITE_CONCERN_MODE_MAJORITY | 1 | Acknowledged once a majority of the group's members (the leader included) holds the write in the state named by journal. Survives the loss of a minority. The default. |
