memory-management
Original:🇺🇸 English
Translated
Search and manage Alma's memory and conversation history. Use when the user asks about past conversations, personal facts, preferences, or anything that requires recalling information ("你知道我...吗", "我们之前聊过...", "你还记得...", "帮我找之前说的..."). Also used to store new memories and search through archived chat threads.
8installs
Sourcenaohainezha/skill
Added on
NPX Install
npx skill4agent add naohainezha/skill memory-managementTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Memory Management Skill
Alma has a built-in memory system with semantic search. Use the CLI to interact with it.
almaCommands
bash
# List all memories
alma memory list
# Semantic search
alma memory search <query>
# Add a memory
alma memory add <content>
# Delete a memory
alma memory delete <id>
# View memory stats
alma memory statsWhen to Use
- User asks anything about the past ("你知道我喜欢什么吗", "我们之前讨论过什么", "上次说的那个方案是什么") → Search memories AND grep threads
- User says "remember this" →
alma memory add "..." - User asks "do you remember..." → +
alma memory search "..."alma memory grep "..." - User says "forget about..." → Search and delete matching memories
- Time-sensitive info (projects, deadlines) → Store with appropriate context
Search Strategy
When the user asks about past information, always try both layers:
- — semantic search for related concepts
alma memory search "<query>" - — keyword search in conversation history
alma memory grep "<keyword>"
If one layer returns nothing, try the other. They complement each other.
Conversation History Search
Alma automatically archives all threads as markdown files. You can search through past conversations:
bash
# Keyword search through all archived conversations
alma memory grep <keyword>
# Force re-archive all threads now
alma memory archiveThread archives are stored in the workspace's directory as markdown files with YAML frontmatter (threadId, title, createdAt, updatedAt, model, messageCount). Archives are auto-updated every 5 minutes.
threads/Two-Layer Memory
- Vector Memory () — semantic search, finds conceptually related memories
alma memory search - Conversation Archives () — keyword search, finds exact words/phrases in past conversations
alma memory grep
Use vector search when the user asks vague questions ("what did we discuss about React?"). Use grep when looking for specific terms, names, or code snippets.
Group Chat History
Alma persists all group chat messages to log files. Search and browse them:
bash
# List all known groups
alma group list
# View recent history (default 50 messages)
alma group history <chatId> [limit]
# Search across all group chats
alma group search <keyword>Log files are stored at . Use this when you need to recall what was discussed in a group chat.
~/.config/alma/groups/<chatId>_<date>.logPeople Profiles (Per-Person Memory)
For group chats, Alma maintains structured per-person profiles — more reliable than vector search for remembering who is who.
bash
# List all known people
alma people list
# View someone's profile
alma people show <name>
# Set/overwrite profile
alma people set <name> <content>
# Append to profile
alma people append <name> <fact>
# Delete profile
alma people delete <name>When to update profiles:
- Someone shares personal info (job, hobbies, preferences)
- You learn their communication style or language preference
- They mention relationships with other people
- Any fact you'd want to remember next time you talk to them
Profiles are stored at and automatically loaded into group chat context.
~/.config/alma/people/<name>.mdTips
- Always confirm what you stored/deleted with the user
- Use to find related memories before adding duplicates
alma memory search - Memories are automatically injected into conversations via semantic search — you don't need to manually recall them every time
- Use to search through conversation history when vector search doesn't find what you need
alma memory grep - For per-person facts, prefer over
alma people— structured and won't get mixed upalma memory