Guides

Console Memories

Browse and inspect stored memories via client.memories.

client.memories exposes read-only access to the memories stored in your org. Use it to audit extraction quality, debug unexpected search results, or build admin dashboards.

from memsy import MemsyClient

client = MemsyClient(base_url="...", api_key="msy_...")

List memories

result = client.memories.list(
    actor_id="user_42",     # optional: filter to a single actor's memories
    kind="semantic",        # optional: "semantic" | "episodic" | ...
    type="preference",      # optional: "preference" | "fact" | "event" | ...
    status="active",        # optional: "active" | "archived" | "decayed"
    sort="observed_at_desc",# "observed_at_desc" | "strength_desc" | "confidence_desc"
    search="dark mode",     # optional: full-text search over memory text
    limit=50,
    offset=0,
)

print(f"{result.total} total memories")
for m in result.items:
    print(m.memory_id, m.text, m.confidence)

Pagination

Pagination is stable across pages — the server always sorts by your chosen sort key with memory_id as a secondary tiebreaker, so iterating offset won't return duplicates or skip records even when many memories share the primary sort value (e.g. identical observed_at).

page_size = 50
offset = 0

while True:
    page = client.memories.list(limit=page_size, offset=offset)
    for m in page.items:
        process(m)
    offset += page_size
    if offset >= page.total:
        break

Get a single memory

memory = client.memories.get("mem_01abc...")
print(memory.text, memory.strength, memory.tags)
print(memory.scope.level, memory.scope.actor_id)

Stats

Aggregate statistics for all memories in the org:

stats = client.memories.stats()
print(f"Total: {stats.total_memories}, Active: {stats.active_memories}")
print(f"Avg confidence: {stats.avg_confidence:.2f}")
print("By type:", stats.by_type)
print("By kind:", stats.by_kind)
print("Top entities:", stats.top_entities[:5])

MemoryItemResource fields

FieldTypeDescription
memory_idstrUnique memory ID.
org_idstrOwning org.
scopeMemoryScopeInfoScope (level + actor/team/role IDs).
typestrMemory type (e.g. "preference", "fact").
kindstrMemory kind (e.g. "semantic", "episodic").
memory_kindstrLow-level memory kind classification.
statusstr"active", "archived", or "decayed".
textstrThe extracted memory text.
confidencefloatExtraction confidence (0–1).
strengthfloatReinforcement strength (0–5.0, default 1.0). Not a probability.
recall_countintNumber of times this memory was recalled in search.
decay_half_life_daysfloatDays until strength halves.
pinnedboolPinned memories never decay.
tagslist[str]Tags from extraction.
entity_refslist[dict]Named entity references.
source_event_idslist[str]IDs of contributing events.
source_urlslist[str]Source URLs if applicable.
summarystr | NoneShort auto-generated summary.
payloaddict | NoneRaw extraction payload from the LLM, if retained.
last_recalled_atstr | NoneISO-8601 timestamp of last search recall.
observed_atstr | NoneISO-8601 timestamp of first observation.
effective_fromstr | NoneStart of validity window.
effective_tostr | NoneEnd of validity window (None = indefinite).
created_atstr | NoneRecord creation timestamp.
updated_atstr | NoneLast update timestamp.

MemoryScopeInfo

@dataclass
class MemoryScopeInfo:
    level: str               # "org" | "role" | "team" | "actor"
    actor_id: str | None = None
    team_id: str | None = None
    role_id: str | None = None

Async usage

from memsy import AsyncMemsyClient

async with AsyncMemsyClient(base_url="...", api_key="msy_...") as client:
    stats = await client.memories.stats()
    result = await client.memories.list(kind="semantic", limit=20)
    memory = await client.memories.get("mem_01abc...")

See also

  • Onboarding — set up org/role/team hierarchy to scope memories.
  • Searching memory — retrieve memories via semantic search.
  • Models — full MemoryItemResource and MemoryStatsResponse definitions.