save_memory - Save Long-term Memory
Overview
The save_memory tool saves specific information or facts to long-term memory. This tool helps the AI assistant remember user preferences, habits, and important information to provide more personalized and effective assistance in future interactions.
Tool Name
- Internal Name:
save_memory - Display Name: Save Memory
- Icon: Brain
Parameters
Required Parameters
| Parameter | Type | Description |
|---|---|---|
fact | string | The specific fact or piece of information to remember. Should be a clear, self-contained statement. For example, if the user says "My favorite color is blue", the fact would be "My favorite color is blue". |
Features
Long-term Memory Storage:
- Save user-related facts and preferences
- Persist across sessions
- Retrievable in future interactions
Personalization Support:
- Remember user preferences
- Remember common configurations
- Remember work habits
Smart Memory:
- Automatically identify important information
- Avoid duplicate memories
- Maintain memory relevance
Use Cases
When to Use This Tool
User Explicitly Asks to Remember Something:
- "Remember that I like pineapple on pizza"
- "Please save this: my cat's name is Whiskers"
User States Clear, Concise Personal Facts:
- Information about themselves
- Preference settings
- Environment configuration
- Information helpful for future interactions
When NOT to Use This Tool
- Conversational context only relevant for current session
- Long, complex, or rambling pieces of text
- Uncertain whether information is worth remembering long-term
Usage Examples
Remember User Preference
{
"fact": "User prefers TypeScript over JavaScript"
}Remember Personal Information
{
"fact": "User's name is John Doe, age 25"
}Remember Work Habits
{
"fact": "User prefers using Vim editor and keyboard shortcuts"
}Remember Project Configuration
{
"fact": "User's main project path is /home/user/projects/main-app"
}Remember Code Style Preference
{
"fact": "User prefers single quotes over double quotes, 2-space indentation"
}Remember Tool Aliases
{
"fact": "User uses 'gco' as alias for 'git checkout'"
}Return Value
The tool returns an object containing:
llmContent: Confirmation messagereturnDisplay: User-friendly display informationsummary: Operation summary
Example Output
✓ Saved to long-term memory: User prefers TypeScript over JavaScriptBest Practices
Keep Facts Concise and Clear:
- ✅ "User prefers React framework"
- ❌ "User said they've been using various frontend frameworks over the years but recently found React particularly useful..."
Use Complete Statements:
- ✅ "User's primary programming language is Python"
- ❌ "Python"
Include Context:
- ✅ "User uses PostgreSQL database in project X"
- ❌ "PostgreSQL"
Avoid Temporary Information:
- ✅ "User's preferred code review tool is GitHub"
- ❌ "User is reviewing PR #123"
Confirm When Uncertain:
- If unsure whether to remember, ask the user: "Should I remember that for you?"
Memory Type Examples
Personal Information
- Name, age, occupation
- Location, timezone
- Contact preferences
Technical Preferences
- Programming language preferences
- Framework and library choices
- Tools and editors
- Code style
Work Habits
- Working hours
- Project organization
- Documentation habits
- Testing preferences
Project Information
- Common project paths
- Project structure preferences
- Deployment processes
- Team conventions
Learning Preferences
- Learning style
- Documentation preferences
- Example type preferences
Privacy and Security
Sensitive Information:
- Don't save passwords, API keys, or other sensitive data
- Don't save personal identification information (unless explicitly requested)
Data Storage:
- Memories stored locally
- Respects user privacy settings
- Can be deleted at any time
Data Usage:
- Only used to improve user experience
- Not shared with third parties
- Only used in relevant contexts
Memory Management
View Memories
Users can view saved memories (specific command depends on implementation).
Update Memories
Saving new facts will update or supplement existing memories.
Delete Memories
Users can request deletion of specific memories or clear all memories.
Distinction from Project-Specific Information
- save_memory: For user-related personal information and preferences
- SII.md files: For project-specific context and configuration
Use save_memory
User prefers Vim editor
User's name is John Doe
User practices TDD developmentUse SII.md
Project uses React + TypeScript
API endpoint: https://api.example.com
Test command: npm testNotes
- Selective Memory: Not all information needs to be remembered
- Clear Expression: Ensure facts are clearly and completely stated
- Relevance: Only remember information helpful for future interactions
- Privacy Awareness: Avoid remembering overly sensitive information
- User Control: Respect user's memory management needs
Error Handling
Possible error scenarios:
Parameter Errors:
- Empty fact parameter
- Fact parameter too long
- Incorrect fact parameter format
Storage Errors:
- Insufficient storage space
- Permission issues
- Filesystem errors
Related Features
- Project Context: Use SII.md files for project-specific information
- Session Context: Temporary information in current conversation
- Configuration Files: Tool and system configuration
Example Conversations
Scenario 1: Explicit User Request
User: "Remember I like using Tailwind CSS"
Assistant: Uses save_memory tool
{
"fact": "User likes using Tailwind CSS"
}Output: "✓ Remembered: User likes using Tailwind CSS"
Scenario 2: Identifying Important Preference
User: "I always use pnpm instead of npm"
Assistant: Uses save_memory tool
{
"fact": "User prefers pnpm package manager over npm"
}Scenario 3: Asking When Uncertain
User: "I'm working on the login feature today"
Assistant: "This is information about your current task. Would you like me to remember that you typically handle login feature development?"
Summary
The save_memory tool is a key feature for achieving personalized AI assistant experiences. By using this tool wisely, the AI assistant can better understand user preferences and habits, providing more thoughtful and efficient assistance.
Remember: Only save truly important information that will be helpful for future interactions, and always respect user privacy and control.
