New
Explicit Memory Commands
Natural language commands that let users control what the AI remembers: "remember", "forget", and "recall".
Overview
Explicit memory commands allow users to directly control their AI's memory using natural language. When enabled, the system detects commands like "remember my birthday" and automatically stores the information as a memory fact.
Enabling Commands
enable-commands.ts
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://www.superagentstack.com/api/v1',
apiKey: process.env.OPENROUTER_KEY,
defaultHeaders: { 'superAgentKey': process.env.SUPER_AGENT_KEY },
});
const response = await client.chat.completions.create({
model: 'openai/gpt-4o-mini',
messages: [{ role: 'user', content: 'Remember that my birthday is March 15th' }],
sessionId: crypto.randomUUID(),
autoMemory: true, // Enable explicit memory commands
});
// AI: "I'll remember that your birthday is March 15th!"Supported Commands
Remember Command
Stores information as a memory fact.
Examples:
- "Remember that I prefer dark mode"
- "Remember my email is john@example.com"
- "Please remember I'm allergic to peanuts"
- "Keep in mind that I use TypeScript"
Forget Command
Removes information from memory.
Examples:
- "Forget my email address"
- "Please forget that I mentioned my birthday"
- "Don't remember my phone number"
Recall Command
Retrieves stored information.
Examples:
- "What do you remember about me?"
- "Recall my preferences"
- "What have I told you about my project?"
Smart Detection
The system uses AI to detect memory commands, so variations and natural phrasing work too. "Keep in mind", "don't forget", and "make a note" are all recognized.
Complete Example
memory-commands.ts
// User stores information
await client.chat.completions.create({
model: 'openai/gpt-4o-mini',
messages: [{ role: 'user', content: 'Remember that I work at Acme Corp as a senior developer' }],
sessionId: 'session-123',
autoMemory: true,
});
// AI: "Got it! I'll remember that you work at Acme Corp as a senior developer."
// User recalls information
const recall = await client.chat.completions.create({
model: 'openai/gpt-4o-mini',
messages: [{ role: 'user', content: 'What do you know about my job?' }],
sessionId: 'session-456', // Different session
useUserMemory: true,
autoMemory: true,
});
// AI: "You work at Acme Corp as a senior developer."
// User forgets information
await client.chat.completions.create({
model: 'openai/gpt-4o-mini',
messages: [{ role: 'user', content: 'Forget where I work' }],
sessionId: 'session-789',
autoMemory: true,
});
// AI: "I've forgotten the information about where you work."Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
autoMemory | boolean | false | Enable detection of explicit memory commands. |
Privacy Considerations
- Users have full control over what is remembered
- The "forget" command permanently deletes information
- Memory facts are isolated per user
- Users can view and manage all their facts via the Memory API