Nowledge Mem CLI
Command-line interface for Nowledge Mem
The nmem CLI provides terminal access to your Nowledge Mem knowledge base. It's designed for developers, automation workflows, and AI agents.
Installation
macOS
Navigate to Settings → Preferences → Developer Tools and click Install CLI.
This creates a symlink at /usr/local/bin/nmem (requires administrator permission).
Windows
The CLI is automatically installed with the app. Open a new terminal window after installation to use nmem.
Location: %LOCALAPPDATA%\nmem
Linux
The CLI is included with deb/rpm packages and configured automatically.
Location: /usr/local/bin/nmem
Quick Start
# Check server connection
nmem status
# Search memories
nmem m search "project notes"
# List recent memories
nmem m
# Add a memory
nmem m add "Important insight" --title "Project Learnings"
# Search threads
nmem t search "architecture"
# Show thread details
nmem t show <thread-id>
# Run nmem terminal UI
nmem tui
# connect to a remote nmem server, to enable mem server binding to non loopback address, go to settings--> preferences
export NMEM_API_URL=http://10.1.2.3:14242
nmem status Global Options
| Option | Description |
|---|---|
-j, --json | Output as JSON (for scripting/agents) |
--api-url <url> | Custom API URL (default: http://127.0.0.1:14242) |
-v, --version | Show version |
-h, --help | Show help |
Commands
nmem status
Check server connection and version.
$ nmem status
nmem v0.5.3
status ok
api http://127.0.0.1:14242
database connectednmem stats
Show database statistics.
$ nmem stats
Database Statistics
memories 83
threads 27
entities 248
labels 177
communities 32Memory Commands
Use nmem memories or the alias nmem m.
nmem m
List memories.
nmem m # List recent (default: 10)
nmem m -n 50 # List 50 memories
nmem m --importance 0.7 # Filter by minimum importancenmem m search <query>
Search memories with advanced filters.
nmem m search "authentication patterns"
nmem m search "API design" --importance 0.8
nmem m search "meeting" -l work -t month # Filter by label and time
nmem m search "project" -l design -l frontend # Multiple labels (AND)| Option | Description |
|---|---|
-l, --label | Filter by label name (can use multiple times) |
-t, --time | Time filter: today, week, month, year |
--importance | Minimum importance threshold (0-1) |
nmem m show <id>
Show memory details.
nmem m show abc123-def456-...
nmem m show abc123 --content-limit 500 # Truncate contentnmem m add <content>
Create a new memory.
nmem m add "Key insight about caching strategies"
nmem m add "Technical decision" --title "Architecture Notes" --importance 0.9nmem m update <id>
Update an existing memory.
nmem m update abc123 --title "New Title"
nmem m update abc123 --importance 0.8
nmem m update abc123 --content "Updated content"nmem m delete <id>
Delete a memory.
nmem m delete abc123
nmem m delete abc123 -f # Force (no confirmation)Thread Commands
Use nmem threads or the alias nmem t.
nmem t / nmem t list
List threads.
nmem t # List recent (default: 20)
nmem t -n 50 # List 50 threadsnmem t search <query>
Search threads (searches both titles and message content).
nmem t search "database migration"
nmem t search "python" -n 20nmem t show <id>
Show thread details with messages.
nmem t show ext-cursor-12345
nmem t show ext-cursor-12345 -m 50 # Show up to 50 messages
nmem t show ext-cursor-12345 --content-limit 200 # Truncate message contentnmem t create
Create a new thread.
# Single message (creates user message)
nmem t create -t "Quick Note" -c "Remember to review the API changes"
# From markdown file
nmem t create -t "Meeting Notes" -f notes.md
# Multi-message (JSON array)
nmem t create -t "Chat Session" -m '[{"role":"user","content":"Hello"},{"role":"assistant","content":"Hi!"}]'File Import
When importing from a .md file:
- Cursor export format: Parsed as multi-message thread
- Plain markdown: Imported as single "document" message
nmem t delete <id>
Delete a thread.
nmem t delete ext-cursor-12345
nmem t delete ext-cursor-12345 -f # Force (no confirmation)
nmem t delete ext-cursor-12345 --cascade # Also delete associated memoriesJSON Output
Use --json or -j for machine-readable output.
# Search and parse with jq
nmem --json m search "API" | jq '.memories[0].id'
# Chain commands
ID=$(nmem --json m add "Note" | jq -r '.id')
nmem --json m update "$ID" --importance 0.9
# Get all memory content
nmem --json m search "project" | jq '.memories[] | {id, title, content}'Response Format
Success:
{
"query": "search term",
"total": 10,
"memories": [
{
"id": "abc123-def456-...",
"title": "Memory Title",
"content": "Full memory content...",
"score": 0.85,
"source": "ai-now"
}
]
}Error:
{
"error": "api_error",
"status_code": 404,
"detail": "Resource not found"
}Environment Variables
| Variable | Description | Default |
|---|---|---|
NMEM_API_URL | API server URL | http://127.0.0.1:14242 |
# Use custom API URL
export NMEM_API_URL=http://localhost:8080
nmem statusAI Agent Integration
The CLI is optimized for AI agents that execute shell commands.
Example: Cursor/Claude Code Agent
# Agent searches for context
nmem --json m search "authentication flow" | jq '.memories[:3]'
# Agent saves insights
nmem m add "Discovered rate limiting issue in auth service" --title "Auth Investigation"
# Agent creates session backup
nmem t create -t "Debug Session $(date +%Y%m%d)" -m '[
{"role":"user","content":"Investigate auth failures"},
{"role":"assistant","content":"Found rate limiting issue..."}
]'Example: Automation Script
#!/bin/bash
# Daily knowledge backup script
# Export recent memories
nmem --json m -n 100 > ~/backups/memories-$(date +%Y%m%d).json
# Check for high-importance items
nmem --json m --importance 0.9 | jq '.memories | length'
# List to get full IDs
nmem --json m | jq '.memories[].id'TUI
We know you are terminal lovers, CLI might be for Agents and Programs, but we also have a TUI for you.
# Run nmem terminal UI
nmem tui

Troubleshooting
"command not found: nmem"
- macOS: Install CLI from Settings → Preferences → Developer Tools
- Windows: Open a new terminal window after app installation
- Linux: Ensure
/usr/local/binis in your PATH
"Cannot connect to server"
- Ensure Nowledge Mem is running
- Check the API URL:
nmem --api-url http://127.0.0.1:14242 status - Check for proxy/VPN blocking localhost