Skip to main content
The search method performs a hybrid semantic search across stored memories and returns the most relevant results ranked by score. Call it before generating a response to give your agent relevant context from prior conversations.

Method signature

At least one of owner_id, agent_id, or session_id must be provided.

Parameters

Response

Returns a List[CognisSearchResult]. Each result has the following fields:

Basic usage

Narrow results by combining scope identifiers.
Search across all sessions for an owner by setting cross_session=True.

Limiting results

Async usage

Write queries as natural language questions for best results. For example, "What is the user's favorite color?" retrieves more relevant results than a bare keyword like "favorite color".