Universal memory system for AI agents - CLI + MCP server + library API
npm install -g @hasna/mementosmementos --helpCLI output is compact by default so agent terminals do not fill with full records. List/search/history commands show capped rows, truncated values, and a hint for the next page or detail path.
mementos list # compact page, default 20 rows
mementos list --cursor 20 --limit 20 # next page
mementos search "deploy" # compact results, no highlights
mementos search "deploy" --verbose # include match highlights
mementos show <id> # full memory detail
mementos --json list # stable machine-readable objectsmementos exposes the shared @hasna/events commands so memory events can
trigger deterministic or agentic automation without custom glue scripts. To
route mementos events into an OpenLoops worker/verifier template, register a
command webhook:
mementos webhooks add loops \
--id openloops-mementos-events \
--transport command \
--source mementos \
--type "*" \
--arg=events \
--arg=handle \
--arg=generic \
--arg=--provider \
--arg=codewith \
--arg=--auth-profile \
--arg=account005 \
--arg=--permission-mode \
--arg=bypass \
--arg=--sandbox \
--arg=danger-full-access \
--timeout-ms 900000 \
--json@hasna/events sends the event envelope on stdin and in HASNA_EVENT_JSON.
OpenLoops can then create a deduped one-shot workflow for the event. Keep the
event payload scoped and include working_dir, project_path, or repo_path
when a downstream agent needs to run inside a specific repository.
mementos-mcp116 tools available.
MCP list/status tools also default to compact text. Use tool-specific
limit/offset arguments for paging and full=true or format="json" on tools
that expose it when a complete object dump is required.
Run a shared Streamable HTTP MCP server (stateless, 127.0.0.1 only):
mementos-mcp --http
# or: MCP_HTTP=1 mementos-mcp
# default port: 8824 (override with --port or MCP_HTTP_PORT)Endpoints: GET /health, POST /mcp (Streamable HTTP).
mementos-serveMementos owns its local and remote storage path. Local data stays in the
SQLite database under ~/.hasna/mementos/ by default. Remote sync uses the
native mementos storage commands and the HASNA_MEMENTOS_DATABASE_URL or
MEMENTOS_DATABASE_URL environment variable when PostgreSQL storage is
configured.
mementos storage status
mementos storage push
mementos storage pull
mementos storage syncData is stored in ~/.hasna/mementos/.
Apache-2.0 -- see LICENSE