This topic describes memory rules, which let an agent extract, store, and recall key information from conversations. By configuring memory rules, you enable the agent to retain long-term memory across sessions, better understand user preferences, remember important facts, and deliver a more personalized service experience.
Memory rules consist of two parts:
Memory extraction rules define how the system extracts and categorizes important information from user interactions, including the extraction logic, tag system, and weight calculation method.
When your application involves a primary agent working with multiple sub-agents, this toggle controls the scope of memory sharing.
| Status | Description |
|---|---|
| Enable | User event memory is stored centrally with the user ID as the primary key. The primary agent and its sub-agents share the same event memory for read and write operations. Use this mode when multiple agents need to collaborate on serving the same user based on historical events, for example, to support behavior analysis, long-term preference tracking, and a unified service experience. |
| Disable | Event memory is isolated by the "agent + user" dimension. Each agent maintains its own event records independently, without affecting the others. |
The custom prompt tells the system which dimensions of information to extract from conversations. You can define the memory categories and specific examples to focus on based on your business scenario.
How to configure: In the Custom Prompt text box, list the information dimensions to extract by category. The character limit is 2,000.
Example (emotional companion scenario):
**Relationships and social**: Names of family members, friends, teachers, and classmates, along with their interactions with or comments about the user.
**Habits and preferences**: Dietary restrictions, daily routines (for example, "I usually go to bed at 9"), catchphrases, and specific behavior patterns.
**Emotions and status**: Physical discomfort (such as illness or teething), mood changes (such as happiness or praise from a teacher), and the user's current developmental stage.
**Cognition and viewpoints**: Opinions about things (for example, "think dinosaurs are cool"), learning progress (for example, "learning to jump rope"), wishes, and fears.
**Future plans**: Scheduled activities, trips, upcoming birthdays, and near-term goals.
Writing tips:
If you are unsure how to write a custom prompt, the platform provides multiple preset scenario templates that you can apply with a single click.
| Template name | Application scenarios |
|---|---|
| Emotional companion | Emotional companion toys, AI speakers, and similar products |
| Office | Voice recorders, office robots, and other office products |
| Education | Learning tablets, AI tutoring, after-class practice, and other education products |
| Smart home | Smart home, central control panels, smart speakers, and other home control products |
| E-commerce | Shopping guides, intelligent customer service, and other e-commerce products |
Usage: Click Change template, select the target scenario from the list on the left, preview the prompt, and then click Use this template to apply it. You can continue to edit the template after it is applied.
Each template also provides some best practices, which describes recommended configuration methods and tuning strategies for that scenario.
The system prompt is the platform’s built-in base extraction logic. It is read-only and works together with the custom prompt to keep the foundational memory extraction capability stable and reliable.
Memory query rules define how the system retrieves relevant content from existing memories and injects it into the prompt context during each conversation turn, to enhance the response quality of the agent.
The recall score threshold controls the relevance filter strength for recalled memories. Available values:
| Threshold | Description |
|---|---|
| Low | Applies lenient recall conditions. Returns more memory entries with broader coverage, but may include content with weaker relevance. |
| Medium | Balances recall volume and relevance. Suitable for most scenarios (Default). |
| High | Applies strict recall conditions. Returns only highly relevant memory entries with high precision, but may miss some useful information. |
Recommendation: Use the default value Medium for initial integration, and then adjust based on actual test results. If recalled content is too noisy, raise the threshold to High. If key information is missed, lower it to Low.
Go to the agent editing page and open Edit Memory Rules.
On the Memory Extraction Rules page, decide whether to enable multi-agent shared memory based on your needs.

Select a scenerio template as a starting point, or write a custom prompt directly to define the information dimensions to extract.

On the Memory Query Rules page, configure the recall count and score threshold for both derived memory and long-term memory. After completing the configuration, click Save.

After you save the configuration, the agent automatically extracts and recalls memory in subsequent conversations.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback