Operations and events
Run inferred memory writes and document extraction as durable, observable work.
FishMem makes slow or provider-backed mutations explicit. An HTTP connection is not the authority for whether inference or extraction succeeded; a persisted operation/event is.
Memory inference
An inferred POST /v1/memories request:
- validates scope and the idempotency key;
- claims one durable command identity;
- reserves the applicable Cloud credits;
- creates a pending event and returns HTTP
202; - runs extraction in a worker;
- commits refined canonical records or a terminal error;
- settles or refunds the reservation exactly once.
Use memories.addAsync(...) when your application wants the receipt
immediately. Use memories.addAndWait(...) for scripts that can poll until the
same event reaches a terminal state.
Event contract
GET /v1/events/{event_id} exposes public lifecycle state, attempts, timing,
terminal error, and the committed memory result. It does not echo the raw
conversation or internal provider payload.
Safe client behavior:
- persist the returned
event_idwith your own request record; - use bounded polling or a background job;
- stop on a terminal state;
- replay the original request only with the same idempotency key and payload;
- treat a key reused with a different payload as an application bug.
Document operations
File extraction uses the Operations resource rather than the Memory Event resource. The source-asset row and operation row own retry and cancellation; Queues and Containers only wake work.