-
Notifications
You must be signed in to change notification settings - Fork 4
Memory Patterns
Alessio Rocchi edited this page Jan 27, 2026
·
1 revision
Best practices for using aistack's memory system.
✓ GOOD:
- pattern:singleton
- api:user-create
- concept:jwt
- design:auth-flow
✗ BAD:
- temp123
- data
- stuff
✓ GOOD:
- user-auth
- payment-processing
- api-docs
- architecture
✗ BAD:
- default (for everything)
- misc
await memory.store('api:user-create', 'POST /api/users creates a user', {
namespace: 'api-docs',
metadata: {
method: 'POST',
path: '/api/users',
auth: 'required',
tags: ['user', 'crud'],
version: '1.0'
}
});// 1. Use namespaces to limit scope
await memory.search('jwt', { namespace: 'security' });
// 2. Use vector search for concepts
await memory.search('how to authenticate users', { useVector: true });
// 3. Use FTS for keywords
await memory.search('JWT AND validation');// Store session-specific data
await memory.store('finding:sql-injection', 'Found SQL injection in login', {
namespace: `session:${session.id}`,
metadata: { severity: 'high' }
});// Periodic cleanup
const oldEntries = await memory.list({
namespace: 'temp',
// Add timestamp filter logic
});
for (const entry of oldEntries) {
await memory.delete(entry.key, entry.namespace);
}Related:
Getting Started
Core Concepts
Agent Guides
- Overview
- Coder
- Researcher
- Tester
- Reviewer
- Adversarial
- Architect
- Coordinator
- Analyst
- DevOps
- Documentation
- Security Auditor
MCP Tools
- Overview
- Agent Tools
- Memory Tools
- Task Tools
- Session Tools
- System Tools
- GitHub Tools
- Review Loop Tools
- Identity Tools
Recipes
- Index
- Code Review
- Doc Sync
- Multi-Agent
- Adversarial Testing
- Full-Stack Feature
- Memory Patterns
- GitHub Integration
Advanced
- Plugin Development
- Custom Agent Types
- Workflow Engine
- Vector Search Setup
- Web Dashboard
- Programmatic API
- Resource Monitoring
Reference