Appendix A: JSON-RPC API List
This appendix is a reference for the JSON-RPC 2.0 methods exposed by drsg serve.
The OpenRPC schema at crates/dr-strange-web/openrpc.json is the authoritative
source — the server returns it from rpc.discover, and the SDKs are generated
from it.
Each entry shows the method, its access tier (read / write / admin;
under the single shared token all three require the same token), a one-line
summary, and its parameters. A parameter is written name type; ! marks a
required parameter. Types are JSON values; Properties is the property-map
dialect ({"$vector":[…]}, {"$desc":…,"$value":…}, {"$bytes":[…]}, and
{"$map":{…}} for a nested map whose own keys begin with $; integers must fit
a signed 64-bit value), and NodeRef is a node id or an external key.
Discovery and database
rpc.discover· read — the OpenRPC service description. Params: none.db.stats· read — plane/node/edge counts, labels, edge types, indexes, commits, on-disk size, memory (the process’s resident set, and the bytes the loaded plugins hold). Params: none.db.catalog· read — the soft-schema catalog across every plane. Params: none.db.mount· admin — serve the planes of another database alongside this one’s (issue #44). The directory must already be a database and must sit under[server] mount_root; a store another process holds is refused. Params:path,as?(prefix the mount’s plane names).db.unmount· admin — stop serving a mount, releasing its store’s lock.freedsays whether the lock came free before the call returned: a fold in flight holds it until it finishes. An absent name is reported, not an error. Params:name.db.mounts· read — what this instance serves: each mount with its directory and planes, and every plane with the source tree it records. Params: none.
Planes
plane.list· read — every plane with id, name, counts, properties. Params: none.plane.catalog· read — one plane’s soft schema. Params:planestring!.plane.indexes· read — the search indexes declared on a plane. Params:planestring!.plane.history· read — the time-travel window (native backend only). Params: none.plane.create· admin — create an empty plane. Params:namestring!,propertiesProperties.plane.rename· admin — rename a plane. Params:planestring!,tostring!.plane.set_props· admin — replace a plane’s property map. Params:planestring!,propertiesProperties!.plane.delete· admin — drop a plane and its contents. Params:planestring!.plane.attach· admin — record a plane this one may ask: one on this instance, or one another drsg serves (url). Params:planestring!,namestring!,urlstring,asstring,bothboolean.plane.detach· admin — forget an attachment by name (absent is a no-op). Params:planestring!,namestring!.plane.attachments· read — what a plane attaches, as recorded; nothing is contacted. Params:planestring!.
Nodes and edges
node.get· read — one node by id or external key. Params:planestring!,idinteger,keystring.node.create· write — add a node with optional key and labels. Params:planestring!,keystring,labelsarray,propertiesProperties.node.update· write — patch properties (set/unset) and labels. Params:planestring!,idinteger,keystring,setProperties,unsetarray,labelsarray.node.delete· write — delete a node, cascading its edges. Params:planestring!,idinteger,keystring.edge.create· write — add a directed edge between two nodes. Params:planestring!,srcNodeRef!,dstNodeRef!,typestring!,propertiesProperties.edge.update· write — patch properties (set/unset) or the type. Params:planestring!,edgeinteger!,setProperties,unsetarray,typestring.edge.delete· write — delete one edge. Params:planestring!,edgeinteger!.
Query and retrieval
plane.neighbors· read — 1-hop expansion as{node, edge}id pairs. Params:planestring!,idinteger!,directionstring,typestring,as_ofinteger,as_of_msinteger.plane.query· read — run a serialized logical plan. Params:planestring!,planobject!,as_ofinteger,as_of_msinteger.plane.cypher· write — run an openCypher-subset statement (write-gated). Params:planestring!,querystring!,embedstring,paramsobject.plane.find· read — text or semantic search over a plane. Params:planestring!,qstring!,limitinteger,semanticboolean,providerstring,embed_modelstring,as_ofinteger,as_of_msinteger.plane.search· read — vector top-k over a property. Params:planestring!,propertystring!,queryarray!,labelstring,kinteger,metricstring.plane.hybrid· read — fused vector + keyword + graph-proximity search. Params:planestring!,qstring!,labelstring,vector_propstring,keyword_propstring,metricstring,graph_hopsinteger,graph_decaynumber,w_vectornumber,w_keywordnumber,w_graphnumber,kinteger,candidatesinteger,providerstring,embed_modelstring.plane.algo· read — a graph algorithm over a plane or label subset. Params:planestring!,algostring!,labelstring,limitinteger,dampingnumber,max_itersinteger,tolerancenumber,srcinteger,dstinteger,dirstring,weightstring,max_levelsinteger,min_gainnumber.plane.ask· read — natural-language query → plan → run. Params:planestring!,questionstring!,dry_runboolean,max_attemptsinteger,limitinteger,providerstring,modelstring,embed_providerstring,embed_modelstring.graph.seed· read — an initial canvas of nodes plus induced edges. Params:planestring!,labelstring,limitinteger,orderstring (scan|degree|pagerank, defaultscan),as_ofinteger,as_of_msinteger. A rankedorderreturns the highest-scoring nodes rather than the first the scan reaches, and includes theirscores— preferdegreefor a skeleton, since PageRank pools rank in sinks.graph.expand· read — hub-safe 1-hop neighbourhood around a node. Params:planestring!,idinteger!,directionstring,typestring,limitinteger,as_ofinteger,as_of_msinteger.
Indexes and ingestion
index.ensure· admin — declare a vector or keyword index on(label, property). Params:planestring!,labelstring!,propertystring!,kindstring,metricstring,languagestring.digest.run· write — extract a node/edge proposal from text via the LLM (dry run). Params:planestring!,textstring!,chatstring,embedstring,modelstring,embed_modelstring,sourcestring,no_embedboolean,linkboolean,concurrencyinteger,chunk_charsinteger,modestring (coarse|fine|super, defaultfine— see Chapter 3;supercosts ~15× the input tokens).digest.write· write — write a previously-computed proposal (no LLM call). A proposed key the plane already owns is skipped by default, since a distillation proposes every entity as new. Params:planestring!,nodesarray!,edgesarray,on_conflictstring (error/skip/update; defaultskip).plane.vectorize· write — embed every node in a plane (unchanged texts are skipped) and ensure a vector index onembeddingper label; the provider key comes from the server’s environment. Params:planestring!,embedstring,embed_modelstring,metricstring.
Plugins
plugin.list· read — the installed preprocessor plugins, the same recordsdrsg plugin list --jsonprints. Params: none.plugin.catalog· read — the official catalog, read from the extensions repository’scatalog.jsonrather than compiled into the binary, so a plugin release needs no drsg release. Returns{stale, schema, source, plugins}; each entry carriesname,version,claims,url,sha256andcompat(ok,needs_host,other_contract), joinable againstplugin.list. Cached for an hour;stale: truemeans the fetch failed and this is the last copy the server kept. Params: none.plugin.install· write — download, validate, hash-pin and store a plugin from anhttp(s)URL (server-local paths are refused over RPC). Params:urlstring!.plugin.remove· write — uninstall a plugin by name. Params:namestring!.
WebSocket subscription
The /ws endpoint answers the same request/response methods and additionally
supports the change feed (these are WebSocket-only):
plane.watch· client → server — subscribe to a plane’s changes. Params:planestring!,labelstring.plane.unwatch· client → server — stop the subscription. Params: none.plane.change· server → client — a committed change set. Fields:plane,seq,truncated,changes.
Error codes
| Code | Meaning |
|---|---|
-32700 | parse error |
-32600 | invalid request |
-32601 | method not found |
-32602 | invalid params |
-32000 | application error (bad plane, dangling endpoint, conflict, …) |
-32001 | unauthorized (missing or invalid credential) |