add method stores conversation messages in Cognis memory. The extraction layer automatically pulls discrete facts, preferences, and context from the messages and indexes them as searchable memory records.
Method signature
owner_id, agent_id, or session_id must be provided.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
messages | List[Dict[str, str] | CognisMessage] | Yes | Conversation messages. Each message must have role ("user" or "assistant") and content keys. |
owner_id | str | Conditional | User or owner identifier for memory scoping. |
agent_id | str | Conditional | Agent identifier for memory scoping. |
session_id | str | Conditional | Session identifier for memory scoping. |
Response
Basic usage
- Hosted (lyzr-adk)
- Open Source (lyzr-cognis)
Using CognisMessage objects
UseCognisMessage instead of plain dictionaries for type safety.