This document describes the top-level APIs of the oGMemory HTTP API. The APIs are exposed by server/app.py, and the core services are orchestrated by MemoryService. The detailed request fields, response structure, and calling examples are subject to the specific integration document or code.
The lifecycle APIs serve the main loop of the agent, covering assembly before inference, incremental writing after rounds, compression, and session shutdown.
Method
Path
Purpose
Remarks
POST
/api/v1/compose
Assembles the context of the current round.
Called before inference. Messages are returned after the oGMemory context is injected.
POST
/api/v1/after_turn
Incremental writing after rounds end.
Accumulates messages. When the threshold is reached, the messages are extracted, written, indexed, and archived in the background.
POST
/api/v1/ingest
Writes messages to the session buffer.
The messages are only written to the short-term session buffer, not directly to the long-term memory.
POST
/api/v1/ingest_batch
Writes messages to the session buffer in batches.
The current implementation is equivalent to ingest.
POST
/api/v1/prepare_compaction
Prepares for compacting.
Executes incremental extraction preparation and returns the prepare token.
POST
/api/v1/compact
Compresses and archives sessions.
It can be directly called or used together with prepare_compaction in two phases.
POST
/api/v1/bootstrap
Entrance to session cold start.
Currently, it is a lightweight placeholder API.
POST
/api/v1/dispose
Cleans up and shuts down sessions.
Refreshes remaining messages and clears active sessions.
Management APIs are control plane capabilities used to manage accounts, users, roles, agents, and audit logs. Generally, they are used only after RBAC is enabled.