Skip to content

Project-scoped memory surfacing: penalize low-generalizability cross-project #358

@toejough

Description

@toejough

Context

Memories are currently global — surfaced in all projects regardless of origin. With the generalizability gating work (spec: docs/superpowers/specs/2026-03-22-generalizability-gating-design.md), each memory will now store project_slug (originating project) and generalizability (1-5 score).

Problem

A memory with generalizability=2 ("useful in this project but narrow") gets surfaced everywhere, including projects where it's irrelevant. This wastes context window tokens and creates noise.

Proposed approach

When surfacing memories, apply a penalty to the relevance score for memories originating from a different project:

  • generalizability 5 (universal): no penalty
  • generalizability 4 (similar projects): small penalty
  • generalizability 3 (this project): moderate penalty
  • generalizability 2 (narrow): large penalty

This is a continuous curve, not a binary project-specific vs. global gate. The exact penalty weights should be tunable.

Prerequisites

  • Generalizability gating must be implemented first (memories need project_slug and generalizability fields populated)
  • Current project slug must be available at surfacing time

Related

  • Spec: docs/superpowers/specs/2026-03-22-generalizability-gating-design.md (section: "What this does NOT cover")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions