Skip to content

Recency-boosted search ranking option #53

@imonroe

Description

@imonroe

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions