The hm command-line tool gives terminal-based agents and developers direct access to HyperMemory. It communicates with the server via the REST API using an API key.
pip install hypermemory-cliVerify:
hm version- Create an API key at app.hypermemory.io/integration
- Configure the CLI:
hm config --set-key hm_YOUR_API_KEY_HEREOr set it as an environment variable:
export HYPERMEMORY_API_KEY=hm_YOUR_API_KEY_HEREThe config file is stored at ~/.config/hypermemory/config.json.
Priority order: environment variable > config file.
For interactive use, you can authenticate via browser:
hm loginThis opens a browser window for Supabase Auth login using OAuth 2.1 + PKCE. Tokens are saved to the config file and refreshed automatically on 401 responses.
To log out:
hm logoutTo point at a different server (e.g. self-hosted):
hm config --set-url https://your-server.example.comDefault: https://api.hypermemory.io
Get graph statistics — node count, types, and top nodes.
hm overviewSearch memory using hybrid search (BM25 + vector + session context).
hm recall "user preferences for frontend frameworks"Store a new memory node. --type is required.
hm store tech_redis "Redis is used for rate limiting and session caching" --type technologyWith optional structured data:
hm store tech_redis "Redis 7.x for caching" --type technology \
--data '{"version": "7.x", "role": "cache"}'With relationships:
hm store tech_redis "Redis for caching" --type technology \
--rels '[{"to_key": "project_api", "relationship": "provides session caching for the API"}]'Update an existing node's description, type, or data.
hm update tech_redis --desc "Redis 7.2 — now also used for pub/sub"
hm update tech_redis --type technology --data '{"version": "7.2"}'Delete a node. Use --cascade to also remove connected edges.
hm forget old_preference
hm forget old_preference --cascadeSend dense text to the server for LLM-powered decomposition into entities and relationships.
hm ingest "The API is built with FastAPI, uses Redis for caching, and PostgreSQL for storage. The team decided on JWT auth after evaluating session-based alternatives."With an optional context label:
hm ingest "..." --context "architecture meeting notes"Traverse the graph from a starting node to discover related information.
hm find tech_redis
hm find tech_redis --depth 3List all edges connected to a node.
hm relationships tech_redisCreate a relationship between two nodes.
hm relate --from tech_redis --to project_api --rel "provides session caching"Query the activity timeline. Supports filtering by query, time period, node, or date range.
hm timeline
hm timeline --query "deployment"
hm timeline --period 24h
hm timeline --period 7d --limit 20
hm timeline --start 2025-01-01 --end 2025-01-31
hm timeline --node tech_redisPeriod values: 1h, 3h, 6h, 12h, 24h, 3d, 7d, 14d, 30d, 90d, 1y.
Write a manual diary entry to the timeline.
hm timeline-write "Completed the database migration to PostgreSQL 16"Check server connectivity.
hm healthExport the full graph as JSON. Use --no-ontology to exclude type definitions.
hm export
hm export --no-ontologyView or update CLI configuration.
hm config # Show current config
hm config --set-key hm_xxxx # Set API key
hm config --set-url https://... # Set server URLOAuth browser login and token cleanup.
hm login
hm logoutPrint the CLI version.
hm version| Command | Purpose |
|---|---|
hm overview |
Graph stats and top nodes |
hm recall "query" |
Search memory |
hm store KEY "desc" --type TYPE |
Store new information |
hm ingest "text" |
Decompose text into entities |
hm update KEY --desc "..." |
Update existing node |
hm forget KEY |
Delete a node |
hm relate --from A --to B --rel "..." |
Create a relationship |
hm find KEY |
Graph traversal |
hm relationships KEY |
List edges for a node |
hm timeline |
Query timeline events |
hm timeline-write "..." |
Write a diary entry |
hm health |
Check server status |
hm export |
Export full graph |
hm config |
View/set configuration |
hm login |
OAuth browser login |
hm logout |
Clear OAuth tokens |
hm version |
Print version |
The CLI is designed for agentic systems like OpenClaw that run in a terminal. Install the CLI skill file to teach the agent how to use hm commands on every message.
Environment setup for agents:
export HYPERMEMORY_API_KEY=hm_YOUR_KEYThe agent's skill instructs it to:
- Run
hm overview+hm recallat the start of every conversation - Store new information with
hm storeautomatically - Use
hm recallbefore storing to avoid duplicates
The CLI sends requests to {api_url}/api/v1/memory/*. All commands map to REST endpoints — see the API reference for details.