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

FieldTypeRequiredDescription
textstringyesThe memory content. 1–10,000 characters.
metaobjectnoFree-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

FieldTypeDescription
statusstring"ok" on success.
memory_idintegerThe memory ID for the stored (or deduplicated) chunk.
workspace_idintegerWorkspace that owns this memory.
dedup.actionstringstored_new, duplicate_exact, or an LLM-derived dedup action (e.g. updated_existing). See Memory Pipeline.
dedup.existing_idinteger | nullThe pre-existing memory ID when action indicates a duplicate or update.
importanceintegerLLM-assigned importance score. Higher = more business value.
categoriesstring[]LLM-derived semantic tags.
temporal.typestringpersistent (durable) or temporal (time-bound).
temporal.valid_untilstring | nullISO 8601 expiry for time-bound facts; null for persistent ones.

Intelligence pipeline

Every memory passes through these stages before storage:

  1. PII detection — passwords, credit cards, SSNs, API keys are flagged and the request is either redacted or rejected with 422 pii_rejected.
  2. Embedding — text is embedded via OpenAI text-embedding-3-small.
  3. Semantic dedup0.98+ similarity to an existing memory is treated as a duplicate; 0.70–0.98 triggers an LLM merge decision.
  4. Importance scoring — LLM assesses business value.
  5. Temporal classification — persistent fact vs. time-bound state.
  6. Category extraction — multi-tag domain labels.
  7. Storage — pgvector + HNSW index, attached to your workspace.

See Memory Pipeline for the full breakdown.

Errors

StatuscodeCause
401Missing or invalid Authorization header.
403Workspace deleted or client account suspended.
422pii_rejectedSubmitted text contains sensitive data that cannot be safely stored.
429Rate limit exceeded. See Rate Limits.
429Plan 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.