Hotfix: retrieve_memory MemoryQueryResult Serialization
This hotfix release resolves a critical serialization error in the retrieve_memory MCP tool introduced in v8.19.1.
Fixed
- retrieve_memory MCP tool: Fixed MemoryQueryResult serialization error (Issue #211)
- Extract Memory object from MemoryQueryResult before formatting response
- Add similarity_score to response for consistency with recall_memory
- Affects all backends (sqlite-vec, cloudflare, hybrid)
- Thanks @VibeCodeChef for detailed testing and reproduction!
What Changed
Problem: The retrieve_memory tool was returning MemoryQueryResult wrapper objects instead of serializable dictionaries, causing "Object of type MemoryQueryResult is not JSON serializable" errors.
Solution: Extract the underlying Memory object from MemoryQueryResult before formatting the response, and include the similarity score for consistency with recall_memory behavior.
Impact
- All backends (sqlite-vec, cloudflare, hybrid) are affected
- Any client using
retrieve_memorytool should upgrade immediately - No migration or configuration changes required
Files Changed
src/mcp_memory_service/server.py: Updatedhandle_retrieve_memoryto extract Memory from MemoryQueryResult
Testing
Verified with:
- SQLite-vec backend: memory retrieval operations working
- Cloudflare backend: serialization confirmed
- Hybrid backend: both local and cloud operations verified
Release Velocity
Completed in ~8 minutes from bug report to release, demonstrating the velocity powered by AI pair programming with Claude Code!
Full Changelog: v8.20.0...v8.20.1
Related Issue: #211 (waiting for user confirmation before closure)