Skip to content

Implement Memory V2 foundations for Octopal#34

Merged
pmbstyle merged 6 commits intomainfrom
memory-v2-plan
Apr 8, 2026
Merged

Implement Memory V2 foundations for Octopal#34
pmbstyle merged 6 commits intomainfrom
memory-v2-plan

Conversation

@pmbstyle
Copy link
Copy Markdown
Owner

@pmbstyle pmbstyle commented Apr 7, 2026

Summary

This PR upgrades Octopal's memory system in a backward-compatible way.

It adds the first complete Memory V2 foundation:

  • typed memory enrichment on stored entries
  • facet-aware memory retrieval
  • a temporal facts layer
  • a reflection diary for reset continuity
  • user-facing memory docs refresh

The changes are additive and do not require recreating the agent or wiping existing memory.

What Changed

Typed memory enrichment

Memory entries now get lightweight high-level facets in metadata when possible, such as:

  • decision
  • preference
  • milestone
  • problem
  • emotional
  • fact_candidate

This improves retrieval quality without changing the existing memory storage model.

Facet-aware retrieval

Prompt assembly now prefers memory entries that match the inferred type of the current request when relevant, while preserving fallback behavior to the previous retrieval path.

Temporal facts layer

Added a new facts layer in SQLite for compact current-state recall.

This supports:

  • candidate facts from raw memory
  • verified facts synced from canon
  • fact invalidation/history instead of destructive replacement
  • provenance tracking

Reflection diary

Added a separate reflection diary for Octo continuity.

This is used for:

  • recording reset continuity
  • wake-up context after reset
  • preserving momentum without mixing reflection into canon

Prompt integration

Prompt assembly now has support for:

  • compact facts context when relevant
  • reflection context on wake-up after reset

This is intentionally selective to avoid prompt bloat.

CLI visibility

octopal memory stats now includes:

  • fact counts
  • fact status breakdown
  • diary entry counts

Documentation

Updated docs/memory.md to explain the memory system at a user-facing, high level.

Compatibility / Safety

  • additive-only schema changes
  • no destructive migrations
  • no agent recreation required
  • existing canon stays file-based
  • fallback behavior remains in place if new layers are empty
  • reflection is kept separate from canon
  • facts are used selectively, not injected everywhere

Testing

Passed targeted and runtime-adjacent suites, including memory, prompt assembly, reset continuity, routing, and worker/runtime coverage.

Result:

  • 103 passed

Recommended PR Validation

Live test on the opened PR branch:

  1. normal conversation with decisions/problems
  2. canon update followed by factual recall
  3. octo_context_reset followed by wake-up continuity
  4. octopal memory stats showing facts and diary counts

@pmbstyle pmbstyle self-assigned this Apr 7, 2026
@pmbstyle pmbstyle merged commit f14485d into main Apr 8, 2026
3 checks passed
@pmbstyle pmbstyle deleted the memory-v2-plan branch April 8, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant