Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#1228·agentmemory

Unable to recompress raw observations; compression failures leave observations uncompressed with no recovery path

Author: olegmaisakCreated Aug 19, 2026Updated Sep 16, 2026

Short version

agentmemory has no command or endpoint to recompile an already-stored raw observation. If LLM compression fails at observe time, the observation is persisted permanently in uncompressed conversation raw form, and there is no way to reconcile it without a destructive full-session re-import.


Long version

Environment

  • agentmemory: 0.9.29
  • iii-engine: 0.11.2
  • Provider: OpenRouter (deepseek/deepseek-v4-flash-0731), AGENTMEMORY_AUTO_COMPRESS=true

Symptom

At import time the LLM provider intermittently returned errors, which quickly tripped the circuit breaker. Once the breaker opened, every subsequent mem::compress was rejected immediately with circuit_breaker_open — without even attempting the LLM call. The observations themselves were still written to the store, but uncompressed (no title/narrative) and left in a permanent dead state: they will never be recompressed on their own.

End state: ~800 raw conversation raw observations that cannot be compressed without re-importing the source session (which also is not idempotent, see Workarounds).

Real log excerpt

[agentmemory] info Observation captured {"obsId":"obs_...","sessionId":"20260601_120000_","hook":"post_tool_use","compress":"llm"}
[agentmemory] error Compression failed {"obsId":"obs_...","error":"openrouter returned unexpected response: {"id":"gen-...","object":"chat.completion","model":"deepseek/deepseek-v4-flash-0731","provider":"DigitalOcean"}"}
[agentmemory] error Compression failed {"obsId":"obs_...","error":"circuit_breaker_open"}
[agentmemory] error Compression failed {"obsId":"obs_...","error":"circuit_breaker_open"}

The same run also surfaced error: fetch failed, so transient provider/network flakiness is not exotic.

Expected behavior

  1. A command or API to recompile an observation or session, e.g.:

    bash
    agentmemory recompress --session <id>
    agentmemory recompress --observation <obsId>
    curl -X POST /agentmemory/observations/compress -d '{"id":"<obsId>"}'
  2. Or, at minimum, a documented, supported way to reconcile these observations.

Workarounds I tried (none work for raw observations)

  • POST /agentmemory/summarize — operates only on already-compressed observations (filter(o => o.title)), returns no_observations for sessions with only raw observations.
  • POST /agentmemory/flow/compress — reduces action/workflow chains, not observations.
  • Direct re-send of observe — rejected as deduplicated: true, and would create duplicates anyway.
  • Full re-import with --force — destructive: it first forgets the session (deleting existing compressed observations and the summary), then re-observes. Under a flapping breaker this can make things worse: existing compressed observations are lost and the raw count increases.

Suggested improvement

Make compression idempotent and recoverable:

  • Add a public, idempotent way to (re)compress stored raw observations (ideally per-session).
  • Optionally add health/lint visibility into uncompressed observations, e.g. agentmemory doctor --uncompressed listing sessions with raw observations, so reconciliation can be driven from a script.

Impact

Compression is currently the only write path that issues LLM calls. Failures are expected under normal flakiness and should be recoverable without manual DB surgery or destructive re-import.

Lex by Oleg Maisak (via Hermes Agent)

Source: rohitg00/agentmemory

View original on GitHubView discussion on GitHub