Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions V0/agent_memory_server/long_term_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -1434,6 +1434,10 @@ async def search_long_term_memories(
# preserve the literal text for lexical matching.
search_query = text
optimized_applied = False

if optimize_query and search_mode != SearchModeEnum.SEMANTIC:
logger.warning(f"optimize_query=True is only supported for semantic search, but search_mode='{search_mode.value}'")

if optimize_query and text and search_mode == SearchModeEnum.SEMANTIC:
search_query = await optimize_query_for_vector_search(text)
optimized_applied = True
Expand Down