get() lists all memories matching a scope with pagination support, and get_memory() fetches a single memory record by its ID.
List all memories
Method signature
owner_id, agent_id, or session_id must be provided.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
owner_id | str | Conditional | Filter by owner or user identifier. |
agent_id | str | Conditional | Filter by agent identifier. |
session_id | str | Conditional | Filter by session identifier. |
limit | int | No | Maximum number of memories to return. |
offset | int | No | Number of records to skip, for pagination. |
include_historical | bool | No | Include previous versions of updated memories. |
cross_session | bool | No | Retrieve memories across all sessions for the owner. |
Response
get() returns a CognisMemoryList object. It is iterable, supports len(), and supports index access.
CognisMemoryRecord with the following fields:
| Field | Type | Description |
|---|---|---|
id | str | Memory record ID. |
content | str | The memory content. |
owner_id | str | None | Owner identifier. |
agent_id | str | None | Agent identifier. |
session_id | str | None | Session identifier. |
status | str | None | Memory status. |
is_current | bool | None | Whether this is the current version. |
version | int | None | Version number. |
salience_score | float | None | Importance score assigned by the extraction layer. |
decay_score | float | None | Temporal decay score. |
metadata | Dict | None | Additional metadata. |
created_at | str | None | Creation timestamp. |
updated_at | str | None | Last update timestamp. |
Basic usage
- Hosted (lyzr-adk)
- Open Source (lyzr-cognis)
Pagination
Uselimit and offset to page through large result sets.
Include historical versions
Setinclude_historical=True to retrieve previous versions of memories that have been updated.
Get a single memory
Retrieve one memory record by its ID.Method signature
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
memory_id | str | Yes | The ID of the memory record to retrieve. |
owner_id | str | No | Owner identifier for additional scoping. |