Skip to main content

Memories

The Memories API is the core of Memsolus. Use it to store agent observations, user preferences, session facts, and any information that should persist across conversations.

Endpoint Overview

MethodPathPermissionDescription
GET/v1/memoriesmemory.readList or search memories
POST/v1/memoriesmemory.writeStore a new memory
GET/v1/memories/entitiesmemory.readList users and agents with memory counts
GET/v1/memories/categoriesmemory.readList distinct memory categories
GET/v1/memories/:idmemory.readGet a single memory by ID
PUT/v1/memories/:idmemory.writeUpdate memory content, metadata, or priority
DELETE/v1/memories/:idmemory.deleteDelete a memory
POST/v1/memories/:id/promotememory.writePromote a TASK-layer memory to permanent storage
POST/v1/memories/:id/feedbackmemory.writeSubmit quality feedback on a memory
GET/v1/memories/:id/historymemory.readGet the event timeline for a memory
GET/v1/memories/profile/:workspaceId/:userIdmemory.readGet a user's extracted memory profile
DELETE/v1/memoriesmemory.deleteDelete all memories (requires password confirmation)

Memory Object

FieldTypeDescription
idstringUUID of the memory
memorystringText content of the memory
user_idstringUser identifier
agent_idstring | nullAgent identifier
session_idstring | nullSession identifier
priorityLOW | MEDIUM | HIGHMemory priority
statusPENDING | PROCESSING | COMPLETED | FAILEDProcessing status
categoriesstring[]Category tags
metadataobject | nullArbitrary key-value pairs
workspace_idstringWorkspace UUID
access_countnumberNumber of times this memory was retrieved
last_accessed_atstring | nullISO 8601 timestamp of last retrieval
created_atstringISO 8601 creation timestamp
updated_atstringISO 8601 last-update timestamp

List Memories

GET/v1/memories
API Key

List memories with optional filtering and semantic search

ParameterTypeDescription
searchstringSearch query — enables vector search when present (max 1000 chars)
user_idstringFilter by user identifier
agent_idstringFilter by agent identifier
workspace_idstring (UUID)Filter by workspace
priorityenumFilter by a single priority: `LOW`, `MEDIUM`, or `HIGH`
prioritiesstring[]Filter by multiple priorities (comma-separated). Takes precedence over `priority`
categoriesstring[]Filter memories that contain at least one of the given categories
created_afterstring (ISO 8601)Start of the creation date range
created_beforestring (ISO 8601)End of the creation date range
modeenumSearch mode: `hybrid` (default), `semantic`, or `keyword`
expandbooleanExpand the query to improve semantic recall. Applies only to `semantic` and `hybrid` modes (default: false)
entity_idstring (UUID)Filter memories linked to a specific entity
entity_namestringFilter memories by normalized entity name (exact match)
pagenumberPage number, starting at 1 (default: 1)
page_sizenumberResults per page, max 100 (default: 10)
curl "https://api.memsolus.com/v1/memories?search=dark+mode+preferences&user_id=user-123&mode=hybrid" \
-H "X-Api-Key: msk_live_..."
200Success
{
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"memory": "The user prefers dark mode across all tools.",
"user_id": "user-123",
"agent_id": null,
"session_id": null,
"priority": "MEDIUM",
"status": "COMPLETED",
"categories": ["preferences", "ui"],
"workspace_id": "ws-uuid-here",
"source": "db",
"relevance": "HIGH",
"created_at": "2026-01-15T10:30:00.000Z",
"updated_at": "2026-01-15T10:31:00.000Z"
}
],
"total": 1,
"page": 1,
"page_size": 10
}

Search Modes

ModeBest For
hybridGeneral-purpose retrieval (recommended)
semanticMeaning-based similarity
keywordExact term matching

Create Memory

POST/v1/memories
API Key

Store a new memory

