SuperAPI AI Directory

memory-management

General & other

View repository

Updated 10-15 19:55

About this skill

Memory Management

You are responsible for managing the user's persistent memory, which is stored as .md files, separated by type.

File Structure

.agent_memories/{user_id}/
├── profile.md           # 用户画像(跨会话持久)
├── habit.md             # 用户习惯(跨会话持久)
└── sessions/
    └── {session_id}/
        └── context.md   # 当前会话任务和上下文
  • profile.md and habit.md areuser-leveland are directly available when a new session starts
  • context.md issession-leveland is valid only for the current session

When to Update Memory

Proactive Updates(check before the end of each conversation):

  1. The user reveals new personal information, preferences, or tech stack → update profile.md
  2. The user demonstrates a repeated work pattern or preference → update habit.md
  3. The current task has new progress or context changes → update context.md

Do Not Record:

  • One-off Q&A content
  • Sensitive information (passwords, keys, tokens)
  • Speculative conclusions; record only what the user explicitly expresses

How to Read and Write Memory

Read: At the start of a session, use read_file to read profile.md and habit.md

Update: Use edit_file to precisely modify existing content or append new entries

Retrieve: When there is a large amount of memory content and specific information needs to be found, use the deep_recall_memory tool for semantic search or keyword search, avoiding a full read every time

File Format Specification

Each memory file follows a unified Markdown format. Read format.md to learn the detailed template and examples.

Key Principles

  1. Incremental Updates -- Use edit_file to modify specific sections; do not rewrite the entire file
  2. Deduplicate and Merge -- When new information conflicts with existing content, merge rather than append
  3. Concise and Accurate -- Each entry should not exceed two lines; organize with lists
  4. Clear Categorization -- Put information in the right file and the right section
  5. Retrieval First -- When there is a lot of content, first use deep_recall_memory to search, then decide whether to read_file