Single-User Temporal Memory foundation - #67
Conversation
|
@codex review pwease. Don't nitpick. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 46dd1f422f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review pwease. Don't nitpick. |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…baseline # Conflicts: # docs/architecture/README.md
|
@codex review pwease. Don't nitpick. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d78a4ccb8f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review pwease. Don't nitpick. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48bb32d702
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review pwease. Don't nitpick. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50bc3293b4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review pwease. Don't nitpick. |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
* memory: add evidence audit and episode quality safeguards * SUM-003 temporal knowledge graph v2 (#70) * memory: add temporal knowledge graph v2 * memory: fix temporal kg review regressions * api: filter superseded graph relations * db: repair legacy kg schema columns * memory: preserve kg alias reads and confidence * memory: resolve kg context aliases * memory: resolve kg alias pruning * memory: filter kg pruning candidates * db: guard legacy kg downgrade * memory: prevent kg self supersession * SUM-004 structured user profile (#71) * memory: add structured user profile * memory: address profile review feedback * memory: invalidate profile cache after forget * memory: hard-delete forgotten profile state * memory: preserve profile fields with surviving evidence * memory: link profile forget cleanup to runtime provenance * memory: narrow runtime profile forget provenance * memory: preserve manual profile corrections * memory: reject forgotten profile candidates * memory: canonicalize profile corrections * memory: narrow profile claim reconciliation * memory: tighten profile forget matching * memory: preserve profile vault state * memory: dedupe claim profile reconciliation * memory: restore profile vault links safely * memory: delete profile evidence on forget * memory: preserve newer profile reconciliation * memory: return bad request for blank profile corrections * memory: preserve profile candidate timestamps * memory: scope profile forget cleanup * memory: prioritize profile prompt block * memory: truncate profile prompt lines * memory: restore prior profile on forget
* memory: add salience-aware decay * memory: address salience review comments * memory: refresh heat after salience reinforcement * memory: preserve neutral salience heat defaults * memory: preserve duplicate candidate salience * memory: refresh promoted duplicate candidate evidence * memory: preserve candidate audit history * memory: repair legacy salience schema * memory: rebase salience migrations * memory: preserve zero evidence strength restore * memory: update duplicate reinforcement test * memory: mark reinforced candidates distinctly * memory: treat reinforced candidates as terminal
* memory: synthesize cross-episode patterns * memory: tighten pattern synthesis prompt wording * docs: record SUM-007 full-suite result * memory: skip duplicate pattern evidence * memory: decrypt pattern episode arcs * memory: address pattern synthesis review * memory: clean stale pattern synthesis references * memory: clean deleted pattern indexes * memory: decrypt pattern evidence for forget cleanup * memory: delete derived pattern evidence
* memory: add foresight and procedural learning * memory: fix foresight review regressions * memory: address foresight and skill review follow-ups * memory: fix foresight extraction and cluster state review * memory: prioritize dated foresight in prompts * memory: address timezone and resume review * memory: use local dates for foresight views * memory: redact procedural tool outputs * memory: address foresight and procedural review * memory: cover vault review fixes * memory: tighten foresight cancellation matching
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36d4184488
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85344a7435
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd75e712a9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acdb0db8d9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
* memory: baseline temporal memory audit * memory: address baseline review feedback * memory: reset kg vault restore sequences * memory: fix default sleep cursor runtime factory * memory: guard sleep cursor on candidate backlog * memory: include extraction failures in sleep cursor guard * SUM-002 evidence baseline and episode quality (#68) * memory: add evidence audit and episode quality safeguards * SUM-003 temporal knowledge graph v2 (#70) * memory: add temporal knowledge graph v2 * memory: fix temporal kg review regressions * api: filter superseded graph relations * db: repair legacy kg schema columns * memory: preserve kg alias reads and confidence * memory: resolve kg context aliases * memory: resolve kg alias pruning * memory: filter kg pruning candidates * db: guard legacy kg downgrade * memory: prevent kg self supersession * SUM-004 structured user profile (#71) * memory: add structured user profile * memory: address profile review feedback * memory: invalidate profile cache after forget * memory: hard-delete forgotten profile state * memory: preserve profile fields with surviving evidence * memory: link profile forget cleanup to runtime provenance * memory: narrow runtime profile forget provenance * memory: preserve manual profile corrections * memory: reject forgotten profile candidates * memory: canonicalize profile corrections * memory: narrow profile claim reconciliation * memory: tighten profile forget matching * memory: preserve profile vault state * memory: dedupe claim profile reconciliation * memory: restore profile vault links safely * memory: delete profile evidence on forget * memory: preserve newer profile reconciliation * memory: return bad request for blank profile corrections * memory: preserve profile candidate timestamps * memory: scope profile forget cleanup * memory: prioritize profile prompt block * memory: truncate profile prompt lines * memory: restore prior profile on forget * SUM-006 add salience-aware decay and soft evolution (#75) * memory: add salience-aware decay * memory: address salience review comments * memory: refresh heat after salience reinforcement * memory: preserve neutral salience heat defaults * memory: preserve duplicate candidate salience * memory: refresh promoted duplicate candidate evidence * memory: preserve candidate audit history * memory: repair legacy salience schema * memory: rebase salience migrations * memory: preserve zero evidence strength restore * memory: update duplicate reinforcement test * memory: mark reinforced candidates distinctly * memory: treat reinforced candidates as terminal * SUM-007 Cross-episode pattern synthesis (#76) * memory: synthesize cross-episode patterns * memory: tighten pattern synthesis prompt wording * docs: record SUM-007 full-suite result * memory: skip duplicate pattern evidence * memory: decrypt pattern episode arcs * memory: address pattern synthesis review * memory: clean stale pattern synthesis references * memory: clean deleted pattern indexes * memory: decrypt pattern evidence for forget cleanup * memory: delete derived pattern evidence * SUM-008 Foresight signals and procedural skill memory (#77) * memory: add foresight and procedural learning * memory: fix foresight review regressions * memory: address foresight and skill review follow-ups * memory: fix foresight extraction and cluster state review * memory: prioritize dated foresight in prompts * memory: address timezone and resume review * memory: use local dates for foresight views * memory: redact procedural tool outputs * memory: address foresight and procedural review * memory: cover vault review fixes * memory: tighten foresight cancellation matching * memory: add optional retrieval adapter seams (#78) * memory: add memory v2 package boundary * memory: rename package boundary * memory: add retrieval router plans * docs: plan memory package boundary hardening * memory: clean durable rows on reset and forget * docs: add memory architecture diagrams * memory: align salience evidence contract * memory: narrow foresight forget cleanup * vault: defer kg relation self-links on import
## Summary
search_long_memory(mode="auto"), and focused route accuracy regressions.anima_server.services.memorypackage boundary with domain contracts, salience/retrieval facades, temporal helpers, package-boundary tests, and architecture references.Architecture snapshot
flowchart TD User["User turn"] --> Agent["Agent runtime"] Agent --> Extract["Memory extraction and consolidation"] Extract --> Evidence["Evidence anchors"] Evidence --> SQLCipher["Canonical SQLCipher soul DB"] subgraph Contract["Shared contract boundary"] Core["packages/anima-core"] PyMemory["anima_server.services.memory"] Fixtures["Parity fixtures and tests"] Core --> Fixtures PyMemory --> Fixtures end subgraph Durable["Durable memory records"] Claims["Temporal facts / MemoryClaim"] Graph["Temporal relationships / KGRelation"] Items["MemoryItem and episodes"] Semantics["Salience, stability, decay semantics"] Patterns["Cross-episode patterns"] Foresight["ForesightSignal"] Procedural["AgentExperience, clusters, skills"] end SQLCipher --> Claims SQLCipher --> Graph SQLCipher --> Items SQLCipher --> Semantics SQLCipher --> Patterns SQLCipher --> Foresight SQLCipher --> Procedural Extract --> Claims Extract --> Graph Extract --> Items Extract --> Foresight Agent --> Procedural subgraph Sleep["Sleep and background cognition"] PatternSynth["Pattern synthesis"] ForesightSweep["Foresight lifecycle sweep"] SkillDistill["Experience clustering and skill distillation"] Decay["Salience-aware decay"] end Items --> PatternSynth --> Patterns Foresight --> ForesightSweep --> Foresight Procedural --> SkillDistill --> Procedural Semantics --> Decay --> Items subgraph Recall["Recall path"] Query["Memory query"] Router["Retrieval router"] Plan["Intent-specific query plan"] Lanes["Profile, graph, episodes, transcripts, foresight, skills"] Trace["Recall trace and score breakdown"] end Agent --> Query --> Router --> Plan --> Lanes Claims --> Lanes Graph --> Lanes Items --> Lanes Patterns --> Lanes Foresight --> Lanes Procedural --> Lanes Lanes --> Trace --> Prompt["Fenced memory prompt blocks"] Prompt --> Agent subgraph Cleanup["Privacy and eval cleanup"] Forget["User forget"] EvalReset["Eval reset"] end Forget --> Claims Forget --> Items Forget --> Foresight EvalReset --> Claims EvalReset --> Graph EvalReset --> Items EvalReset --> Foresight EvalReset --> ProceduralAffected areas
apps/server: memory retrieval, retrieval router plans, retrieval backend seams, sleep-time consolidation, evidence/provenance, episodes, temporal KG, structured profile, salience/heat scoring, pattern synthesis, foresight signals, procedural experience memory, prompt rendering/budgeting, agent post-turn hooks, forgetting, vault, API routes, and Alembic migrations.packages/anima-core: additive shared memory contract types for temporal record status, endpoint kinds, salience classes, recall score breakdowns, temporal facts, and temporal relationships.apps/server/testsandpackages/anima-core/tests: deterministic baseline, multilingual retrieval, retrieval rebuild contracts, evidence, episode, KG, profile, salience, pattern synthesis, foresight, procedural experience, router/package-boundary, Rust memory contract, agent service hooks, forgetting, vault, runtime DB, and review-regression coverage.docs/architecture/memory,docs/prds/memory,tickets/single-user-temporal-memory-v2: baseline audit docs, optional adapter documentation, package-boundary documentation, and completed child-ticket tracker updates.Validation
test_sleep_agent.py20 passed; focused memory/vault/BM25/baseline suite 74 passed;bun run lintpassed;bun run buildpassed.apps/server/tests/test_forgetting.py33 passed, andbun run lint:serverpassed.test_foresight.py+test_agent_experience.py8 passed, adjacent agent/prompt/sleep/service set 64 passed, full backendtest:server -- --maxfail=1 -q1775 passed and 1 skipped,bun run lint:serverpassed,bun run buildpassed,bun run db:server:headsreported20260703_0002 (head), and health smoke forGET /healthreturned 200 ok.memory_itemscan reach metadata repair; this addressed the earlier SUM-007 full-suite failure path.test_memory_retrieval_rebuild.py8 passed, adjacent BM25/hybrid retrieval suite 25 passed,bun run lint:serverpassed,git diff --checkpassed,bun run buildpassed after fresh worktree dependency install, and FastAPIGET /healthsmoke returned 200 ok.bun run lint:serverpassed,git diff --checkpassed with CRLF notices only,bun run build:serverpassed, and rename checks found noservices.memory_v2package references.cargo test -p anima-core memory_contract4 passed, fullcargo test -p anima-corepassed, touched Rust files passedrustfmt --check,bun run lint:serverpassed,bun run build:serverpassed,bun run db:server:currentpassed,git diff --checkpassed with CRLF notices only, and temporary-data FastAPIGET /healthreturned 200 ok.Notes
done; every child ticket from SUM-001 through SUM-011 is marked complete.MemoryItemandMemoryItemEvidencestorage withcategory=patternandsource=pattern_synthesis; no schema migration was required.Memory package boundary follow-up planning
memory-package-boundary, for hardening theservices.memoryownership boundary after this foundation lands.docs/superpowers/plans/2026-07-03-memory-package-boundary-hardening.mdand MPB-000 through MPB-007 tickets.