owner_id, agent_id, and session_id. You provide at least one of these when adding or searching memories. The combination determines which memories are stored together and retrieved together.
Session memory
Session memory is scoped to a single conversation by providing asession_id. Facts added within a session are retrievable by that session identifier. Use session memory when you want the agent to maintain context across turns in one conversation but not carry it into future sessions.
Long-term memory
Long-term memory is scoped to a user or agent rather than a specific session. Facts added with only anowner_id are retrievable in any future session for that user, making them available whenever the user returns.
Cross-session memory
Cross-session memory spans multiple sessions for the same user. By searching with onlyowner_id, Cognis returns relevant facts regardless of which session they were created in. This is useful for agents that handle repeat users and need continuity without knowing the specific session a fact came from.
Agent-scoped memory
You can isolate memories per agent by includingagent_id. This prevents facts from a support agent leaking into a sales agent’s context for the same user.
Scope combinations
owner_id | agent_id | session_id | Scope |
|---|---|---|---|
| Yes | No | No | All sessions for a user across all agents |
| Yes | Yes | No | All sessions for a user on a specific agent |
| Yes | No | Yes | A single session for a user |
| Yes | Yes | Yes | A single session for a user on a specific agent |
Next steps
- Add Memories: store conversation messages with scope identifiers.
- Search Memories: query across session, user, or agent scope.
- Get Memories: retrieve stored memory records directly.