ParameterTypeDescription
memoryrequiredstringThe text content of the memory (max 50,000 chars)
user_idstringThe user this memory belongs to (max 255 chars)
agent_idstringThe agent that created the memory (max 255 chars)
session_idstringThe session context (max 255 chars)
priorityenumMemory priority: `LOW`, `MEDIUM` (default), or `HIGH`
categoriesstring[]Category tags for the memory (max 20 items, 100 chars each)
metadataobjectArbitrary key-value pairs for filtering and context
layerenumStorage layer: `TASK` (enables automatic TTL) or `RAW` (default — permanent storage)
expires_atstring (ISO 8601)Explicit expiration date — only valid when `layer=TASK`. Must be a future date.
curl -X POST https://api.memsolus.com/v1/memories \
-H "X-Api-Key: msk_live_..." \
-H "Content-Type: application/json" \
-d '{
"memory": "The user prefers dark mode across all tools.",
"user_id": "user-123",
"priority": "MEDIUM",
"categories": ["preferences", "ui"],
"metadata": {
"source": "settings_page"
}
}'
201Memory created
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"memory": "The user prefers dark mode across all tools.",
"user_id": "user-123",
"agent_id": null,
"session_id": null,
"categories": ["preferences", "ui"],
"metadata": { "source": "settings_page" },
"created_at": "2026-01-15T10:30:00.000Z",
"updated_at": "2026-01-15T10:30:00.000Z"
}

Returns 409 Conflict with error code DUPLICATE_MEMORY if a memory with identical content already exists for the same workspace.

After creation, the memory is processed asynchronously. Status transitions from PENDINGPROCESSINGCOMPLETED.


Get Memory

GET/v1/memories/:id
API Key

Get a single memory by ID

curl https://api.memsolus.com/v1/memories/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "X-Api-Key: msk_live_..."
200Success
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"memory": "The user prefers dark mode across all tools.",
"user_id": "user-123",
"agent_id": null,
"session_id": null,
"priority": "MEDIUM",
"status": "COMPLETED",
"categories": ["preferences", "ui"],
"workspace": {
"id": "ws-uuid-here",
"name": "My Workspace"
},
"metadata": { "source": "settings_page" },
"access_count": 4,
"last_accessed_at": "2026-01-20T08:15:00.000Z",
"feedback": null,
"created_at": "2026-01-15T10:30:00.000Z",
"updated_at": "2026-01-15T10:31:00.000Z"
}

Update Memory

PUT/v1/memories/:id
API Key

Update memory content, metadata, or priority

ParameterTypeDescription
memoryrequiredstringUpdated memory content (max 50,000 chars)
priorityenumUpdated priority: `LOW`, `MEDIUM`, or `HIGH`
categoriesstring[]Replace the categories list (max 20 items)
metadataobjectReplace the metadata object
curl -X PUT https://api.memsolus.com/v1/memories/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "X-Api-Key: msk_live_..." \
-H "Content-Type: application/json" \
-d '{
"memory": "The user prefers dark mode and high contrast themes.",
"priority": "HIGH"
}'
200Memory updated
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"memory": "The user prefers dark mode and high contrast themes.",
"user_id": "user-123",
"priority": "HIGH",
"status": "PENDING",
"categories": ["preferences", "ui"],
"created_at": "2026-01-15T10:30:00.000Z",
"updated_at": "2026-01-15T11:00:00.000Z"
}

Updating a memory re-queues it for processing — status returns to PENDING.


Delete Memory

DELETE/v1/memories/:id
API Key

Delete a memory

curl -X DELETE https://api.memsolus.com/v1/memories/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "X-Api-Key: msk_live_..."
204Memory deleted — no response body

Delete All Memories

DELETE/v1/memories
API Key

Delete all memories in the workspace (requires password confirmation)

This endpoint requires a X-Confirm-Password header with the account password. Optionally scopes the deletion to a specific user or agent.

ParameterTypeDescription
user_idstringScope deletion to a specific user ID
agent_idstringScope deletion to a specific agent ID
curl -X DELETE "https://api.memsolus.com/v1/memories?user_id=user-123" \
-H "X-Api-Key: msk_live_..." \
-H "X-Confirm-Password: your-account-password"
204All matching memories deleted — no response body

