fix: support multiple memory_types in search API#109
Open
Jah-yee wants to merge 1 commit intoEverMind-AI:mainfrom
Open
fix: support multiple memory_types in search API#109Jah-yee wants to merge 1 commit intoEverMind-AI:mainfrom
Jah-yee wants to merge 1 commit intoEverMind-AI:mainfrom
Conversation
Fixes EverMind-AI#78: Search API now iterates over all requested memory_types instead of only using the first one. Changes: - get_keyword_search_results: now iterates over all supported memory_types (EPISODIC_MEMORY, EVENT_LOG, FORESIGHT) and merges results with deduplication - get_vector_search_results: now iterates over all supported memory_types and merges results with deduplication - For unsupported types (e.g., profile which is stored in MongoDB), logs an info message and skips instead of erroring out Behavior: - When multiple memory_types are provided, all supported types are searched - Results are merged and deduplicated by id - The first memory_type is still used for metrics/logging purposes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes Issue #78: Search API only uses memory_types[0], silently ignoring all other types
What broke?
The search API accepts a list of
memory_types, but the retrieval logic only usesmemory_types[0]. All other types in the list are silently ignored.Changes
get_keyword_search_results: now iterates over all supported memory_types (EPISODIC_MEMORY, EVENT_LOG, FORESIGHT) and merges results with deduplicationget_vector_search_results: now iterates over all supported memory_types and merges results with deduplicationBehavior
Test Cases
memory_types=episodic_memory,foresightnow searches both typesmemory_types=profile,episodic_memory- profile is skipped with info log, episodic_memory is searched