P0: Verify RetainDB Cross-Session Memory (write, recall, crash recovery) #112

Open
opened 2026-04-06 14:06:51 +00:00 by Timmy · 1 comment
Owner

Context

Commit 6df48602 rewrote the RetainDB plugin from scratch. The previous implementation hit endpoints that returned 404 silently. The new version adds:

  • Correct API routes (/v1/context/query, /v1/memory/ingest/session, etc.)
  • SQLite write-behind queue (~/.hermes/retaindb_queue.db)
  • Background prefetch (context + dialectic synthesis + agent self-model)
  • Agent identity seeding from SOUL.md
  • Shared file store tools (upload/list/read/ingest/delete)

Acceptance Criteria

  • Verify the plugin loads: Run python -c "from plugins.memory.retaindb import RetainDBPlugin; p = RetainDBPlugin(); print(type(p).__name__)" from ~/.hermes/hermes-agent/ without import errors
  • Verify end-to-end memory write and recall: Start a CLI session, ask it to remember "Alexander's mission is caring for broken men", then start a new session and ask "what is my mission?" — it must recall from RetainDB, not from local memory
  • Verify the write queue exists: Confirm ~/.hermes/retaindb_queue.db exists after at least one turn, and SELECT COUNT(*) FROM queue shows rows were flushed
  • Verify crash recovery: Kill the agent mid-conversation (kill -9), restart, confirm pending queue rows replay on next turn
  • Verify SOUL.md ingestion: Check that AGENT-scoped memories include SOUL.md content via the retained context query API
  • Verify dialectic synthesis: Enable verbose logging and confirm dialectic query results appear in the context overlay block

Why This Matters

RetainDB cross-session memory is the technical foundation for continuity of relationship. A man who opens up at 2 AM and returns the next night deserves an agent that remembers his name, his pain, and what they talked about. Local memory is per-session; RetainDB bridges sessions permanently.

Hints

  • The RetainDB server must be reachable. Check hermes config for the retaindb endpoint.
  • The plugin is in plugins/memory/retaindb/__init__.py (792 lines).
  • File store tools: retaindb_upload_file, retaindb_list_files, retaindb_read_file, retaindb_ingest_file, retaindb_delete_file.

Parent: #111

## Context Commit `6df48602` rewrote the RetainDB plugin from scratch. The previous implementation hit endpoints that returned 404 silently. The new version adds: - Correct API routes (`/v1/context/query`, `/v1/memory/ingest/session`, etc.) - SQLite write-behind queue (`~/.hermes/retaindb_queue.db`) - Background prefetch (context + dialectic synthesis + agent self-model) - Agent identity seeding from SOUL.md - Shared file store tools (upload/list/read/ingest/delete) ## Acceptance Criteria - [ ] **Verify the plugin loads**: Run `python -c "from plugins.memory.retaindb import RetainDBPlugin; p = RetainDBPlugin(); print(type(p).__name__)"` from `~/.hermes/hermes-agent/` without import errors - [ ] **Verify end-to-end memory write and recall**: Start a CLI session, ask it to remember "Alexander's mission is caring for broken men", then start a *new* session and ask "what is my mission?" — it must recall from RetainDB, not from local memory - [ ] **Verify the write queue exists**: Confirm `~/.hermes/retaindb_queue.db` exists after at least one turn, and `SELECT COUNT(*) FROM queue` shows rows were flushed - [ ] **Verify crash recovery**: Kill the agent mid-conversation (`kill -9`), restart, confirm pending queue rows replay on next turn - [ ] **Verify SOUL.md ingestion**: Check that AGENT-scoped memories include SOUL.md content via the retained context query API - [ ] **Verify dialectic synthesis**: Enable verbose logging and confirm dialectic query results appear in the context overlay block ## Why This Matters RetainDB cross-session memory is the technical foundation for continuity of relationship. A man who opens up at 2 AM and returns the next night deserves an agent that remembers his name, his pain, and what they talked about. Local memory is per-session; RetainDB bridges sessions permanently. ## Hints - The RetainDB server must be reachable. Check `hermes config` for the retaindb endpoint. - The plugin is in `plugins/memory/retaindb/__init__.py` (792 lines). - File store tools: `retaindb_upload_file`, `retaindb_list_files`, `retaindb_read_file`, `retaindb_ingest_file`, `retaindb_delete_file`. Parent: #111
Member

🏷️ Automated Triage Check

Timestamp: 2026-04-06T17:00:50.301171
Agent: Allegro Heartbeat

This issue has been identified as needing triage:

Checklist

  • Clear acceptance criteria defined
  • Priority label assigned (p0-critical / p1-important / p2-backlog)
  • Size estimate added (quick-fix / day / week / epic)
  • Owner assigned
  • Related issues linked

Context

  • No comments yet — needs engagement
  • No labels — needs categorization
  • Part of automated backlog maintenance

Automated triage from Allegro 15-minute heartbeat

## 🏷️ Automated Triage Check **Timestamp:** 2026-04-06T17:00:50.301171 **Agent:** Allegro Heartbeat This issue has been identified as needing triage: ### Checklist - [ ] Clear acceptance criteria defined - [ ] Priority label assigned (p0-critical / p1-important / p2-backlog) - [ ] Size estimate added (quick-fix / day / week / epic) - [ ] Owner assigned - [ ] Related issues linked ### Context - No comments yet — needs engagement - No labels — needs categorization - Part of automated backlog maintenance --- *Automated triage from Allegro 15-minute heartbeat*
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/hermes-agent#112