Recipes
Extract long-term memory from a conversation
Configure the memory extractor to pull profile facts, preferences, and entities from a chat.
Extract long-term memory from a conversation
Configure the extractor to pull profile facts, preferences, and entities from a chat into queryable memory.
The goal
An agent that remembers user-shared facts (name, preferences, recurring requests) across sessions and uses them in retrieval next time.
Steps
Enable extraction.
On the agent, Memory tab -> Extraction policy:
{ "mode": "post-turn", "minTurns": 1, "maxTokensPerExtraction": 2000 }Save. Extraction runs after every turn ends.
Pick the extraction model.
Memory tab -> Extraction model. Pick a small/cheap model (e.g. Claude Haiku, GPT-4o-mini). Extraction is a frequent operation; the cost matters.
Chat with the agent.
Have a few turns where the user shares preferences. After each turn, the extractor runs in the background.
Inspect the memories.
/memories-> filter by user. Each row is a fact withkind,content,embedding,rating,createdAt. Inline-edit, rate up/down, or delete.Confirm recall.
Open a fresh chat with the same user. The first turn's prompt should include relevant memories in the recall block (visible in Postman mode).
Verify
- Memory rows appear in
/memoriesafter a chat ends. - The next chat with the same user shows recalled memories in the assembled prompt.
- The extraction lane cost shows up on the Costs page.
Pin a fact manually
/memories -> "Add". Type the fact, set kind: "profile", save. Manual writes never get extracted-out; the extractor only writes; rating-down is the way to remove.
Rate a memory
Each memory row has thumbs. Up boosts retrieval ranking; down docks. Bad memories starve themselves out without manual cleanup.
Next steps
- Build an agent cluster so multiple agents share the same memory pool.
- Filter PII to redact sensitive bits before they land in memory.
