Add user memory for cross-conversation recall #25

Merged
ryan merged 1 commits from feat/user-memory into main 2026-04-09 21:54:05 -04:00
Owner

Summary

  • Add UserMemory model and user_memories table for storing per-user facts/preferences
  • Add save_user_memory LangChain agent tool so users can say "remember that..." and the agent persists it
  • Inject saved memories into the system prompt on every conversation turn for automatic recall
  • Exact-match dedup prevents duplicate memories

Test plan

  • Send "Remember that my favorite color is blue" — verify tool_start/tool_end SSE events for save_user_memory
  • Start a new conversation, ask "What's my favorite color?" — agent answers from memory
  • Verify SELECT * FROM user_memories shows the saved fact
  • Confirm duplicate messages refresh updated_at instead of creating a new row

🤖 Generated with Claude Code

## Summary - Add `UserMemory` model and `user_memories` table for storing per-user facts/preferences - Add `save_user_memory` LangChain agent tool so users can say "remember that..." and the agent persists it - Inject saved memories into the system prompt on every conversation turn for automatic recall - Exact-match dedup prevents duplicate memories ## Test plan - [ ] Send "Remember that my favorite color is blue" — verify `tool_start`/`tool_end` SSE events for `save_user_memory` - [ ] Start a new conversation, ask "What's my favorite color?" — agent answers from memory - [ ] Verify `SELECT * FROM user_memories` shows the saved fact - [ ] Confirm duplicate messages refresh `updated_at` instead of creating a new row 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ryan added 1 commit 2026-04-09 21:53:29 -04:00
Give the LangChain agent a save_user_memory tool so users can ask it to
remember preferences and personal facts. Memories are stored per-user in
a new user_memories table and injected into the system prompt on each
conversation turn.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ryan merged commit 896501deb1 into main 2026-04-09 21:54:05 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ryan/simbarag#25