When a memory's content exceeds 800 characters, mnueron can run a
Claude Haiku call to generate a 1-2 sentence summary that gets stored
in metadata.summary. Used by the dashboard preview rows and by
memory_recall to give callers a short version when full content
would blow their context window.
Cost
Roughly $0.0015 per long save at Haiku rates. Combined with v0.2.9 fact extraction (~$0.002), every long save costs about $0.0035 total.
Triggers
Three ways to enable, in priority order:
- Per-call metadata.summarize = true — explicit per-save opt-in.
- Per-call metadata.byok_anthropic_key — caller provides their own Anthropic API key. Treated as opt-in; we use your key, not ours. The key is never persisted — stripped from metadata before the row is written.
- ENABLE_AUTO_SUMMARY=true server env var — fire on every long save site-wide. This is the paid-tier default; on the free tier you'd run with this OFF and rely on per-call opt-in.
Example with explicit opt-in
from mnueron import Mnueron
m = Mnueron(api_key="mnu_...")
m.save(
long_conversation_text,
namespace="user-123",
metadata={"summarize": True}, # opt in
)
Example with BYOK (free-tier friendly)
import os
m.save(
long_conversation_text,
namespace="user-123",
metadata={"byok_anthropic_key": os.environ["YOUR_ANTHROPIC_KEY"]},
)
# The key is used for this one summarize call, then stripped before
# the row hits the DB.
Where the result shows up
After save, fetch the memory back and read metadata.summary:
mem = m.get(saved_id)
print(mem.metadata["summary"])
# "User decided to use bcrypt cost 12 + httpOnly cookies for auth,
# rejecting JWT due to refresh-rotation complexity."
Fail-open
If the Anthropic call fails (rate limit, network error, no key), no summary is generated and the parent save still succeeds normally. No client-visible error.