feat: era-rollup + narrative engine (consolidation steps 3-4)

Complete the consolidation pipeline: summaries -> profile + eras -> narrative.

- memory: eras table (per-month digests) + Era, summaries_by_month, store_era,
  list_eras, recall_eras; narrative table + set/get_narrative
- lyra/era.py (lyra-era): groups session gists by the month the session occurred
  (real timestamps) and map-reduces each month into a "what was happening" digest
- lyra/narrative.py (lyra-narrative): distills profile + recent eras into the
  current arc/trends/callbacks ("remember when…", "you're trending toward…")
- chat.build_messages injects the narrative alongside the profile

Verified on the real corpus: 17 monthly eras (Dec 2024-Jun 2026) + a narrative
that surfaces specific callbacks (the $573 Hollywood session, 4 years sober).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-16 19:28:01 +00:00
parent d7e2fce694
commit bfb81428ab
5 changed files with 277 additions and 0 deletions
+2
View File
@@ -19,6 +19,8 @@ lyra-web = "lyra.web.server:serve"
lyra-import = "lyra.ingest:main"
lyra-summarize = "lyra.summary:main"
lyra-profile = "lyra.profile:main"
lyra-era = "lyra.era:main"
lyra-narrative = "lyra.narrative:main"
[dependency-groups]
dev = [