Skip to main content
The get_messages() method retrieves the original conversation messages stored via add(). Unlike get() which returns extracted memory records, this returns the raw user/assistant message pairs.

Basic Usage

Parameters

Use Cases

Conversation replay — Show a user their previous conversation:
Latest context — Get the most recent messages for prompt injection:
Cross-session history — Pull messages from all sessions:

Async

get_messages() is hosted-only. In the open-source lyzr-cognis package, raw messages are stored in SQLite and accessible via get_context() as part of the short-term memory.