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
owner_id, agent_id, or session_id must be provided.
Parameters
Response
Returns aList[CognisSearchResult]. Each result has the following fields:
Basic usage
- Hosted (lyzr-adk)
- Open Source (lyzr-cognis)
Filtered search
Narrow results by combining scope identifiers.Cross-session search
Search across all sessions for an owner by settingcross_session=True.
Limiting results
Async usage
"What is the user's favorite color?" retrieves more relevant results than a bare keyword like "favorite color".