ADR-004: Structured recall authority (M7)
Status
Section titled “Status”Accepted — implemented in astrocyte.recall.authority with RecallAuthorityConfig / RecallResult.authority_context.
Context
Section titled “Context”Fused recall (semantic + graph + keyword) returns a single ranked list. Downstream synthesis benefits from explicit precedence in the prompt: which hits are canonical vs advisory, and what rules the model must follow. This is distinct from tiered retrieval (cost/latency tiers), which remains in tiered_retrieval.
Decision
Section titled “Decision”-
Configuration (
AstrocyteConfig.recall_authority):enabled, optionalrules_inlineorrules_path(UTF-8 file;rules_inlinewins when both are set at format time).tiers: ordered bands{ id, priority, label }. Lowerpriorityvalues appear first in the formatted block.apply_to_reflect(default true): when enabled, pipeline /Astrocyte.reflectprepends the formatted authority block to the synthesis user message inside<authority_context>(before<memories>). Set to false to keepauthority_contextonly onRecallResultfor callers that merge prompts themselves.tier_by_bank: optional mapbank_id → tier idused at retain time to setmetadata["authority_tier"]on stored vectors.extraction_profiles.*.authority_tieroverrides this when the retain request names a profile.
-
Hit labeling: Producers attach
metadata["authority_tier"]onMemoryHit(string matchingtier.id). Unmatched hits are listed under[UNASSIGNED]. -
Runtime — recall: After DLP scanning on
Astrocyte.recall, when enabled,apply_recall_authoritysetsRecallResult.authority_context. -
Runtime — reflect: Tier-1
PipelineOrchestrator.reflectand multi-bankAstrocyte.reflectapply the same formatter whenapply_to_reflectis true and pass the string intosynthesize.ReflectResult.authority_contextechoes that block for tools and UIs. Tier-2 engine nativereflectis unchanged (no automatic injection); use pipeline reflect or keyword-only flows if you need authority in synthesis.
Consequences
Section titled “Consequences”- Phase 1 (current): One fused
RecallResult; authority only formats and labels hits already present. - Future: Per-tier retrieval or multi-query recall can populate tiers without changing the formatter contract, as long as hits carry
authority_tier.
Token budget
Section titled “Token budget”authority_context adds prompt tokens (tier labels, rules text, and per-hit lines). Size scales with hit count and label verbosity. Combine with homeostasis limits, reflect_max_tokens, and recall detail_level so synthesis stays within budget; there is no separate automatic truncation of the authority block today.
Related
Section titled “Related”docs/_design/built-in-pipeline.md— retrieval strategies.docs/_design/product-roadmap-v1.md— M7.