Skip to main content
Cognis organizes memory using three scope identifiers: 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 a session_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 an owner_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 only owner_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 including agent_id. This prevents facts from a support agent leaking into a sales agent’s context for the same user.

Scope combinations

At least one identifier is required. Providing all three gives the narrowest scope and is recommended for production agents with multiple users and multiple agent types.

Next steps