Give Hermes Agent Permanent Memory
AgentBay is the memory OS for coding agents. Connect Hermes via MCP in 60 seconds. Local-first by default; cloud, teams, and projects when you want them.
Install the SDK, use it from any Hermes skill or tool. SQLite + FTS5 store, fully offline.
pip install agentbay
from agentbay import AgentBay
brain = AgentBay() # local mode, no signup
brain.store("Always validate JWT expiry, not just signature",
title="Auth pitfall", type="PITFALL")
brain.recall("JWT validation")When you want cloud, teams, or projects, run brain.login() — your local memories migrate automatically. Paths B and C below connect via MCP instead.
Hermes supports MCP natively. Add one server entry to your Hermes config:
{
"mcpServers": {
"agentbay": {
"url": "https://www.aiagentsbay.com/api/mcp",
"headers": {
"Authorization": "Bearer ab_live_YOUR_KEY"
}
}
}
}No API key yet? Get a free one (1,000 memories, 10,000 API calls/month, no credit card).
If HTTP is blocked in your network, use the stdio transport via the npm package:
{
"mcpServers": {
"agentbay": {
"command": "npx",
"args": ["-y", "aiagentsbay-mcp@latest", "--api-key", "ab_live_YOUR_KEY"]
}
}
}Stores the API key in the config. Prefer HTTP transport when possible.
Tell Hermes to use memory proactively. If Hermes supports a system prompt, instructions file, or skill definition, add the following:
# AgentBay Memory Protocol You have AgentBay MCP connected for persistent memory across sessions. ## On every session: 1. At session start, call agentbay_memory_recall with a query about the current task to load prior context. 2. Work on the task. 3. After meaningful work, call agentbay_memory_store to save what you learned. ## What to store: - type="PATTERN": "This codebase uses X for Y" - type="PITFALL": "Do not do X because Y breaks" - type="DECISION": "We chose X over Y because Z" - type="ARCHITECTURE": "Service A talks to B via C" ## What NOT to store: - Raw code (it is in git) - Temporary debugging state - Secrets or credentials ## For shared project memory: Use agentbay_memory_store and agentbay_memory_recall with a projectId to share knowledge across agents and team members.
A versioned copy of this template is available at packages/hermes-plugin/memory-protocol.md.
Start a new Hermes session and test the round trip:
# In Hermes: > Store a test memory titled "hermes verification" with content "AgentBay is connected to Hermes." Then recall it. Tell me which search strategies found the result. # Hermes should call: # agentbay_memory_store → stores the test memory # agentbay_memory_recall → reads it back # The result should include strategies (fts, tag, vector, alias)
Code-aware recall across sessions: Hermes opens a project and asks what we know.
# Day 1 — working on auth middleware
> What do we know about auth middleware?
agentbay_memory_recall query="auth middleware"
→ Auth pitfall (PITFALL, 91%): Always validate JWT expiry,
not just signature
→ Auth pattern (PATTERN, 85%): JWT with 24h refresh tokens
> I found a race condition in the token rotation handler. Store this.
agentbay_memory_store
title="Token rotation race condition"
type="PITFALL"
content="Concurrent refresh requests can issue two valid tokens.
Use Redis lock on the refresh token ID."
tags=["auth", "jwt", "concurrency"]
# Day 7, new session
> Anything we should know about JWT?
agentbay_memory_recall query="JWT"
→ Token rotation race condition (PITFALL) ← the learning from day 1
→ Auth pitfall: always validate expiry
→ Auth pattern: 24h refresh tokensLocal → Cloud: brain = brain.login() migrates your local memories. Free tier: 1,000 memories, 10,000 API calls/month, 5 projects.
Cloud → Teams: Pro plan adds multi-agent teams with role-based permissions and auto-share policies. Useful when you have other developers (or other AI agents) on the same codebase.
Governance: every deployment exposes GET /api/v1/projects/[id]/governance with live status of encryption, audit, erasure, redaction, and permissions.
MCP tools not available?
Restart Hermes after adding the MCP config. MCP servers load at session start.
"Authentication required" error?
Verify your API key is correct and starts with ab_live_. Check theAuthorization: Bearer header format in your config.
Want pure local mode?
Skip the MCP setup entirely. Install the SDK (pip install agentbay) and call AgentBay() from a Hermes skill or tool.
Other coding agents
Same MCP server. Same SDK. Different setup.