feat(memory): evidence-gated episodes with local FTS recall - #68265
feat(memory): evidence-gated episodes with local FTS recall#68265joelbrilliant wants to merge 2 commits into
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused local-only design and the explicit cache-safety rationale. There are blocking correctness issues to address before this can be evaluated on its feature merits.
Problems
get_episode()accepts every regular file belowHERMES_HOME(tools/episode_memory.py:519), not only episode files. That bypasses the establishedread_filecredential guard (tools/file_tools.py:1194-1203) and redaction pass (tools/file_tools.py:1310-1313); the guard explicitly covers.envandauth.json(agent/file_safety.py:194-337).- FTS5 setup is unconditional (
tools/episode_memory.py:168-180). A missing FTS5 module can makeremember_episode()write the file and then fail while indexing (tools/episode_memory.py:458-460). Current session search handles unavailable FTS/tokenizers as a degraded mode (hermes_state.py:2003-2028). - The config default location has moved: current main imports defaults from
hermes_cli/config_defaults.py(hermes_cli/config.py:933), where the memory section now resides (hermes_cli/config_defaults.py:1514-1537).
Suggested changes
- Confine
getto the episodes directory and test protected-file rejection. - Add an FTS-unavailable path that returns structured behavior without losing the durable write.
- Place the config defaults in
config_defaults.pyduring salvage.
This is an automated hermes-sweeper review.
f3f88f4 to
8efd65c
Compare
|
Thanks, all three blockers are addressed in
The defaults now live in |
|
The shared Vercel fixture fix has now landed on I rebased this PR onto the corrected |
Add a built-in episode tool beside MEMORY.md/USER.md and session_search. Episodes store durable lessons under HERMES_HOME/memories/episodes with a mandatory evidence field, stay out of the system prompt, and are searchable via stdlib SQLite FTS5 over episodes plus optional HERMES_HOME roots. Does not require Honcho or any external memory provider. Subagents cannot write episodes (same class as memory). Overlap: not shared FastAPI memory, portable pack skill, or git-as-memory skill. Signed-off-by: joelbrilliant <joelbrilliant1@gmail.com>
8efd65c to
2f202b3
Compare
Signed-off-by: joelbrilliant <joelbrilliant1@gmail.com>
bb8f6dc to
1a5700c
Compare
Problem
Built-in memory today is two tight layers:
MEMORY.md/USER.md- always injected into the system prompt (~1.3k tokens total). Great for standing facts; too small and too hot for durable lessons.session_search- FTS over chat history only. Great for "what did we discuss"; blind to skills, run notes, and checkpoint lessons that never appear in a transcript the same way.External memory providers (Honcho, Mem0, etc.) help some installs, but many users run built-in only. There is no first-class place for evidence-gated lessons that should survive months without burning every-turn prompt budget.
Demand shape: power users who already curate markdown scars (fixes, review findings, env gotchas) want those searchable inside Hermes without standing up a provider.
What this adds
A built-in
episodetool in thememorytoolset (also on_HERMES_CORE_TOOLS):remember~/.hermes/memories/episodes/YYYY-MM-DD-slug.mdwith frontmatter. Refuses withoutevidence(path, commit SHA, PR/issue URL, or log path).recallHERMES_HOMEroots. Stdlib only.list/getreindexProperties that matter:
episode(same class asmemoryinDELEGATE_BLOCKED_TOOLS).Also tightens the
memorytool schema: point durable proven lessons atepisode, discourage phase/queue status snapshots in MEMORY.md.Non-overlap
memory.providerpluginsEdge kit for people who want multi-root private corpora outside
HERMES_HOMEremains optional:joelbrilliant/agent-memory-kit. This PR covers the default-install gap only.Code touchpoints
tools/episode_memory.py- store, FTS index, tool + schematoolsets.py-episodeon core + memory toolset + platform bundles that list memory explicitlyhermes_cli/config.py-episodes_enabled,episode_corpus_rootstools/memory_tool.py- schema hygiene cross-reftools/delegate_tool.py- blockepisodefor childrenwebsite/docs/user-guide/features/memory.md- user docstests/tools/test_episode_memory.py- unit coverageValidation
ruff check tools/episode_memory.py tests/tools/test_episode_memory.pycleangit diff --checkcleanepisode; present in_HERMES_CORE_TOOLSandTOOLSETS['memory']; inDELEGATE_BLOCKED_TOOLSPlatforms exercised: local macOS, CPython via the live Hermes venv, HERMES_HOME redirected to temp dirs in tests.
Risk / footprint
memory+session_search; unreachable via terminal alone without every agent reinventing paths; not a third-party product.memories/episodes.db(profile-scoped viaget_hermes_home()).skills/until the user adds it (keeps first index small).Happy to shrink further (e.g. episodes-only corpus, or optional-skill instead of core) if maintainers prefer a lower rung.