MemNexus
Reference

Memories API

Memory management and retrieval endpoints

Memory management and retrieval endpoints

GET /api/memories

List memories

Query parameters:

ParameterTypeRequiredDescription
idPrefixstringNoFilter memories by ID prefix (git-style short ID lookup). Minimum 6 characters.
limitintegerNoMaximum number of memories to return
offsetintegerNoNumber of memories to skip
pageintegerNoPage number (alternative to offset)

Response: 200 List of memories

FieldTypeRequiredDescription
dataMemory[]No
paginationPaginationNo

Example:

curl -X GET "https://api.memnexus.ai/api/memories" \
  -H "Authorization: Bearer cmk_live_xxx.yyy"

POST /api/memories

Create a memory

Request body:

FieldTypeRequiredDescription
conversationIdstringYesConversation ID - use "NEW" to create a new conversation or provide existing conversation ID
namestringNoOptional human-readable name for deterministic retrieval. Must be unique per user.
contentstringYesMemory content
memoryTypeepisodic \semantic \procedural
roleuser \assistant \system
contextstringNoContext or domain
topicsstring[]NoAssociated topics
eventTimestringNoEvent time (when the event actually occurred in reality, ISO 8601 format)
validFromstringNoValidity start time (when this fact becomes valid, ISO 8601 format)
validTostringNoValidity end time (when this fact expires, ISO 8601 format, omit for never expires)

Response: 201 Memory created successfully

FieldTypeRequiredDescription
dataMemoryYes
metaCreateMemoryResponseMetaYes

Example:

curl -X POST "https://api.memnexus.ai/api/memories" \
  -H "Authorization: Bearer cmk_live_xxx.yyy" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /api/memories/{id}

Get memory by ID

Path parameters:

ParameterTypeRequiredDescription
idstringYesThe memory ID

Response: 200 Memory retrieved successfully

FieldTypeRequiredDescription
dataMemoryYes

Example:

curl -X GET "https://api.memnexus.ai/api/memories/mem_abc123" \
  -H "Authorization: Bearer cmk_live_xxx.yyy"

PUT /api/memories/{id}

Update a memory

Path parameters:

ParameterTypeRequiredDescription
idstringYesMemory ID

Request body:

FieldTypeRequiredDescription
contentstringNoUpdated memory content
nameanyNoAssign or remove a name. Set to a valid name to assign, empty string to remove.
memoryTypeepisodic \semantic \procedural
contextstringNoUpdated context or domain
topicsstring[]NoUpdated topics

Response: 200 Memory updated successfully

FieldTypeRequiredDescription
dataMemoryNo

Example:

curl -X PUT "https://api.memnexus.ai/api/memories/mem_abc123" \
  -H "Authorization: Bearer cmk_live_xxx.yyy" \
  -H "Content-Type: application/json" \
  -d '{}'

DELETE /api/memories/{id}

Delete memory

Path parameters:

ParameterTypeRequiredDescription
idstringYesThe memory ID

Response: 204 No Content

Example:

curl -X DELETE "https://api.memnexus.ai/api/memories/mem_abc123" \
  -H "Authorization: Bearer cmk_live_xxx.yyy"

GET /api/memories/{id}/conversation-memories

Find memories from same conversation

Path parameters:

ParameterTypeRequiredDescription
idstringYesThe source memory ID

Query parameters:

ParameterTypeRequiredDescription
limitintegerNoMaximum number of conversation memories to return

Response: 200 Conversation memories found

FieldTypeRequiredDescription
dataRelatedMemoryResult[]No
sourceMemoryMemoryNo
conversationIdstringNoThe conversation ID (null if memory has no conversation)

Example:

curl -X GET "https://api.memnexus.ai/api/memories/mem_abc123/conversation-memories" \
  -H "Authorization: Bearer cmk_live_xxx.yyy"

POST /api/memories/{id}/detect-relationships

Detect potential relationships for a memory

Path parameters:

ParameterTypeRequiredDescription
idstringYesThe memory ID

Request body:

FieldTypeRequiredDescription
autoCreatebooleanNoAutomatically create high-confidence relationships
minConfidencenumberNoMinimum confidence threshold for suggestions

Response: 200 Relationship candidates detected

FieldTypeRequiredDescription
dataobject[]No
autoCreatedbooleanNo

Example:

curl -X POST "https://api.memnexus.ai/api/memories/mem_abc123/detect-relationships" \
  -H "Authorization: Bearer cmk_live_xxx.yyy" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /api/memories/{id}/related

Find related memories by topics

Path parameters:

ParameterTypeRequiredDescription
idstringYesThe source memory ID

Query parameters:

ParameterTypeRequiredDescription
limitintegerNoMaximum number of related memories to return

Response: 200 Related memories found

FieldTypeRequiredDescription
dataany[]No
sourceMemoryMemoryNo

Example:

curl -X GET "https://api.memnexus.ai/api/memories/mem_abc123/related" \
  -H "Authorization: Bearer cmk_live_xxx.yyy"

GET /api/memories/{id}/relationships

Get relationships for a memory

Path parameters:

ParameterTypeRequiredDescription
idstringYesThe memory ID

Query parameters:

ParameterTypeRequiredDescription
directionoutgoing \incoming \both

Response: 200 Relationships retrieved successfully

FieldTypeRequiredDescription
dataMemoryRelationship[]Yes
sourceMemoryIdstringYesThe source memory ID these relationships are for
directionoutgoing \incoming \both

Example:

curl -X GET "https://api.memnexus.ai/api/memories/mem_abc123/relationships" \
  -H "Authorization: Bearer cmk_live_xxx.yyy"

POST /api/memories/{id}/relationships

Create a relationship between memories

Path parameters:

ParameterTypeRequiredDescription
idstringYesThe source memory ID

Request body:

FieldTypeRequiredDescription
targetMemoryIdstringYesID of the target memory to create a relationship with
typeSUPERSEDES \FOLLOWS \RESOLVES \
confidencenumberNoConfidence score for the relationship (0-1, defaults to 1.0 for manual)
reasonstringNoOptional explanation for the relationship

Response: 201 Relationship created successfully

FieldTypeRequiredDescription
dataMemoryRelationshipNo

Example:

curl -X POST "https://api.memnexus.ai/api/memories/mem_abc123/relationships" \
  -H "Authorization: Bearer cmk_live_xxx.yyy" \
  -H "Content-Type: application/json" \
  -d '{}'

DELETE /api/memories/{id}/relationships/{relationshipId}

Delete a relationship

Path parameters:

ParameterTypeRequiredDescription
idstringYesThe source memory ID
relationshipIdstringYesThe relationship ID to delete

Response: 204 Relationship deleted successfully

Example:

curl -X DELETE "https://api.memnexus.ai/api/memories/mem_abc123/relationships/rel_abc123" \
  -H "Authorization: Bearer cmk_live_xxx.yyy"

GET /api/memories/{id}/similar

Find similar memories

Path parameters:

ParameterTypeRequiredDescription
idstringYesThe source memory ID

Query parameters:

ParameterTypeRequiredDescription
limitintegerNoMaximum number of similar memories to return

Response: 200 Similar memories found

FieldTypeRequiredDescription
dataRelatedMemoryResult[]No
sourceMemoryMemoryNo

Example:

curl -X GET "https://api.memnexus.ai/api/memories/mem_abc123/similar" \
  -H "Authorization: Bearer cmk_live_xxx.yyy"

GET /api/memories/{id}/timeline

Get timeline context for a memory

Path parameters:

ParameterTypeRequiredDescription
idstringYesThe memory ID

Query parameters:

ParameterTypeRequiredDescription
beforeintegerNoNumber of preceding memories to return
afterintegerNoNumber of following memories to return

Response: 200 Timeline context retrieved successfully

FieldTypeRequiredDescription
dataobjectNo

Example:

curl -X GET "https://api.memnexus.ai/api/memories/mem_abc123/timeline" \
  -H "Authorization: Bearer cmk_live_xxx.yyy"

POST /api/memories/batch

Get multiple memories by IDs

Request body:

FieldTypeRequiredDescription
idsstring[]YesArray of memory IDs to retrieve

Response: 200 Memories retrieved successfully

FieldTypeRequiredDescription
dataMemory[]Yes
metaBatchGetMemoriesMetaYes

Example:

curl -X POST "https://api.memnexus.ai/api/memories/batch" \
  -H "Authorization: Bearer cmk_live_xxx.yyy" \
  -H "Content-Type: application/json" \
  -d '{}'

POST /api/memories/digest

Generate memory digest

Request body:

FieldTypeRequiredDescription
querystringYesThe topic or subject to generate a digest for
recentstringNoTime window filter (e.g., "7d", "24h", "2w", "30m"). Only considers memories within this window.
topicsstring[]NoFilter to memories with these topics
conversationIdsstring[]NoLimit to specific conversation IDs
formatstructured \narrative \timeline \
maxSourcesintegerNoMaximum number of memories to consider (1-500, default 100)
includeMemoryIdsbooleanNoWhether to include source memory IDs in the response

Response: 200 Digest generated successfully

FieldTypeRequiredDescription
digeststringYesThe generated digest content (markdown formatted)
metadataDigestMetadataYes
sourcesDigestSource[]YesSource memories used to generate the digest, for traceability

Example:

curl -X POST "https://api.memnexus.ai/api/memories/digest" \
  -H "Authorization: Bearer cmk_live_xxx.yyy" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /api/memories/named/{name}

Get a memory by name

Path parameters:

ParameterTypeRequiredDescription
namestringYesMemory name (kebab-case, 2-64 chars)

Response: 200 Memory retrieved successfully

FieldTypeRequiredDescription
dataMemoryYes

Example:

curl -X GET "https://api.memnexus.ai/api/memories/named/{name}" \
  -H "Authorization: Bearer cmk_live_xxx.yyy"

PUT /api/memories/named/{name}

Update a named memory (create new version)

Path parameters:

ParameterTypeRequiredDescription
namestringYesMemory name (kebab-case, 2-64 chars)

Request body:

