Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

Merge PR #686: OpenRouter app-attribution headers by default (#686)

AkitaOnRails029eaad6f6a4
diff --cc CHANGELOG.md
index fd8c2f6e,6087a19c..67467fbe
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -8,58 -8,12 +8,64 @@@ and this project adheres to [Semantic V
## [Unreleased]
### Added
+- Page-grain ingestion windows (`pages.valid_from` / `valid_to`, V62) and
+ a second `as_of` stream: `memory_query(as_of=T)` now fuses the entity
+ timeline with version-filtered full-text search over the page versions
+ alive at T, using the default path's RRF (k=60) plus the same bounded
+ authority adjustment — current-index relevance over knowledge valid at T. This
+ answers entity-less pages and paraphrased audit questions ("which
+ database were we on during the outage?") that the entity-only lookup
+ missed. `explain=true` reports both streams (`streams_active:
+ ["entity", "fts"]`) with per-stream ranks and RRF contributions.
+ Vector, graph, and the raw-observation fallback stay out of audit mode;
+ the default (no `as_of`) path is unchanged. Every retire path
+ (supersede, decay, reorg graveyard, move-regenerate) closes both grains
+ in the same transaction, and the V62 backfill closes successor-less
+ retirements at the decay marker, existing entity-link close, or
+ `updated_at` fallback, preserving recorded reorg/move history.
+ Phase B world-time stays deferred. (#656)
+- `[retrieval]` section with two opt-in ranking signals, both off by default
+ so unconfigured stores rank exactly as before. `query_intent` routes
+ lexically session-recall queries ("上次 / 之前那次…的会话 / last time /
+ yesterday …") past the default session-page authority penalty
+ (×0.77 combined kind/tier), with `session_recall_bonus` (default 0.25)
+ sizing the lift; `abstract_vectors` adds a fifth RRF stream over the new
+ `page_abstract_embeddings` table (V61) — the L0 layer: a page's
+ frontmatter `abstract:` line is embedded on its own, at write time when an
+ embedder is attached and by the same backfill as the body otherwise
+ (a one-line summary embeds far more sharply than a
+ multi-thousand-character body). Measured on a 138-query golden set over a
+ production two-year wiki (FTS5 + entity + vector + graph, mis-tei
+ Qwen3-Embedding-8B): hit@1 0.609 → 0.746 (+22%), NDCG@10 0.782 → 0.879
+ (+12%) with both enabled; every unrouted category keeps its exact
+ baseline ordering. Cross-checked on an independently built 99-query
+ golden set against the same store: hit@1 0.556 → 0.626, NDCG@10
+ 0.712 → 0.779 (+9.4%). Both signals are visible per hit in
+ `memory_query(explain=true)` (`intent`, `intent_boost`,
+ `abstract_rank`, `rrf.abstract`). (#672)
+- `memory_handoff_list` lets no-stdout and MCP-only clients inspect open
+ project handoffs without claiming or expiring them, then
+ `memory_handoff_accept` can claim that exact `handoff_id` once. Grok,
+ Zero, and other clients that discard SessionStart stdout no longer have
+ to recover a baton by blindly accepting the latest row. Listing is
+ owner-filtered like accept (own plus shared; root-only `any_owner`);
+ it is not a second claim path, and Grok SessionStart still does not
+ fetch `/handoff`. (#664)
+- `install-instructions --compact` writes a slimmer managed routing block for
+ projects that already have the detailed ai-memory Agent Skills installed. The
+ compact block keeps the same start/end markers (so refresh/uninstall still
+ find it), the untrusted-history security scaffold, and the cross-harness
+ memory-of-record guidance; `full_block` and the default remain unchanged.
+ (#675)
+- `memory_install_self_routing` accepts `compact: Option<bool>` so agent-driven
+ refreshes of a compact-installed file preserve the compact routing block
- instead of rewriting it back to full.
++ instead of rewriting it back to full. (#685)
+ - The `openai-compat` provider now sends OpenRouter's app-attribution
+ headers (`HTTP-Referer`, `X-Title`) by default when its base URL points
+ at `openrouter.ai`, so ai-memory's usage shows up on OpenRouter's app
+ leaderboard. An explicit `AI_MEMORY_LLM_HEADERS` entry for either header
+ still wins, and a non-OpenRouter compat endpoint (Ollama, vLLM, LM
- Studio) never receives them.
++ Studio) never receives them. (#686)
### Changed
- The managed routing snippet now states that Claude Code loads `CLAUDE.md` and