When a memory's content exceeds 500 characters, mnueron can run a Claude Haiku call to extract 1-5 discrete facts — decisions, recommendations, conclusions, action items — and save each as its own searchable memory.
Cost: $0.002 per extraction. Combined with summarization ($0.0015)
your max per-long-save cost is ~$0.005.
Enabling extraction
Two opt-in paths:
-
Per-deploy: set environment variable
ENABLE_FACT_EXTRACTION=trueon your hosted account. Every memory above the threshold gets extraction automatically. -
Per-call: include
metadata.extract_facts: truein your save:mem.save( content=long_assistant_response, namespace="user-123", metadata={"extract_facts": True}, )
What gets saved
Each extracted fact becomes its own memory in the same namespace:
| Field | Value |
|---|---|
content | The fact text (1-2 sentences) |
namespace | Same as parent |
tags | ["extracted-fact", <category>] |
source | "fact-extraction" |
source_ref | parent memory id |
metadata.derived_from | parent memory id |
metadata.category | decision / recommendation / fact / action_item |
To query just the extracted facts later:
# All decisions across this user's history
mem.search(
"what did we decide about pricing",
metadata_filter={"category": "decision"},
namespace=f"user-{user_id}",
k=5,
)
Failure mode
Fail-open. If the Anthropic API call fails (rate limit, network error,
no ANTHROPIC_API_KEY configured), no facts are saved and the parent
memory write still succeeds normally. No client-side error.
Trigger timing
Fact extraction runs after the parent memory is saved (so the parent id is known) and doesn't block the response — the user sees the parent insert succeed immediately, and children land within a few seconds as the Haiku call completes.