GuidesUsing the CLI
Managing Memories
Create, update, organize, and delete memories using the mx CLI.
Memories are the fundamental unit in MemNexus. Each memory stores a piece of information with metadata like topics, importance, and timestamps.
Creating memories
Interactive mode
mx memories create --interactive
This walks you through each field with validation and defaults.
Direct mode
mx memories create \
--content "Deployed v1.26.2 of core-api. Fixed OpenAPI validation issues." \
--topics "deployment,core-api,openapi" \
--importance 0.8
With a conversation
Group related memories into conversations for temporal context:
# Start a new conversation
mx memories create \
--conversation-id "NEW" \
--content "Starting work on API rate limiting feature." \
--topics "core-api,rate-limiting,in-progress"
# Continue the same conversation (use the ID from the output)
mx memories create \
--conversation-id "conv_abc123" \
--content "Added rate limit middleware. 100 req/min default." \
--topics "core-api,rate-limiting,in-progress"
Listing memories
mx memories list
Pagination
mx memories list --page 0 --limit 50
mx memories list --page 1 --limit 50
Output formats
mx memories list --format table # Human-readable (default)
mx memories list --format json # Machine-readable
mx memories list --format yaml # Structured
Getting a memory
mx memories get <memory-id>
Batch get
Fetch multiple memories in one call:
mx memories get <id1> <id2> <id3>
Or pipe search results directly:
mx memories search --query "deployment" --id-only | mx memories get --stdin
Updating memories
mx memories update <memory-id> \
--content "Updated content here" \
--importance 0.9
Deleting memories
mx memories delete <memory-id>
Skip the confirmation prompt:
mx memories delete <memory-id> --force
Working with conversations
List conversations
mx conversations list
mx conversations list --recent 24h
mx conversations list --recent 7d
View a conversation timeline
mx conversations timeline <conv-id>
This shows all memories in chronological order — useful for reconstructing what happened during a work session.
Working with topics
List topics
mx topics list
Discover related topics
mx topics discover-related --topic-id <id>
Find similar topics
mx topics find-similar --topic-id <id> --threshold 0.7
Cluster topics
mx topics cluster --algorithm kmeans --num-clusters 5
Working with facts
Facts are structured knowledge stored as subject-predicate-object triples:
mx facts create \
--subject "MemNexus" \
--predicate "built_with" \
--object "Node.js" \
--confidence 1.0
Search facts
mx facts search --query "Node.js"
Scripting tips
Export high-importance memories
mx memories list --format json --limit 1000 | \
jq '.data[] | select(.importance > 0.8)'
JSON format for automation
Always use --format json in scripts. The table format is for humans only.
#!/bin/bash
set -e
# Search and process results
mx memories search --query "deployment" --format json | \
jq -r '.data[].memory.id'
Next steps
- Search — Find memories by meaning or keywords
- Core Concepts — Understand the data model