Memory
The Memory Library stores facts, episodic notes, and learned context an agent can recall. Use this resource for full CRUD, semantic search, versioning, linking, and sharing of memories.
Access it as client.memory on a Strongly client, or the same path on AsyncStrongly with await. All methods exist on both with identical signatures.
Quick start
from strongly import Strongly
client = Strongly()
# List (auto-paginates as you iterate) # filters: kind, tags, search, linked_ids, as_of
for memory in client.memory.list():
print(memory.id)
Methods
Core
list
list(*, kind: str | None = None, tags: list[str] | None = None, search: str | None = None, linked_ids: Sequence[str] | None = None, as_of: str | None = None, limit: int | None = None) -> SyncPaginator[Memory]
List memories from the Memory Library with pagination and filters.
Parameters
kind(str | None, optional): Filter by kind (fact,episodic,semantic,instruction,preference).tags(list[str] | None, optional): Filter by tags (matched against the memory's tag set).search(str | None, optional): Full-text search over content, summary, and tags.linked_ids(Sequence[str] | None, optional): Only memories that belong to all of these agents and pools.as_of(str | None, optional): ISO-8601 timestamp for point-in-time recall.limit(int | None, optional): Maximum number of items to return (default: all matching items).
Returns
SyncPaginator[MemoryModel]: A paginator yieldingMemoryobjects.
create
create(*, kind: str, content: str, summary: str | None = None, tags: Sequence[str] | None = None, category: str | None = None, source: str | None = None, event_time: str | None = None, valid_from: str | None = None, valid_until: str | None = None, source_thread_id: str | None = None, source_message_id: str | None = None, source_tool_name: str | None = None, importance: float | None = None, decay_half_life_days: float | None = None, confidence: float | None = None, links: Sequence[Mapping[str, Any]] | None = None, linked_ids: Sequence[str] | None = None) -> Memory
Create a memory.
Parameters
kind(str):fact|episodic|semantic|instruction|preference(required).content(str): Memory body (required).summary(str | None, optional): Optional one-line summary.tags(Sequence[str] | None, optional): Discoverability tags.category(str | None, optional): Optional category label.source(str | None, optional): Provenance label.event_time(str | None, optional): ISO-8601 time the memory's event occurred (bitemporal).valid_from(str | None, optional): ISO-8601 start of validity.valid_until(str | None, optional): ISO-8601 end of validity (None= open-ended).source_thread_id(str | None, optional): Originating thread id.source_message_id(str | None, optional): Originating message id.source_tool_name(str | None, optional): Originating tool name.importance(float | None, optional): 0..1 retention weight.decay_half_life_days(float | None, optional): Per-row decay half-life for ranking.confidence(float | None, optional): 0..1 truth confidence.links(Sequence[Mapping[str, Any]] | None, optional): Free-form initial graph links ({targetId, relation}rows).linked_ids(Sequence[str] | None, optional): Agents and pools (ids) the memory belongs to.
Returns
MemoryModel: The createdMemory.
retrieve
retrieve(memory_id: str) -> Memory
Retrieve a single memory by id.
update
update(memory_id: str, *, kind: str | None = None, content: str | None = None, summary: str | None = None, tags: Sequence[str] | None = None, category: str | None = None, event_time: str | None = None, valid_from: str | None = None, valid_until: str | None = None, source_thread_id: str | None = None, source_message_id: str | None = None, source_tool_name: str | None = None, importance: float | None = None, decay_half_life_days: float | None = None, confidence: float | None = None, links: Sequence[Mapping[str, Any]] | None = None, linked_ids: Sequence[str] | None = None, change_note: str | None = None) -> Memory
Update a memory and return the updated record.
Content changes append a new version. linked_ids replaces the
agents and pools the memory belongs to. See create for the
per-field semantics.
delete
delete(memory_id: str) -> None
Delete a memory. Raises on failure; returns nothing.
Lifecycle & actions
promote
promote(memory_id: str) -> Memory
Put a memory in your organization's org-global pool, so every agent there reads it.
Other
add_link
add_link(memory_id: str, *, target_id: str, relation: str, weight: float | None = None) -> MemoryLink
Create a directed link from this memory to another.
Parameters
memory_id(str): Source memory id.target_id(str): Target memory id.relation(str):supports|contradicts|refines|related.weight(float | None, optional): Edge weight in [0, 1].
Returns
MemoryLink: The link now stored on the memory.
add_member
add_member(resource_id: str, *, user_id: str, role: str) -> Permissions
Share the resource with a user.
Parameters
resource_id(str): The resource's id.user_id(str): The user to share it with.role(str):"editor"(use and change it) or"user"(use it only; types without a use-only tier, such as knowledge bases, take"editor"only).
assess
assess(memory_id: str) -> dict[str, Any]
Get the memory's quality report: each check and what would raise the score.
The score itself (scoreResult) is kept on the memory by every change.
Returns the report: score (0-100) and grade over the checks
that apply, weightAwarded / weightTotal, the failed critical
and high counts, and checks. Each check has a status of
pass, fail or skipped; a skipped check does not apply to
this memory and is not part of the score.
consolidate
consolidate(*, config: Mapping[str, Any] | None = None, dry_run: bool | None = None) -> dict[str, Any]
Consolidate/deduplicate memories per the supplied policy.
Parameters
config(Mapping[str, Any] | None, optional): Free-form threshold overrides.dry_run(bool | None, optional): Return the plan without applying changes.
delete_link
delete_link(memory_id: str, target_id: str) -> None
Delete the link from memory_id to target_id.
demote
demote(memory_id: str) -> Memory
Take a memory out of the org-global pool (undo promote).
export
export(**params) -> dict[str, Any]
Export the Memory Library (optionally filtered) as a portable bundle.
import_memories
import_memories(*, memories: Sequence[Mapping[str, Any]]) -> dict[str, Any]
Bulk-import memories from an export payload, as memories owned by the caller.
Parameters
memories(Sequence[Mapping[str, Any]]): Memory rows (the free-form shapeexportemits).
Returns
dict:imported(new memories),unchanged(rows the caller already has, same content),skipped(rows refused) anderrors(indexandmessageper skipped row).
ingest
ingest(*, content: str, kind: str, tags: Sequence[str] | None = None, linked_ids: Sequence[str] | None = None, model: str | None = None, candidate_k: int | None = None) -> dict[str, Any]
Ingest raw content; an LLM decides ADD/UPDATE/DELETE/NOOP and executes it.
Parameters
content(str): The new piece of information (required).kind(str):fact|episodic|semantic|instruction|preference(required).tags(Sequence[str] | None, optional): Tags for the new row (used only when the judge picks ADD).linked_ids(Sequence[str] | None, optional): Agents and pools (ids) a new memory belongs to; the judge compares it with memories in them.model(str | None, optional): Override the judge LLM model.candidate_k(int | None, optional): How many similar memories to show the judge.
invalidate
invalidate(memory_id: str, *, superseded_by: str | None = None) -> Memory
Mark a memory as invalidated (soft-retire without deleting).
Parameters
memory_id(str): Target memory id.superseded_by(str | None, optional): Optional id of the memory that supersedes this one.
linked_to
linked_to(memory_id: str, **params) -> list[Memory]
List memories linked to the given memory.
permissions
permissions(resource_id: str) -> Permissions
Return who can reach the resource: its owner, members and their roles, and visibility.
Parameters
resource_id(str): The resource's id.
record_access
record_access(memory_id: str) -> dict[str, Any]
Record an access event against a memory (updates recency/usage).
remove_member
remove_member(resource_id: str, user_id: str) -> None
Stop sharing the resource with a user.
Parameters
resource_id(str): The resource's id.user_id(str): The user to stop sharing it with.
restore_version
restore_version(memory_id: str, version: int) -> Memory
Restore a memory to an earlier version and return the restored record.
retrieve_version
retrieve_version(memory_id: str, version: int) -> MemoryVersion
Retrieve a specific version snapshot of a memory.
search
search(*, query: str, k: int | None = None, kind: str | None = None, tags: Sequence[str] | None = None, linked_ids: Sequence[str] | None = None, rrf_k: int | None = None, weights: Mapping[str, Any] | None = None, decay_half_life_days_override: float | None = None, as_of: str | None = None, include_invalidated: bool | None = None, rerank: bool | None = None, rerank_model: str | None = None) -> dict[str, Any]
Semantic/full-text (hybrid) search over the Memory Library.
Returns the raw search envelope ({results, count, contextBlock}); use
list when you want typed, paginated results.
Parameters
query(str): Natural-language query (required).k(int | None, optional): Max results.kind(str | None, optional): Filter by memory kind.tags(Sequence[str] | None, optional): Filter by tags (OR).linked_ids(Sequence[str] | None, optional): Recall only from memories in any of these agents and pools.rrf_k(int | None, optional): RRF k constant.weights(Mapping[str, Any] | None, optional): Free-form per-list RRF weights ({vector?, text?}).decay_half_life_days_override(float | None, optional): Override per-row decay for ranking.as_of(str | None, optional): ISO-8601 point-in-time filter.include_invalidated(bool | None, optional): Include rows past their validity window.rerank(bool | None, optional): Whether to apply a rerank pass.rerank_model(str | None, optional): Override the rerank model.
set_visibility
set_visibility(resource_id: str, visibility: str) -> Permissions
Make the resource public (every user can find and use it) or private.
Parameters
resource_id(str): The resource's id.visibility(str):"public"or"private".
versions
versions(memory_id: str) -> list[MemoryVersion]
List the version history of a memory (most recent first).