feat(memory): add SAME memory provider plugin - #4887
Conversation
Adds SAME (Stateless Agent Memory Engine) as a native memory provider. Local-first cross-agent memory with provenance tracking and trust state. - Auto-recall via prefetch on every turn - 5 agent tools: search, save_note, save_decision, get_note, health - Session handoff creation on exit - Built-in memory mirroring to vault - Secret redaction and injection filtering in prefetch - Minimal subprocess env (no API key leakage) - Auto-restart if MCP subprocess dies Requires `same` binary: https://statelessagent.com Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code Review: SAME Memory Provider PluginThank you for this well-architected memory provider plugin! The design is solid with good security practices. Issues Found1. Critical Bug - Truncated Code (Line ~450) This should be: tokens = cli_output.split()This would cause a 2. Schema Inconsistency (Line 399) This is inconsistent - either remove 3. Minor: Tool Schema Defaults
Strengths✅ Security: Good security practices throughout:
✅ Thread Safety: Proper use of locks for prefetch and MCP communication ✅ Architecture: Clean MCP JSON-RPC 2.0 implementation with auto-reconnect ✅ Features: Comprehensive feature set (prefetch, session handoffs, memory mirroring, compression safety) SuggestionConsider adding input validation for the Overall: Great contribution! The security considerations are well-thought-out. Please fix the truncated line and the schema inconsistency before merging. |
- Remove top_k and append from schema required arrays; defaults handled in handle_tool_call (schema inconsistency fix) - Remove JSON Schema default keywords from property definitions - Add query length validation in queue_prefetch (max 10K chars) - Clean up internal reference comments Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Thanks for the thorough review @britrik! #1 — Truncated line: This is a GitHub diff rendering artifact — the full line is #2 — Schema inconsistency: Fixed. Removed #3 — Tool schema defaults: Fixed. Removed Suggestion — query validation: Added. All changes in the latest commit. |
- Add SAME one-liner intro with repo link - Move "vs MCP integration" near top (first question users have) - Dual install path: post-merge (just configure) vs standalone (symlink) - brew/curl/npm as primary install, symlink as secondary - Hook/tool table replaces bullet list - "5 of 19 MCP tools" gives scope context - Add Support section with GitHub Issues and Discord Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Thanks for the contribution! Per the updated CONTRIBUTING.md, new memory providers are no longer accepted as in-tree additions to
Closing this in line with that policy. The path forward is to publish it as a standalone plugin so users can install it directly without touching the Hermes source tree. Once it's published, a small docs PR adding it to the Community plugins section of the README is welcome. Sorry for the bump — appreciate the time you put into this. |
Summary
This PR adds SAME as a native Hermes memory provider: a local-first alternative to
Hindsight and Honcho for users who want persistent memory without cloud dependencies.
No new pip dependencies. The plugin talks to the
samebinary (external install)via a
MCPStdioClient— a thin JSON-RPC 2.0 wrapper over stdio. All calls go througha threading lock; tested at 50 concurrent calls with 0% failure rate.
Why it belongs
SAME fills the "local memory with trust metadata" gap in the current plugin lineup:
What it does
Lifecycle hooks:
prefetch()— semantic vault search before every turn; injects ranked context with trust tagson_session_end()— generates structured handoff notes (what was requested, done, pending)on_pre_compress()— persists context to vault before compression discards iton_memory_write()— mirrors MEMORY.md/USER.md writes to the vault automaticallyon_turn_start()— auto-restarts the MCP subprocess if it dies between turnsAgent tools (5 of 19 available):
same_search— semantic search with trust state metadatasame_save_note— save markdown notes with provenance trackingsame_save_decision— structured decision logging with attributionsame_get_note— read full note content by pathsame_health— vault health and index statusSecurity
agent.redactwhen availablesame mcp; no API keys leakedInstall (for reviewers testing locally)
Test results
Test plan
hermes config set memory.provider sameactivates pluginhermes memory statusshows SAME as active providersame_searchtool returns ranked results with trust metadatasame_save_decisionlogs decisions with attributionkill $(pgrep same)🤖 Generated with Claude Code