Extract Reusable Memory Statements From a Conversation

crewAI's extraction prompt: turn a task result or a conversation into a JSON list of short memory statements that make sense alone, with user facts (names, numbers, dates, life events, facts hidden in questions) kept exact and treated as high priority.

  • 🤖 Any chat LLM
  • 🗂️ Memory

Last verified: write-up checked

Prompt by crewAI, Inc. (crewAIInc/crewAI) · Original source (opens in a new tab)

Extract Reusable Memory Statements From a Conversation — prompt preview

The prompt

prompt
You extract discrete, reusable memory statements from raw content (e.g. a task description and its result, or a conversation between a user and an assistant).

For the given content, output a list of memory statements. Each memory must:
- Be one clear sentence or short statement
- Be understandable without the original context
- Capture a decision, fact, outcome, preference, lesson, or observation worth remembering
- NOT be a vague summary or a restatement of the task description
- NOT duplicate the same idea in different words

When the content is a conversation, pay special attention to facts stated by the user (first-person statements). These personal facts are HIGH PRIORITY and must always be extracted:
- What the user did, bought, made, visited, attended, or completed
- Names of people, pets, places, brands, and specific items the user mentions
- Quantities, durations, dates, and measurements the user states
- Subordinate clauses and casual asides often contain important personal details (e.g. "by the way, it took me 4 hours" or "my Golden Retriever Max")

Preserve exact names and numbers — never generalize (e.g. keep "lavender gin fizz" not just "cocktail", keep "12 largemouth bass" not just "fish caught", keep "Golden Retriever" not just "dog").

Additional extraction rules:
- Presupposed facts: When the user reveals a fact indirectly in a question (e.g. "What collar suits a Golden Retriever like Max?" presupposes Max is a Golden Retriever), extract that fact as a separate memory.
- Date precision: Always preserve the full date including day-of-month when stated (e.g. "February 14th" not just "February", "March 5" not just "March").
- Life events in passing: When the user mentions a life event (birth, wedding, graduation, move, adoption) while discussing something else, extract the life event as its own memory (e.g. "my friend David had a baby boy named Jasper" is a birth fact, even if mentioned while planning to send congratulations).

If there is nothing worth remembering (e.g. empty result, no decisions or facts), return an empty list.
Output a JSON object with a single key "memories" whose value is a list of strings.

What it is

crewAI's extraction prompt: turn a task result or a conversation into a JSON list of short memory statements that make sense alone, with user facts (names, numbers, dates, life events, facts hidden in questions) kept exact and treated as high priority. The example on this page is copied from the same source file; we did not run it. The prompt text comes from the crewAI repository (MIT License, Copyright (c) 2025 crewAI, Inc.). Licence: https://github.com/crewAIInc/crewAI/blob/main/LICENSE. Original author: crewAI, Inc. (crewAIInc/crewAI). Changes by FoxaMind: the text is taken from the English translations file (en.json); JSON string quotes removed and \n escapes shown as line breaks; {...} placeholders keep the source syntax.

Who it's for

  • Developers building personal memory for assistants
  • Anyone storing facts from chats

برومبت الاستخراج في crewAI: يحوّل نتيجة مهمة أو محادثة إلى قائمة JSON من عبارات ذاكرة قصيرة مفهومة وحدها، مع الحفاظ على حقائق المستخدم (الأسماء والأرقام والتواريخ وأحداث الحياة والحقائق المضمّنة في الأسئلة) بدقة واعتبارها أولوية عالية.

Examples

Example inside the prompt (a fact hidden in a question)

Prompt
prompt
Presupposed facts: When the user reveals a fact indirectly in a question (e.g. "What collar suits a Golden Retriever like Max?" presupposes Max is a Golden Retriever), extract that fact as a separate memory.

Expected output: One of the worked rules printed in the source prompt. Not run by us.

Tips

  • Exact details are kept: the prompt's own examples keep "Golden Retriever", not just "dog", and "February 14th", not just "February".
  • Output is a JSON object with one key, "memories"; an empty list when nothing is worth keeping.