-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Currently, the SQLiteLTMStore lacks implementation for content-based search functionality, which causes failures when trying to use search_by_content() method in the memory system. This causes the memory retrieval demo to fail or require error handling workarounds.
Current Behavior
When memory_system.search_by_content() is called with a SQLite backend, an AttributeError is thrown because the method is not implemented in the SQLiteLTMStore class.
Expected Behavior
The SQLiteLTMStore should implement content-based search capability to allow searching through stored memories based on text content, with proper embedding support.
Proposed Solution
Implement a search_by_content method in the SQLiteLTMStore class that:
- Accepts a search query and optional parameters (k, threshold)
- Leverages text embeddings to find semantically similar content
- Returns memories ranked by relevance
Implementation Details
Suggested approach:
- Add a new column for embeddings in the SQLite schema
- When storing memories, calculate and store embeddings for the content
- Implement vector similarity search (cosine similarity) within SQLite
- Consider using SQLite extensions like sqlite-vss or implement a basic vector similarity calculation
- Return results sorted by similarity score
Related Components
memory/stores/sqlite_ltm_store.py- Needs to be modifiedmemory/memory_system.py- May need updates for consistent interface
Acceptance Criteria
search_by_content()works with SQLite backend without errors- Relevant test cases are added
- The memory retrieval demo runs successfully with content-based search
- Performance is acceptable for reasonably sized memory stores
Additional Notes
This would complete the full feature parity between different storage backends and make the memory system more robust.