Skip to main content

Memories

The Memories router is the core of Novyx. Store observations, retrieve them by ID, list with filters, update fields, delete, and export.

Base URL: https://novyx-ram-api.fly.dev


Store Memory

POST /v1/memories

Store a new memory. Returns the memory ID, content hash, and auto-link results.

Request body

ParameterTypeRequiredDefaultDescription
observationstringYesThe memory content
tagsstring[]No[]Tags for filtering
importancenumberNo5Importance score (1–10)
contextstringNoAdditional context metadata
agent_idstringNoAgent identifier
space_idstringNoSpace namespace (Pro+)
ttl_secondsnumberNoAuto-expire after N seconds (60–7,776,000)
auto_linkbooleanNotrueAuto-link to similar memories
on_conflictstringNo"REJECT"Conflict strategy: REJECT, SUPERSEDE, MERGE

Response fields

FieldTypeDescription
idstringUnique memory identifier (urn:uuid:...)
hashstringSHA-256 content hash
created_atstringISO 8601 timestamp
conflict_detectedbooleanWhether a conflict was detected
auto_linksstring[]IDs of auto-linked memories

Examples

from novyx import Novyx

nx = Novyx(api_key="nram_your_key")

result = nx.remember(
"User prefers dark mode and compact layouts",
tags=["preferences", "ui"],
importance=8,
)
print(result["id"]) # urn:uuid:a1b2c3d4-...
print(result["hash"]) # sha256 content hash

Response

{
"id": "urn:uuid:a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"created_at": "2026-03-09T12:00:00Z",
"conflict_detected": false,
"auto_links": []
}

Errors

StatusCodeCause
400VALIDATION_ERRORMissing observation or invalid importance range
409CONFLICTDuplicate content detected and on_conflict is REJECT
429RATE_LIMITEDExceeded plan memory limit or API call quota

List Memories

GET /v1/memories

List all memories for your tenant, ordered by creation date (newest first).

Query parameters

ParameterTypeRequiredDefaultDescription
limitnumberNo20Max results (1–100)
offsetnumberNo0Pagination offset
tagsstringNoFilter by tag
agent_idstringNoFilter by agent
space_idstringNoFilter by space

Response fields

FieldTypeDescription
memoriesarrayArray of memory objects
totalnumberTotal matching memories
has_morebooleanWhether more pages exist

Examples

# List all memories
memories = nx.list_memories(limit=10)

# Filter by tag
preferences = nx.list_memories(tags="preferences", limit=5)

Response

{
"memories": [
{
"uuid": "urn:uuid:a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"observation": "User prefers dark mode and compact layouts",
"tags": ["preferences", "ui"],
"importance": 8,
"confidence": 1.0,
"recall_count": 3,
"created_at": "2026-03-09T12:00:00Z"
}
],
"total": 42,
"has_more": true
}

Get Memory

GET /v1/memories/{id}

Retrieve a single memory by ID with full metadata.

Path parameters

ParameterTypeDescription
idstringMemory ID (urn:uuid:...)

Response fields

FieldTypeDescription
uuidstringMemory identifier
observationstringMemory content
tagsstring[]Tags
importancenumberImportance score (1–10)
confidencenumberSystem confidence score
recall_countnumberNumber of times recalled
last_recalled_atstringLast recall timestamp
superseded_bystring | nullID of superseding memory
created_atstringCreation timestamp
updated_atstringLast update timestamp

Examples

memory = nx.get_memory("urn:uuid:a1b2c3d4-e5f6-7890-abcd-ef1234567890")
print(memory["observation"])
print(memory["recall_count"])

Errors

StatusCodeCause
404NOT_FOUNDMemory does not exist or belongs to another tenant

Update Memory

PATCH /v1/memories/{id}

Partially update a memory. Only send the fields you want to change.

Path parameters

ParameterTypeDescription
idstringMemory ID

Request body

ParameterTypeRequiredDescription
observationstringNoUpdated content
importancenumberNoUpdated importance (1–10)
tagsstring[]NoUpdated tags (replaces existing)
superseded_bystringNoMark as superseded by another memory

Response fields

FieldTypeDescription
uuidstringMemory identifier
observationstringUpdated content
updated_atstringUpdate timestamp

Examples

updated = nx.update_memory(
"urn:uuid:a1b2c3d4-e5f6-7890-abcd-ef1234567890",
observation="User prefers dark mode, compact layouts, and monospace fonts",
importance=9,
tags=["preferences", "ui", "fonts"],
)

Errors

StatusCodeCause
400VALIDATION_ERRORInvalid field value
404NOT_FOUNDMemory does not exist
409CONFLICTConcurrent write conflict

Delete Memory

DELETE /v1/memories/{id}

Permanently delete a memory and its associated links.

Path parameters

ParameterTypeDescription
idstringMemory ID

Response fields

FieldTypeDescription
deletedbooleanWhether the memory was deleted
memory_idstringID of deleted memory

Examples

result = nx.delete_memory("urn:uuid:a1b2c3d4-e5f6-7890-abcd-ef1234567890")
print(result["deleted"]) # True

Errors

StatusCodeCause
404NOT_FOUNDMemory does not exist

Export Memories

GET /v1/memories/export

Export all memories as a structured file. Supports Markdown, JSON, and CSV formats.

Query parameters

ParameterTypeRequiredDefaultDescription
formatstringNo"md"Export format: md, json, or csv
tagsstringNoComma-separated tag filter
agent_idstringNoFilter by agent ID

Response

Returns a file download. Content-Type varies by format:

FormatContent-Type
mdtext/markdown
jsonapplication/json
csvtext/csv

Examples

# Export as JSON
data = nx.export_memories(format="json")

# Export filtered by tag
preferences = nx.export_memories(format="csv", tags="preferences")

Temporal Context

GET /v1/context/now

Get the current temporal context including recent memories, last session timestamp, and server time. Useful for session resumption.

Response fields

FieldTypeDescription
server_time_utcstringCurrent server time (ISO 8601)
recent_memoriesarrayMost recent memories
recent_countnumberNumber of recent memories returned
last_session_atstringLast session timestamp
seconds_since_last_sessionnumberSeconds since last activity

Examples

context = nx.context_now()
print(f"Last active: {context['seconds_since_last_session']}s ago")
print(f"Recent memories: {context['recent_count']}")

Response

{
"server_time_utc": "2026-03-09T15:30:00Z",
"recent_memories": [
{
"uuid": "urn:uuid:a1b2c3d4-...",
"observation": "User prefers dark mode",
"created_at": "2026-03-09T12:00:00Z"
}
],
"recent_count": 1,
"last_session_at": "2026-03-09T12:00:00Z",
"seconds_since_last_session": 12600
}