Skip to content

fix: support multiple memory_types in search API#109

Open
Jah-yee wants to merge 1 commit intoEverMind-AI:mainfrom
Jah-yee:fix/multiple-memory-types-search
Open

fix: support multiple memory_types in search API#109
Jah-yee wants to merge 1 commit intoEverMind-AI:mainfrom
Jah-yee:fix/multiple-memory-types-search

Conversation

@Jah-yee
Copy link

@Jah-yee Jah-yee commented Mar 2, 2026

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 uses memory_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 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

Test Cases

  1. memory_types=episodic_memory,foresight now searches both types
  2. memory_types=profile,episodic_memory - profile is skipped with info log, episodic_memory is searched
  3. Results are deduplicated across all searched types

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant