Core Components
Memory System
Vector-backed memories table with arbitrary memoryType strings. Common types include agent_learning, solution_pattern, and codebase_knowledge, but any string is valid. Vector search for semantic retrieval.
Common Memory Types
The memoryType field is an arbitrary string. These are the commonly used types:
| memoryType | Purpose |
|---|---|
| agent_learning | What the agent learned from a task |
| solution_pattern | Reusable patterns discovered |
| codebase_knowledge | Facts about the codebase |
Any string is valid as a memoryType -- these are not a fixed enum.
API Usage
import { createLibSQLLocalDataLayer } from '@jetpack-agent/data';
const dataLayer = await createLibSQLLocalDataLayer('.jetpack/jetpack.db');
// Store a memory
await dataLayer.memories.store({
agentId: 'agent-1',
taskId: 'task-1',
content: 'Implemented auth using JWT with 24h expiry',
memoryType: 'agent_learning', // any string, e.g. 'agent_learning', 'solution_pattern', 'codebase_knowledge'
importance: 0.8, // 0-1 scale
tags: ['backend', 'security'],
});
// Get memories relevant to a task
const memories = await dataLayer.memories.getTaskContext(taskId);
// Store a solution pattern
await dataLayer.memories.store({
agentId: 'agent-1',
taskId: 'task-2',
content: 'All API endpoints follow RESTful conventions with /api/v1 prefix',
memoryType: 'solution_pattern',
importance: 0.8,
tags: ['api-design'],
});
// Store codebase knowledge
await dataLayer.memories.store({
agentId: 'agent-1',
taskId: 'task-3',
content: 'The auth module uses bcrypt for password hashing',
memoryType: 'codebase_knowledge',
importance: 0.9,
tags: ['auth', 'security'],
});Configuration
// Memory types available:
// 'agent_learning' — What the agent learned from a task
// 'solution_pattern' — Reusable patterns discovered
// 'codebase_knowledge' — Facts about the codebase
// Field name is 'memoryType', not 'type'
// Tags are a string array, not nested metadata