Summary
Add an optional recency boost to search_memories / POST /api/v1/memories/search so that, among semantically similar results, more recently created/updated memories rank higher.
Idea from OB1
OB1 ships a schemas/recency-boosted-match-thoughts schema — search matching that blends vector similarity with recency so stale memories don't crowd out fresh, relevant context.
Why it fits memserv
- Pure search-layer enhancement in
app/mcp_server.py / app/rest.py; doesn't touch the Memory singleton or storage invariants.
- For a personal memory store, "what did I decide recently" is a common intent that pure cosine similarity handles poorly.
Proposed approach
- After mem0 returns ranked results, re-score with a tunable blend:
final = α * similarity + (1 - α) * recency_decay(created_at/updated_at).
- Expose an opt-in param (e.g.
recency_weight, default 0 = current behavior) on both REST and MCP search.
- mem0 results include timestamps in the payload; compute decay (e.g. exponential with a configurable half-life) over those.
Notes / scope
Keep it opt-in and default-off so existing behavior is unchanged. No collection/dimension changes.
Source: https://github.com/NateBJones-Projects/OB1/tree/main/schemas
Summary
Add an optional recency boost to
search_memories/POST /api/v1/memories/searchso that, among semantically similar results, more recently created/updated memories rank higher.Idea from OB1
OB1 ships a
schemas/recency-boosted-match-thoughtsschema — search matching that blends vector similarity with recency so stale memories don't crowd out fresh, relevant context.Why it fits memserv
app/mcp_server.py/app/rest.py; doesn't touch theMemorysingleton or storage invariants.Proposed approach
final = α * similarity + (1 - α) * recency_decay(created_at/updated_at).recency_weight, default 0 = current behavior) on both REST and MCP search.Notes / scope
Keep it opt-in and default-off so existing behavior is unchanged. No collection/dimension changes.
Source: https://github.com/NateBJones-Projects/OB1/tree/main/schemas