[claude] feat(memory): add grounded observation synthesis layer (#1013) #1033

Open
claude wants to merge 186 commits from claude/issue-1013 into main
Member

Fixes #1013

What

Adds an observation synthesis layer for higher-order recall and agent insight to the holographic memory plugin.

Changes

  • plugins/memory/holographic/observations.py (new): ObservationSynthesizer class that synthesizes grounded higher-order observations from accumulated facts
  • plugins/memory/holographic/store.py: Added observations and observation_evidence tables with UPSERT/list methods
  • plugins/memory/holographic/__init__.py: Wired up ObservationSynthesizer, added observe action to fact_store tool, enhanced prefetch to surface a separate ## Holographic Observations section
  • tests/plugins/memory/test_holographic_observations.py (new): 4 focused tests

Three observation types synthesized

  1. recurring_preference — inferred from repeated user_pref/general facts about communication style
  2. stable_direction — inferred from project facts about trajectory (local-first, gitea-first, ansible)
  3. behavioral_pattern — inferred from repeated operator workflow signals (commit-early, PR-first, dedup-guard)

Evidence grounding

  • Each observation links back to supporting fact IDs in observation_evidence
  • Confidence requires ≥2 matching facts; single-fact observations are suppressed
  • Default min_confidence=0.6 gates weak observations
  • fact_store(action="observe") returns observations with full evidence expansion
  • prefetch returns raw facts and observations as distinct sections, never overwriting raw memory

Verification

python3 -m pytest tests/plugins/memory/test_holographic_observations.py tests/agent/test_memory_provider.py -q
# 50 passed
Fixes #1013 ## What Adds an observation synthesis layer for higher-order recall and agent insight to the holographic memory plugin. ## Changes - **`plugins/memory/holographic/observations.py`** (new): `ObservationSynthesizer` class that synthesizes grounded higher-order observations from accumulated facts - **`plugins/memory/holographic/store.py`**: Added `observations` and `observation_evidence` tables with UPSERT/list methods - **`plugins/memory/holographic/__init__.py`**: Wired up `ObservationSynthesizer`, added `observe` action to `fact_store` tool, enhanced `prefetch` to surface a separate `## Holographic Observations` section - **`tests/plugins/memory/test_holographic_observations.py`** (new): 4 focused tests ## Three observation types synthesized 1. `recurring_preference` — inferred from repeated user_pref/general facts about communication style 2. `stable_direction` — inferred from project facts about trajectory (local-first, gitea-first, ansible) 3. `behavioral_pattern` — inferred from repeated operator workflow signals (commit-early, PR-first, dedup-guard) ## Evidence grounding - Each observation links back to supporting fact IDs in `observation_evidence` - Confidence requires ≥2 matching facts; single-fact observations are suppressed - Default `min_confidence=0.6` gates weak observations - `fact_store(action="observe")` returns observations with full evidence expansion - `prefetch` returns raw facts and observations as distinct sections, never overwriting raw memory ## Verification ``` python3 -m pytest tests/plugins/memory/test_holographic_observations.py tests/agent/test_memory_provider.py -q # 50 passed ```
claude added 1 commit 2026-04-22 15:21:14 +00:00
feat(memory): add grounded observation synthesis layer
All checks were successful
Lint / lint (pull_request) Successful in 8s
3f4515db38
claude reviewed 2026-04-22 16:11:49 +00:00
claude left a comment
Author
Member

Self-review (cannot approve own PR). The observation synthesis layer adds a meaningful capability: higher-order recall backed by supporting facts.

Architecture notes:

  • ObservationSynthesizer backed by dedicated observations + observation_evidence tables is clean
  • Three observation types (recurring_preference, stable_direction, behavioral_pattern) cover the most useful categories
  • Confidence gating at 0.6 default is reasonable
  • Evidence linking ensures observations remain grounded

Potential concerns:

  1. This PR conflicts with PR #1026 and #1028 which all touch plugins/memory/holographic/init.py. Coordinate merge order.
  2. The schema description is getting long. Consider whether the full action list in the tool description will fit within model context constraints for smaller local models.
  3. Ensure the UPSERT logic in store.py handles concurrent sessions correctly if two sessions synthesize observations simultaneously.
Self-review (cannot approve own PR). The observation synthesis layer adds a meaningful capability: higher-order recall backed by supporting facts. Architecture notes: - ObservationSynthesizer backed by dedicated observations + observation_evidence tables is clean - Three observation types (recurring_preference, stable_direction, behavioral_pattern) cover the most useful categories - Confidence gating at 0.6 default is reasonable - Evidence linking ensures observations remain grounded Potential concerns: 1. This PR conflicts with PR #1026 and #1028 which all touch plugins/memory/holographic/__init__.py. Coordinate merge order. 2. The schema description is getting long. Consider whether the full action list in the tool description will fit within model context constraints for smaller local models. 3. Ensure the UPSERT logic in store.py handles concurrent sessions correctly if two sessions synthesize observations simultaneously.
All checks were successful
Lint / lint (pull_request) Successful in 8s
This pull request has changes conflicting with the target branch.
  • cli.py
  • gateway/platforms/api_server.py
  • hermes_cli/models.py
  • hermes_cli/web_server.py
  • plugins/memory/holographic/__init__.py
  • run_agent.py
  • tests/hermes_cli/test_web_server.py
  • tools/browser_tool.py
  • tools/file_tools.py
  • tools/skill_manager_tool.py
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin claude/issue-1013:claude/issue-1013
git checkout claude/issue-1013
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/hermes-agent#1033