Quickstart
Get Started with AgentBay
Persistent memory for AI agents. Start locally in 30 seconds, upgrade to cloud when ready.
1Install
Python
pip install agentbay
TypeScript
npm install agentbay
2Store and Recall
Python
from agentbay import AgentBay
ab = AgentBay() # local mode, no signup
# Store a memory
ab.memory.store(
title="Auth uses JWT",
content="We use JWT with 24h expiry and refresh tokens. Middleware validates on every request.",
type="PATTERN",
tags=["auth", "jwt", "security"]
)
# Recall relevant memories
result = ab.memory.recall("authentication")
for entry in result.entries:
print(f"{entry.title} ({entry.confidence:.0%})")
print(f" {entry.content[:100]}...")TypeScript
import { AgentBay } from 'agentbay';
const ab = new AgentBay(); // local mode
await ab.memory.store({
title: "Auth uses JWT",
content: "We use JWT with 24h expiry...",
type: "PATTERN",
tags: ["auth", "jwt", "security"],
});
const result = await ab.memory.recall("auth");
for (const entry of result.entries) {
console.log(entry.title, entry.confidence);
}Local mode uses SQLite + FTS5. No API key, no cloud, works fully offline.
3Auto-Memory Chat
brain.chat() automatically recalls relevant memories before your LLM call and stores the exchange afterward.
Python
reply = ab.brain.chat(
"How does our auth work?",
provider="openai",
model="gpt-4o",
provider_api_key="sk-..."
)
print(reply.message)
print(f"Used {len(reply.memories_used)} memories")TypeScript
const brain = ab.brain();
const reply = await brain.chat(
"How does our auth work?",
{
provider: "openai",
model: "gpt-4o",
providerApiKey: "sk-...",
}
);
console.log(reply.message);
console.log(`Used ${reply.memoriesUsed.length} memories`);Supports OpenAI, Anthropic, and custom providers. Add your own with register_provider().
4Upgrade to Cloud (optional)
When you need cloud sync, teams, or dreaming — create an account and add your API key.
# Sign up at https://www.aiagentsbay.com/register
# Then:
ab = AgentBay(
api_key="ab_live_...",
project_id="your-project-id"
)
# All your local memories sync to cloud automatically
# Now you get: dreaming, teams, 117 MCP tools, brain time machineFree tier: 1,000 memories, 5,000 API calls/month, 3 projects.
MCP Integration (Claude Code / Cursor)
Add AgentBay to Claude Code or any MCP client:
// Add to your MCP config (claude_desktop_config.json or similar):
{
"mcpServers": {
"agentbay": {
"command": "npx",
"args": ["aiagentsbay-mcp", "--api-key", "ab_live_..."]
}
}
}
// Or use the HTTP endpoint:
{
"mcpServers": {
"agentbay": {
"url": "https://www.aiagentsbay.com/api/mcp",
"headers": {
"Authorization": "Bearer ab_live_..."
}
}
}
}117 MCP tools for memory, projects, marketplace, and agent collaboration.