FieldTypeRequiredDescription
contentstringYesNew content for the named memory version
memoryTypeepisodic \semantic \procedural
contextstringNoContext or domain
topicsstring[]NoAssociated topics

Response: 201 New version created successfully

FieldTypeRequiredDescription
dataMemoryNo
metaobjectNo

Example:

curl -X PUT "https://api.memnexus.ai/api/memories/named/{name}" \
  -H "Authorization: Bearer cmk_live_xxx.yyy" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /api/memories/named/{name}/history

Get version history for a named memory

Path parameters:

ParameterTypeRequiredDescription
namestringYesMemory name (kebab-case, 2-64 chars)

Response: 200 Version history retrieved successfully

FieldTypeRequiredDescription
namestringYesHuman-readable name for deterministic retrieval (kebab-case, 2-64 chars)
versionsobject[]Yes

Example:

curl -X GET "https://api.memnexus.ai/api/memories/named/{name}/history" \
  -H "Authorization: Bearer cmk_live_xxx.yyy"

GET /api/memories/search

Search memories (GET)

Query parameters:

ParameterTypeRequiredDescription
qstringYesSearch query string
searchMethodkeyword \semantic \hybrid
limitintegerNoMaximum number of results to return
offsetintegerNoNumber of results to skip for pagination
thresholdnumberNoMinimum similarity threshold for semantic search
modeunified \content \facts
vectorWeightnumberNoWeight for vector similarity in hybrid search
fulltextWeightnumberNoWeight for fulltext matching in hybrid search
topicsstringNoComma-separated list of topics to filter by (include memories with ANY of these topics)
excludeTopicsstringNoComma-separated list of topics to exclude (exclude memories with ANY of these topics)
memoryTypeepisodic \semantic \procedural
conversationIdstringNoFilter by conversation ID
explainbooleanNoInclude detailed match explanations in results
includeTopicsbooleanNoInclude associated topics in results
includeEntitiesbooleanNoInclude mentioned entities in results
asOfTimestringNoPoint-in-time query (ISO 8601 datetime)
validAtTimestringNoFilter by validity time (ISO 8601 datetime)
eventTimeFromstringNoEvent time range start (ISO 8601 datetime)
eventTimeTostringNoEvent time range end (ISO 8601 datetime)
ingestionTimeFromstringNoIngestion time range start (ISO 8601 datetime)
ingestionTimeTostringNoIngestion time range end (ISO 8601 datetime)
includeExpiredbooleanNoInclude expired memories in results
temporalModecurrent \historical \evolution

Response: 200 Search results

FieldTypeRequiredDescription
dataSearchResult[]YesSearch results with metadata
searchMethodstringNoSearch method used for this query
paginationanyYes
temporalMetadataTemporalMetadataYes

Example:

curl -X GET "https://api.memnexus.ai/api/memories/search" \
  -H "Authorization: Bearer cmk_live_xxx.yyy"

POST /api/memories/search

Search all memories

Request body:

FieldTypeRequiredDescription
querystringYesSearch query
modeunified \content \facts
searchMethodkeyword \semantic \hybrid
limitintegerNoMaximum number of results (defaults to 20)
offsetintegerNoOffset for pagination (defaults to 0)
vectorWeightnumberNoWeight for vector (semantic) results in hybrid search (0-1, defaults to 0.7)
fulltextWeightnumberNoWeight for fulltext (keyword) results in hybrid search (0-1, defaults to 0.3)
thresholdnumberNoMinimum similarity threshold for semantic search (0-1, defaults to 0.5)
explainbooleanNoIf true, include detailed explanation of how each result was matched
asOfTimestringNoPoint-in-time query: show what the system knew at this time (ISO 8601 format)
validAtTimestringNoValidity query: show facts that were valid at this time (ISO 8601 format)
eventTimeFromstringNoEvent time range start (ISO 8601 format)
eventTimeTostringNoEvent time range end (ISO 8601 format)
ingestionTimeFromstringNoIngestion time range start (ISO 8601 format)
ingestionTimeTostringNoIngestion time range end (ISO 8601 format)
includeExpiredbooleanNoInclude expired facts (defaults to false)
temporalModecurrent \historical \evolution
topicsstring[]NoFilter by topics - returns memories that have ANY of the specified topics
memoryTypeepisodic \semantic \procedural
conversationIdstringNoFilter by conversation ID
includeTopicsbooleanNoInclude topics associated with matched memories (defaults to false for performance)
includeEntitiesbooleanNoInclude entities mentioned in matched memories (defaults to false for performance)
includeFactsbooleanNoInclude facts extracted from matched memories (defaults to false for performance)
entityTypesstring[]NoFilter entities by type (e.g., PERSON, TECHNOLOGY, PROJECT)

Response: 200 Search results

FieldTypeRequiredDescription
dataSearchResult[]YesSearch results with metadata
searchMethodstringNoSearch method used for this query
paginationanyYes
temporalMetadataTemporalMetadataYes

Example:

curl -X POST "https://api.memnexus.ai/api/memories/search" \
  -H "Authorization: Bearer cmk_live_xxx.yyy" \
  -H "Content-Type: application/json" \
  -d '{}'