memory.store
Save a memory through Mnemexa’s intelligence pipeline — PII filtering, semantic deduplication, importance scoring, temporal classification, and category extraction all happen automatically.
POST /v1/memory/store
Request
curl -X POST https://api.mnemexa.com/v1/memory/store \
-H "Authorization: Bearer mnx_ws_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Client prefers async standups on Tuesdays at 9am IST and mandates passing tests before merging to main.",
"meta": {"source": "kickoff_meeting"}
}'
Body
| Field | Type | Required | Description |
|---|---|---|---|
text | string | yes | The memory content. 1–10,000 characters. |
meta | object | no | Free-form metadata attached to the memory. Surfaced on retrieval. |
Workspace is derived from the API key — there is no workspace_id field.
Response
{
"status": "ok",
"memory_id": 8421,
"workspace_id": 42,
"dedup": {
"action": "stored_new",
"existing_id": null
},
"importance": 5,
"categories": ["project_management", "team_workflow"],
"temporal": {
"type": "persistent",
"raw_text": "Client prefers async standups on Tuesdays at 9am IST…",
"valid_until": null
}
}
Fields
| Field | Type | Description |
|---|---|---|
status | string | "ok" on success. |
memory_id | integer | The memory ID for the stored (or deduplicated) chunk. |
workspace_id | integer | Workspace that owns this memory. |
dedup.action | string | stored_new, duplicate_exact, or an LLM-derived dedup action (e.g. updated_existing). See Memory Pipeline. |
dedup.existing_id | integer | null | The pre-existing memory ID when action indicates a duplicate or update. |
importance | integer | LLM-assigned importance score. Higher = more business value. |
categories | string[] | LLM-derived semantic tags. |
temporal.type | string | persistent (durable) or temporal (time-bound). |
temporal.valid_until | string | null | ISO 8601 expiry for time-bound facts; null for persistent ones. |
Intelligence pipeline
Every memory passes through these stages before storage:
- PII detection — passwords, credit cards, SSNs, API keys are flagged and the request is either redacted or rejected with
422 pii_rejected. - Embedding — text is embedded via OpenAI
text-embedding-3-small. - Semantic dedup —
0.98+similarity to an existing memory is treated as a duplicate;0.70–0.98triggers an LLM merge decision. - Importance scoring — LLM assesses business value.
- Temporal classification — persistent fact vs. time-bound state.
- Category extraction — multi-tag domain labels.
- Storage — pgvector + HNSW index, attached to your workspace.
See Memory Pipeline for the full breakdown.
Errors
| Status | code | Cause |
|---|---|---|
| 401 | — | Missing or invalid Authorization header. |
| 403 | — | Workspace deleted or client account suspended. |
| 422 | pii_rejected | Submitted text contains sensitive data that cannot be safely stored. |
| 429 | — | Rate limit exceeded. See Rate Limits. |
| 429 | — | Plan unit limit reached. Upgrade or wait for the next billing cycle. |
Never store passwords, API keys, credit card numbers, or government IDs in memory. Mnemexa rejects what it can detect, but treat the workspace as if a third party could read it.
SDKs
import mnemexa
client = mnemexa.Client() # reads MNEMEXA_API_KEY from env
result = client.memory.store(
text="Client prefers async standups on Tuesdays at 9am IST.",
meta={"source": "kickoff_meeting"},
)
print(result.memory_id, result.dedup.action, result.importance)
The MCP adapter exposes this as brain.remember. See Python SDK and MCP Adapter.