Returns 400 Bad Request with error code PASSWORD_CONFIRMATION_REQUIRED if the password header is missing or incorrect.


Promote Memory

POST/v1/memories/:id/promote
API Key

Promote a TASK-layer memory to permanent storage, removing its expiration

TASK-layer memories have an automatic expiration date. Promoting a memory makes it permanent.

curl -X POST https://api.memsolus.com/v1/memories/a1b2c3d4-e5f6-7890-abcd-ef1234567890/promote \
-H "X-Api-Key: msk_live_..."
202Promotion accepted — processing asynchronously
{
"message": "Memory promotion in progress"
}
Error codeDescription
404 MEMORY_NOT_FOUNDMemory not found
409 MEMORY_NOT_PROMOTABLEMemory is not in the TASK layer
410 MEMORY_EXPIREDMemory has already expired

Submit Feedback

POST/v1/memories/:id/feedback
API Key

Submit quality feedback on a memory

ParameterTypeDescription
signalrequiredenumFeedback signal: `POSITIVE`, `NEGATIVE`, or `NEUTRAL`
query_hashstringHash of the search query that returned this memory (max 64 chars). Used for ranking improvement.
curl -X POST https://api.memsolus.com/v1/memories/a1b2c3d4-e5f6-7890-abcd-ef1234567890/feedback \
-H "X-Api-Key: msk_live_..." \
-H "Content-Type: application/json" \
-d '{
"signal": "POSITIVE"
}'
204Feedback registered — no response body

Get Memory History

GET/v1/memories/:id/history
API Key

Get the event timeline for a memory

ParameterTypeDescription
pagenumberPage number (default: 1)
page_sizenumberResults per page, max 100 (default: 20)
curl "https://api.memsolus.com/v1/memories/a1b2c3d4-e5f6-7890-abcd-ef1234567890/history" \
-H "X-Api-Key: msk_live_..."
200Success
{
"data": [
{
"id": "evt-uuid-1",
"memory_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"event": "CREATED",
"old_content": null,
"new_content": "The user prefers dark mode across all tools.",
"created_at": "2026-01-15T10:30:00.000Z"
},
{
"id": "evt-uuid-2",
"memory_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"event": "UPDATED",
"old_content": "The user prefers dark mode across all tools.",
"new_content": "The user prefers dark mode and high contrast themes.",
"created_at": "2026-01-15T11:00:00.000Z"
}
],
"total": 2,
"page": 1,
"page_size": 20
}

List Entities

GET/v1/memories/entities
API Key

List users and agents with their memory counts

curl https://api.memsolus.com/v1/memories/entities \
-H "X-Api-Key: msk_live_..."
200Success
[
{ "type": "user", "id": "user-123", "count": 47 },
{ "type": "user", "id": "user-456", "count": 12 },
{ "type": "agent", "id": "claude-code", "count": 200 }
]

List Categories

GET/v1/memories/categories
API Key

List all distinct memory categories in the workspace

curl https://api.memsolus.com/v1/memories/categories \
-H "X-Api-Key: msk_live_..."
200Success
{
"categories": ["architecture", "preferences", "security", "tech-stack", "ui"]
}

Get Memory Profile

GET/v1/memories/profile/:workspaceId/:userId
API Key

Get the extracted memory profile for a user in a workspace

Returns the profile extracted from processed memories for the given user. Returns null if no profile has been extracted yet.

curl "https://api.memsolus.com/v1/memories/profile/ws-uuid-here/user-123" \
-H "X-Api-Key: msk_live_..."
200Success
{
"profile": {
"userId": "user-123",
"workspaceId": "ws-uuid-here",
"summary": "Software engineer with strong preference for TypeScript. Values dark mode and accessibility tooling.",
"topics": ["backend", "typescript", "accessibility"],
"entityCount": 14,
"extractedAt": "2026-01-20T08:00:00.000Z"
}
}

Returns 403 WORKSPACE_ACCESS_DENIED if the API key does not have access to the specified workspace, and 404 WORKSPACE_NOT_FOUND if the workspace does not exist.