API Documentation
Scoped extraction policy layer for controlling what becomes memory, with default resolution, per-request overrides, and configurable quality thresholds.
Overview
Memory Policies control what Mnexium is allowed to extract and save as memory whenlearn is enabled. They do not change recall ranking directly; they shape the memory set that exists over time.
projectsubjectsubject_id.chatchat_id.Default resolution is scope-aware: active default policies are resolved in the order project → subject → chat. Policy text is concatenated in that order, and config is merged so later scopes override earlier keys.
Override resolution per request with mnx.memory_policy orx-mnx-memory-policy:true or omitted auto-resolves, false disables policy application, and a string selects one explicit policy ID.
Supported Config Keys
include_kindsfact, preference,context, note,event, and trait.exclude_kindsconfidence_min0.0 to 1.0.importance_min0 to 100.max_memories_per_turn1 to 50./api/v1/memory/policiesList memory policies for the current project.
memory_policies:readscopeproject, subject, or chat.include_inactivetrue.curl -G "https://www.mnexium.com/api/v1/memory/policies" \
-H "x-mnexium-key: $MNX_KEY" \
--data-urlencode "scope=project"{
"policies": [
{
"id": "mp_support_assistant",
"name": "Support Assistant Default",
"policy_text": "Extract stable preferences and durable support context. Skip greetings and transient phrasing.",
"scope": "project",
"scope_id": "",
"is_active": 1,
"is_default": 1,
"priority": 100,
"config": {
"include_kinds": ["fact", "preference", "note"],
"confidence_min": 0.72,
"importance_min": 45,
"max_memories_per_turn": 3
}
}
]
}/api/v1/memory/policiesCreate a new memory policy. Set is_default to have it participate in automatic scoped resolution.
memory_policies:writenamerequiredpolicy_textrequiredscopescope_ididmp_... ID.is_activeis_defaultpriorityconfiginclude_kinds, exclude_kinds, confidence_min, importance_min, max_memories_per_turn.metadatacurl -X POST "https://www.mnexium.com/api/v1/memory/policies" \
-H "x-mnexium-key: $MNX_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "mp_support_assistant",
"name": "Support Assistant Default",
"policy_text": "Extract stable customer preferences, known constraints, and standing instructions. Ignore pleasantries and one-off wording.",
"scope": "project",
"is_default": true,
"priority": 100,
"config": {
"include_kinds": ["fact", "preference", "note"],
"exclude_kinds": ["event"],
"confidence_min": 0.72,
"importance_min": 45,
"max_memories_per_turn": 3
},
"metadata": { "team": "support" }
}'{
"ok": true,
"policy": {
"id": "mp_support_assistant",
"projectId": "proj_123",
"name": "Support Assistant Default",
"scope": "project",
"scopeId": ""
}
}/api/v1/memory/policies/:idFetch a single memory policy by ID.
memory_policies:readidrequiredcurl "https://www.mnexium.com/api/v1/memory/policies/mp_support_assistant" \
-H "x-mnexium-key: $MNX_KEY"{
"policy": {
"id": "mp_support_assistant",
"name": "Support Assistant Default",
"policy_text": "Extract stable customer preferences, known constraints, and standing instructions. Ignore pleasantries and one-off wording.",
"scope": "project",
"scope_id": "",
"is_active": 1,
"is_default": 1,
"priority": 100,
"config": { "include_kinds": ["fact", "preference", "note"] },
"metadata": { "team": "support" }
}
}/api/v1/memory/policies/:idUpdate a memory policy. Only provided fields are changed.
memory_policies:writeidrequirednamepolicy_textscopescope_idis_activeis_defaultpriorityconfigmetadatacurl -X PATCH "https://www.mnexium.com/api/v1/memory/policies/mp_support_assistant" \
-H "x-mnexium-key: $MNX_KEY" \
-H "Content-Type: application/json" \
-d '{
"policy_text": "Extract stable preferences and operational constraints. Avoid transient scheduling chatter.",
"config": {
"include_kinds": ["fact", "preference", "note"],
"confidence_min": 0.8,
"importance_min": 50,
"max_memories_per_turn": 2
}
}'{
"ok": true,
"id": "mp_support_assistant",
"projectId": "proj_123",
"updated": true
}/api/v1/memory/policies/:idSoft-delete a memory policy. It becomes inactive and stops participating in resolution.
memory_policies:deleteidrequiredcurl -X DELETE "https://www.mnexium.com/api/v1/memory/policies/mp_support_assistant" \
-H "x-mnexium-key: $MNX_KEY"{
"ok": true,
"deleted": true
}/api/v1/memory/policies/resolvePreview which memory policies apply to a context, or fetch the combined effective text/config.
memory_policies:readsubject_idchat_iddefault_onlytrue, only return policies marked as default. This matches request-time auto-resolution behavior.combinedtrue, return concatenated policy_text, merged config, and resolved policy_ids.curl -G "https://www.mnexium.com/api/v1/memory/policies/resolve" \
-H "x-mnexium-key: $MNX_KEY" \
--data-urlencode "subject_id=user_123" \
--data-urlencode "chat_id=550e8400-e29b-41d4-a716-446655440000" \
--data-urlencode "default_only=true" \
--data-urlencode "combined=true"// When combined=true:
{
"policy_text": "Extract stable customer preferences.\n\nPrioritize support constraints for this user.\n\nKeep only current workflow notes for this chat.",
"has_policy": true,
"policy_ids": ["mp_project_default", "mp_subject_support", "mp_chat_triage"],
"config": {
"include_kinds": ["fact", "preference", "note"],
"confidence_min": 0.8,
"importance_min": 50,
"max_memories_per_turn": 2
}
}
// When combined=false:
{
"policies": [
{ "id": "mp_project_default", "scope": "project", ... },
{ "id": "mp_subject_support", "scope": "subject", ... },
{ "id": "mp_chat_triage", "scope": "chat", ... }
],
"count": 3
}Request-Level Usage
Use request overrides when you need a one-off extraction mode without changing the stored defaults for the project, subject, or chat.
// Auto-resolve defaults for the current subject/chat context
"mnx": { "subject_id": "user_123", "chat_id": "550e8400-e29b-41d4-a716-446655440000", "learn": true }
// Force one explicit policy
"mnx": { "subject_id": "user_123", "learn": true, "memory_policy": "mp_support_assistant" }
// Disable policy application but keep learning enabled
"mnx": { "subject_id": "user_123", "learn": true, "memory_policy": false }
// Header fallback for provider-native SDKs
"x-mnx-memory-policy: mp_support_assistant"