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
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:
Compute confidence at read time. Do not rewrite a page each day.
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, andstale. Annotation is the default. Confidence-aware ranking remains explicit until tests measure its effect on recall.Acceptance criteria
verified_at, notcreated_ator a formatting-only update time.as_oftimestamp.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
src/wikibricks/storage/search.pysrc/wikibricks_remote/search/ranking.pysrc/wikibricks/models.py