agentmemory-rest-api
This skill provides the HTTP REST API surface for agentmemory, serving as the primary protocol for interacting with the memory server. It enables AI agents to store and retrieve memories via standard HTTP, ensuring efficient knowledge base management and access in various scenarios, such as when a specific protocol is unavailable or when integrating with incompatible hosts. This significantly enhances the agent's adaptability and data interaction capabilities.
npx skills add https://github.com/rohitg00/agentmemory --skill agentmemory-rest-apiBefore / After Comparison
1 组Without a standardized HTTP API, users or developers had to spend significant time manually developing or adapting specific communication protocols for AI agents to interact with memory servers, making the integration process complex and time-consuming.
This skill provides an out-of-the-box HTTP REST API, allowing AI agents to quickly and conveniently store and retrieve memories via a standard protocol. This drastically reduces integration effort and time, improving development efficiency and system compatibility.
REST is agentmemory's primary surface. MCP is a bridge on top of it. Every memory operation has an HTTP endpoint under http://localhost:3111/agentmemory/*.
Quick start
# liveness
curl -fsS http://localhost:3111/agentmemory/livez
# For this fixed loopback URL only. Do not print the value or enable shell tracing.
agentmemory_secret="${AGENTMEMORY_SECRET:-$(cat "$HOME/.agentmemory/secret")}"
test -n "$agentmemory_secret" || exit 1
# save
curl -fsS -X POST http://localhost:3111/agentmemory/remember \
-H "Authorization: Bearer $agentmemory_secret" \
-H "Content-Type: application/json" \
-d '{"content":"chose JWT refresh rotation","concepts":["jwt-refresh-rotation"]}'
# recall
curl -fsS -X POST http://localhost:3111/agentmemory/smart-search \
-H "Authorization: Bearer $agentmemory_secret" \
-H "Content-Type: application/json" \
-d '{"query":"auth token strategy","limit":5}'
Auth
Every endpoint except liveness requires Authorization: Bearer <secret>, including on localhost. The server always has a secret: AGENTMEMORY_SECRET when you set one, otherwise one it generates at first start. Requests without the header get 401. Liveness is public. The example uses an explicit environment secret or the generated local secret file; if the daemon uses a secret from its .env, load that value locally without displaying it. For a remote daemon, require an explicit credential for that endpoint and HTTPS. Never forward a local-file secret or follow an authenticated redirect to another host. See TROUBLESHOOTING.md.
Conventions
- Save returns
201, reads return200, validation errors return400. - Use documented fields only. A successful response does not prove an unsupported field was applied.
- The REST port defaults to
3111and is configurable with--portor--instance. The viewer defaults to3113; the internal engine WebSocket defaults to49134.
See also
- agentmemory-mcp-tools for the MCP equivalents.
- agentmemory-config for local configuration and the secret.
Reference
The full endpoint list with methods lives in REFERENCE.md, generated from src/triggers/api.ts.
User Reviews (0)
Write a Review
No reviews yet
Statistics
User Rating
Rate this Skill