Cognis provides two methods for retrieving memories:Documentation Index
Fetch the complete documentation index at: https://docs.lyzr.ai/llms.txt
Use this file to discover all available pages before exploring further.
get() lists all memories with pagination support, and get_memory() fetches a single memory by its ID.
List All Memories
- Hosted (lyzr-adk)
- Open Source (lyzr-cognis)
get() Method Signature
get() Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
owner_id | str | No* | Filter by owner/user identifier. |
agent_id | str | No* | Filter by agent identifier. |
session_id | str | No* | 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. |
*At least one of
owner_id, agent_id, or session_id must be provided.CognisMemoryList Response
get() returns a CognisMemoryList object that is iterable and supports len():
CognisMemoryRecord Fields
Each memory in the list is a 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. |
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. |
Get a Single Memory
Retrieve a specific memory by its ID:get_memory() Method Signature
get_memory() Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
memory_id | str | Yes | The ID of the memory to retrieve. |
owner_id | str | No | Owner identifier for additional scoping. |
Pagination
Uselimit and offset to paginate through large result sets: