memory

Stores, searches and deletes long-term memories for the current user. Memories outlive the conversation: a fact an agent learns today can be found by a query months later.

Fields

FieldTypeDefaultDescription
storedynamic dictStores one or more memories for the current user.
querydynamic stringSearches this user's memories. When set, the matches are the command's result.
agentNameagent nameFilter by agent. By default, memories from all agents are searched.
labeldynamic stringFilter by label. By default, memories from all labels are searched.
limitinteger10The maximum number of results to return.
deletelist of nameDeletes the memories with these labels.

How memories are keyed

A memory belongs to one user and is identified by the storing agent's name and a label. Storing under a label that already exists replaces the earlier memory, so a label holds the current truth of one fact rather than a history. Labels are literal names written in the definition. The text is a dynamic string. One command may both store and search.

Result

When query is set, the result is a list of the best-matching memories. Each memory has agentName, label, text and createdAt. Matching is semantic: the query does not have to share words with the memory. At most limit memories come back, and only memories that are relevant enough. An unrelated query returns an empty list. Without query, the result is None.

Example

"memory": {
  "query": "{ sys.query }",
  "limit": 5
},
"prompt": {
  "user": "{ f'What I remember about this user: {[m['text'] for m in result]}. Their question: {sys.query}' }"
},
"llm": { "profile": "gpt5_mini" },
"memory.store": {
  "store": {
    "preferred_airline": "{ f'The user prefers to fly {airline}' }"
  }
}

Rules

  • A memory command with query makes a round trip to Search2o Cloud, where memories are kept and searched. The query text is sent in plain form, used for the match, and not stored. Without query the command makes no call: stores and deletes travel with the report the agent server sends when the run completes.
  • Stores and deletes are applied when the agent completes successfully. A run that fails stores nothing. Validation runs never store memories.
  • One agent may use at most 10 distinct labels across its definition. A single command may store up to 25.
  • A memory is kept until the agent that stored it is deleted. Each user has a bounded number of memories, 100 on the Free plan and 500 on Paid; when the bound is reached, the least recently retrieved memories are evicted first.
  • By default the search covers every agent's memories for this user. Narrow the search with agentName or label.