Automatic capture and lifecycle hooks

Automatic user-prompt capture requires an enabled lifecycle hook or equivalent message handler. MCP registration alone does not enable capture.

#Choose a capture method

For automatic capture in supported agent clients, an enabled lifecycle hook or equivalent message handler is required. MCP alone only exposes tools. Explicit memory_store calls do not need a hook. A chatbot you control can submit messages directly from its backend, so end users do not install a separate hook. Client-specific setup below is a concrete example; other clients require their own documented integration.

#Check client capabilities first

Confirm that your client exposes a supported event for user-message submission and allows outbound requests or a trusted integration process. Event names, configuration paths, permissions, and payloads differ by client and version. Use the client's official integration documentation. An MCP-compatible client does not necessarily support automatic capture. When no supported event is available, use explicit memory tools or integrate capture in an application backend; do not assume another client's hook configuration will work.

#Open your client configuration

Open your application’s integration settings or its documented configuration file using a plain-text editor. Create a memory server entry with the hosted endpoint, Streamable HTTP transport, and Bearer authorization header from the MCP guide. Merge entries without replacing unrelated settings. Each client defines its own file location and schema; there is no universal configuration file or hook installation command. Use the client’s supported secret references where available, save, and reload the integration.

#Connect the message lifecycle

Create a project and API key, then choose the stable subject and namespace used for recall. Register a handler for the client's supported user-message event. Map its message text, conversation identifier, and stable message identifier into the request below. Store the credential in trusted configuration. Use the original event identifier as the idempotency key so retries do not create duplicate sources. The example describes the API contract; adapt it to your client's documented event schema rather than copying it as a universal hook configuration.

http
POST https://memora-singapore.onrender.com/v1/integrations/messages
Authorization: Bearer YOUR_PROJECT_API_KEY
Content-Type: application/json

{
  "subject_id": "YOUR_SUBJECT_ID",
  "namespace": "default",
  "conversation_id": "STABLE_CONVERSATION_ID",
  "idempotency_key": "STABLE_MESSAGE_ID",
  "content": "USER_MESSAGE_TEXT"
}

#Recall before generating a response

Search with the current question and the same project, subject, and namespace. Add relevant returned memories and source citations as supporting context before response generation. Keep recalled text separate from system instructions. Handle empty results normally. Source extraction and indexing are asynchronous; do not require a newly submitted message to be immediately searchable.

#Enable the integration in the intended client

Save the handler using the client's documented configuration mechanism. Review and authorize its access, enable it, and reload the client if required. Recheck authorization after changing the definition. Verify the exact application, account, workspace, and conversation mode you intend to use. A successful test in one client or execution mode does not establish support in another.

#Verify the complete flow

Record the current source count, then submit a new harmless preference through the actual client conversation. Select the matching project in the dashboard and confirm a new source first. Check extraction status, the resulting Active memory, search readiness, and graph projection where supported relationships exist. In a later conversation in the same scope, ask about the preference and verify cited retrieval. Calling a store tool manually checks ingestion but does not prove the lifecycle handler ran.

#Capture policy and failure handling

Tell users which messages are submitted and provide a way to disable capture. Submit only the event types your integration explicitly handles; do not assume assistant responses are included. Keep credentials in trusted configuration, use bounded deadlines, and avoid logging raw prompts or keys. The repository prompt adapter fails open; applications requiring durable delivery should persist events in their own queue and retry transient failures using the same idempotency key.

#Disable capture

Disable or remove only the MeMorae handler using the client's supported controls and reload if required. Preserve unrelated integrations. This stops future submissions; existing sources and memories remain subject to their lifecycle and retention controls.