Store a memory in CortexDB.
POST /v1/remember
Store a memory in CortexDB. The content is appended to the immutable event log and acknowledged synchronously. Entity extraction, embedding, and graph updates happen asynchronously.
Usage
from cortexdb import Cortex
client = Cortex(api_key="your-api-key")
result = client.remember(
content="We decided to use gRPC for internal APIs. REST will remain for public-facing endpoints.",
tenant_id="my-app"
)
print(result.event_id) # "evt_a1b2c3d4"
import { CortexDB } from "cortexdbai";
const client = new CortexDB({ apiKey: "your-api-key" });
const result = await client.remember(
"We decided to use gRPC for internal APIs. REST will remain for public-facing endpoints.",
"my-app"
);
console.log(result.eventId); // "evt_a1b2c3d4"
curl -X POST https://api.cortexdb.ai/v1/remember \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"content": "We decided to use gRPC for internal APIs. REST will remain for public-facing endpoints.",
"tenant_id": "my-app"
}'
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| content | string | Yes | The memory content to store |
| tenant_id | string | Yes | Tenant identifier |
| scope | string | No | Optional scope qualifier |
| metadata | object | No | Arbitrary key-value metadata |
Response
{
"event_id": "evt_a1b2c3d4"
}
| Field | Type | Description |
|---|---|---|
| event_id | string | Unique identifier for the stored event |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Missing required fields |
| 401 | authentication_error | Invalid or missing API key |
| 413 | payload_too_large | Content exceeds size limit |
| 429 | rate_limit | Too many requests |
What happens under the hood
Both the Python and TypeScript SDKs wrap a POST /v1/remember REST call. The SDK handles authentication (reading CORTEX_API_KEY from your environment if not passed explicitly), serializes the request, and deserializes the response into a typed object. There is no difference in behavior between using the SDK and calling the REST API directly.