Skip to main content

Module serve

Module serve 

Source
Expand description

recall-echo serve — the graph daemon.

One daemon per memory directory owns the embedded graph store and answers command-level requests over a unix socket, one JSON object per line:

→ {"op":"search","args":{"query":"rust","limit":5}}
← {"ok":true,"data":[ ... ]}

The daemon is crash-only: it keeps no state outside the database, so it can be killed at any instant. Clients (crate::serve_client) detect the dead socket, clean it up and start a fresh daemon.

Unix only — the socket is a plain UnixListener, with no transport abstraction (see RE-29 decisions log).

Structs§

AddEntityArgs
BackgroundGuard
RAII background-batch counter for IdleTracker.
DaemonInfo
Identity of a running daemon, returned by Request::Hello.
DaemonLog
Append-only daemon log at <memory_dir>/graph/daemon.log.
ExtractionState
What the background extraction worker has done, shared with the connection tasks that answer Request::Hello.
ExtractionStatus
What this daemon’s background extraction worker has done so far.
FeedbackArgs
IdleTracker
Tracks daemon activity so an unused daemon shuts itself down, and so background work only runs while nobody is asking for anything.
IngestArchiveArgs
QueryArgs
RelateArgs
Response
A daemon response. Wire form is {"ok": true, "data": ...} or {"ok": false, "error": {"code": "...", "message": "..."}}.
ResponseError
A named failure. code is stable and machine-readable; message is the human-readable text (already prefixed by the error kind, e.g. store locked).
SearchArgs
SearchEpisodesArgs
ServeOptions
Everything serve needs to run.
ShutdownSignal
One-way “stop now” signal, observable by any number of tasks.
SyncPipelineArgs
Pipeline sync needs no LLM provider, so it runs against the daemon like any other graph operation instead of taking the store exclusively.
TraverseArgs

Enums§

Request
A client request. Wire form is {"op": "...", "args": {...}}.

Functions§

dispatch_graph
Execute a graph operation against an open store.
pidfile_path
Path of the pidfile that accompanies a socket.
run
Run the daemon until it is asked to stop or goes idle.