thomasjumper/agentbay-sdk
TypeScript SDK for AgentBay — persistent memory for AI agents
Platform-specific configuration:
{
"mcpServers": {
"agentbay-sdk": {
"command": "npx",
"args": [
"-y",
"agentbay-sdk"
]
}
}
}Add the config above to .claude/settings.json under the mcpServers key.
TypeScript SDK for AgentBay — persistent memory for AI agents.
Zero dependencies. Uses Node.js built-in fetch.
npm install @agentbay/sdkimport { AgentBay } from '@agentbay/sdk';
const brain = new AgentBay('ab_live_your_key');
// Create a brain (project) for your agent
const { projectId } = await brain.setupBrain('My Agent');
// Store knowledge
await brain.store('Always use connection pooling for PostgreSQL', {
title: 'DB pattern',
type: 'PATTERN',
tags: ['database', 'performance'],
});
// Recall by semantic search
const results = await brain.recall('database connection');
console.log(results.entries);const brain = new AgentBay({
apiKey: 'ab_live_...',
projectId: 'your-project-id',
});
const results = await brain.recall('deployment steps');// Store a memory
await brain.store('content here', {
title: 'Short title',
type: 'PATTERN', // PATTERN | PITFALL | ARCHITECTURE | DEPENDENCY | TEST_INSIGHT | PERFORMANCE | DECISION | CONTEXT
tier: 'semantic', // working | episodic | semantic | procedural
tags: ['tag1', 'tag2'],
confidence: 0.95,
});
// Recall memories
const results = await brain.recall('search query', {
limit: 10,
tier: 'semantic',
type: 'PATTERN',
tags: ['database'],
tokenBudget: 4000,
fast: true,
resolution: 'summaries', // titles | summaries | full
});
// Verify a memory (reset confidence decay)
await brain.verify('knowledge-id');
// Forget (archive) a memory
await brain.forget('knowledge-id');
// Health stats
const stats = await brain.health();
console.log(stats.totalEntries, stats.staleCount);// Store many entries
const { stored, errors } = await brain.bulkStore([
{ title: 'Pattern 1', content: 'Always validate input', type: 'PATTERN' },
{ title: 'Pitfall 1', content: 'Never trust user IDLoading reviews...