Skip to content

Add age-aware confidence to maintained memory #2

Description

@philtief

Use case

The current search score measures text relevance. It does not state whether a memory is still reliable. An old operational note can rank above a recent correction even when the product, account, or process has changed.

Age is not enough on its own. A historical session remains valid evidence of what happened. A stable definition can remain useful for years. A maintained page about an API or active project can become stale within weeks.

Proposed API

Add optional trust metadata to maintained pages:

wiki.write_page(
    "topics/genie-code",
    title="Genie Code",
    content={"summary": "...", "body": "..."},
    confidence=0.9,
    verified_at="2026-09-03T00:00:00Z",
    half_life_days=90,
)

wiki.search("Genie Code MCP", freshness="annotate", as_of="2026-12-02T00:00:00Z")

Compute confidence at read time. Do not rewrite a page each day.

effective_confidence = confidence * 2 ** (-age_days / half_life_days)

A null half-life means no decay. Policy can set defaults by page type, path prefix, or tag. Raw sessions do not decay because they are immutable evidence.

Search and read results expose confidence, effective_confidence, verified_at, age_days, and stale. Annotation is the default. Confidence-aware ranking remains explicit until tests measure its effect on recall.

Acceptance criteria

  • Decay uses verified_at, not created_at or a formatting-only update time.
  • The calculation is deterministic for an injected as_of timestamp.
  • A null policy preserves the current ranking and result contract.
  • Stable pages and raw sessions can opt out of decay.
  • Search can annotate or rerank by effective confidence.
  • Local maintenance reports pages below a configured confidence threshold.
  • Local, archive, and Lakebase sync paths preserve the trust metadata.
  • Tests cover monotonic decay, no-decay pages, verification resets, and clock boundaries.

Alternatives considered

A global recency boost mixes relevance with reliability and penalizes durable knowledge. Daily confidence updates create needless writes and weaken auditability. A binary stale flag loses useful information near the threshold.

Additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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