All guides

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

  1. Enable extraction.

    On the agent, Memory tab -> Extraction policy:

    {
      "mode": "post-turn",
      "minTurns": 1,
      "maxTokensPerExtraction": 2000
    }
    

    Save. Extraction runs after every turn ends.

  2. 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.

  3. Chat with the agent.

    Have a few turns where the user shares preferences. After each turn, the extractor runs in the background.

  4. Inspect the memories.

    /memories -> filter by user. Each row is a fact with kind, content, embedding, rating, createdAt. Inline-edit, rate up/down, or delete.

  5. 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 /memories after 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

Talk to Platos

Powered by the Platos runtime

Powered by Platos →