agentmemory-cli
v1.4.0
Published
CLI tool for AgentMemory - persistent cloud memory for AI agents
Maintainers
Readme
AgentMemory CLI
Command-line interface for AgentMemory - persistent cloud memory for AI agents.
Installation
npm (recommended)
npm install -g agentmemory-clinpx (no install)
npx agentmemory-cli store "Your memory"curl installer
curl -fsSL https://agentmemory.cloud/install.sh | bashQuick Start
- Initialize with your API key:
agentmemory init
# Enter your API key from https://agentmemory.cloud/dashboard- Store a memory:
agentmemory store "User prefers dark mode and likes updates at 9 AM"- Search memories:
agentmemory search "user preferences"Commands
| Command | Description |
|---------|-------------|
| agentmemory init | Configure your API key |
| agentmemory store <content> | Store a new memory |
| agentmemory search <query> | Semantic search |
| agentmemory list | List all memories |
| agentmemory delete <id> | Delete a memory |
| agentmemory sync | Sync with local MEMORY.md |
| agentmemory export | Export as JSON |
| agentmemory import <file> | Import from JSON |
Options
Global Options
--json- Output as JSON (for scripting)--help- Show help
Store Options
agentmemory store "content" --category preferences
agentmemory store "content" --metadata '{"priority": "high"}'Search Options
agentmemory search "query" --limit 20Sync Options
agentmemory sync # Bidirectional sync
agentmemory sync --push # Push local to cloud only
agentmemory sync --pull # Pull cloud to local only
agentmemory sync --status # Check sync statusConfiguration
Configuration is stored in ~/.agentmemory/config.json:
{
"api_key": "am_xxxxx",
"api_url": "https://agentmemory.cloud/api",
"memory_file": "./MEMORY.md"
}Environment Variables
You can also use environment variables:
export AGENTMEMORY_API_KEY=am_xxxxx
export AGENTMEMORY_API_URL=https://agentmemory.cloud/apiMEMORY.md Sync
The CLI can sync with a local MEMORY.md file, enabling:
- Offline editing - Edit memories locally, sync later
- Backup - Keep a local copy of all memories
- Migration - Import existing MEMORY.md files
Format
# Agent Memory
> Last synced: 2026-02-01T12:00:00Z
> Total memories: 42
---
<!-- id: abc123 -->
<!-- metadata: {"category": "preferences"} -->
User prefers dark mode
---
<!-- id: def456 -->
Another memory here
---Examples
Store with metadata
agentmemory store "Project deadline is March 15" \
--category deadline \
--metadata '{"project": "website-redesign", "priority": "high"}'Export and backup
# Export to file
agentmemory export --output backup.json --pretty
# Export to stdout (for piping)
agentmemory export > memories-$(date +%Y%m%d).jsonImport memories
agentmemory import backup.jsonScripting with JSON output
# Get memories as JSON for processing
agentmemory list --json | jq '.memories[].content'
# Search and process results
agentmemory search "preferences" --json | jq '.[] | .content'For AI Agents
Add to your agent's skill file:
# Store a memory
agentmemory store "$MEMORY_CONTENT"
# Search before asking
RESULTS=$(agentmemory search "$QUERY" --json)
# Sync at session start
agentmemory sync --pullSupport
- Documentation: https://agentmemory.cloud/docs
- Dashboard: https://agentmemory.cloud/dashboard
- Issues: https://github.com/agentmemory/agentmemory-cli/issues
License
MIT
