Nowledge Mem CLI
Command-line interface for Nowledge Mem. Terminal access, scripting, and AI agent integration.
The nmem CLI gives you terminal access to your Nowledge Mem knowledge base. Search memories, browse threads, read and edit Working Memory, explore the knowledge graph, and view your activity feed, all from the shell.
If you also need browser automation, the desktop app bundles a second CLI called browse-now. It works with the Nowledge Mem Exchange extension to let agents control the user's real browser for authenticated and interactive web tasks. That browser bridge is local-only and is not exposed through Access Anywhere.
Installation
Option 1: Standalone PyPI Package
Install on any machine. Works with a local or remote Nowledge Mem server:
pip install nmem-cli
# or with uv
uv pip install nmem-cli
# or run without installing
uvx --from nmem-cli nmem --helpRequirements: Python 3.11+, Nowledge Mem running locally or reachable remotely.
Remote Access
The standalone package lets you reach your Nowledge Mem from servers, CI/CD pipelines, or remote workstations. See Access Mem Anywhere. View on PyPI.
Option 2: Bundled with Desktop App
macOS
Go to Settings → Preferences → Developer Tools and click Install CLI.
Installs to /usr/local/bin/nmem.
Windows
The CLI is automatically available after app installation. Open a new terminal window to use nmem.
Quick Start
nmem status # Check connection
nmem m search "project notes" # Search memories
nmem m search "project notes" --space work
nmem m add "Key insight" --title "Learning"
nmem wm # Read today's Working Memory
nmem wm --space work # Read Working Memory for one space
nmem spaces # List known spaces
nmem f --days 1 # Today's activity
nmem g expand <memory-id> # Explore graph connections
nmem tui # Interactive terminal UIGlobal Options
| Option | Description |
|---|---|
-j, --json | Machine-readable JSON output |
--api-url <url> | API URL (default: http://127.0.0.1:14242) |
--space <space> | Run the command inside one named space when you want a non-default context |
-v, --version | Show version |
-h, --help | Show help |
Aliases: m = memories · t = threads · wm = working-memory · g = graph · f = feed · c = communities
Memory Commands (nmem m)
Spaces are optional
If you do not use spaces, ignore --space and keep working in the default space. When you do need separate project or agent contexts, the same commands work with --space "<space name>".
List memories
nmem m # Recent 10 memories
nmem m -n 50 # List 50
nmem m --importance 0.7 # Minimum importance filterSearch
nmem m search "authentication patterns"
nmem m search "authentication patterns" --space work
nmem m search "API design" --importance 0.8
nmem m search "deploy" -l devops -l backend # Filter by labels (AND)
nmem m search "sprint" --mode deep # Graph + LLM-enhanced resultsBi-temporal search. Distinguish when something happened from when you saved it:
nmem m search "database decision" --event-from 2025-01 --event-to 2025-06
nmem m search "meeting notes" --recorded-from 2026-01-01| Option | Description |
|---|---|
-n | Max results |
-l, --label | Filter by label (repeatable) |
--importance | Minimum importance (0–1) |
--mode | normal (default, fast) or deep (graph + LLM-enhanced) |
--event-from/to | When the fact happened (YYYY, YYYY-MM, or YYYY-MM-DD) |
--recorded-from/to | When it was saved to Nowledge Mem (YYYY-MM-DD) |
Add
nmem m add "We chose PostgreSQL for task events"
nmem m add "Prefer functional components in React" \
--title "Frontend conventions" \
--unit-type preference \
--importance 0.8 \
-l frontend -l react
# Record when something actually happened (bi-temporal)
nmem m add "Decided to sunset the legacy API" \
--unit-type decision \
--event-start 2025-11 \
--when past| Option | Description |
|---|---|
-t, --title | Memory title |
-i, --importance | Importance 0–1 |
-l, --label | Add label (repeatable) |
--unit-type | fact preference decision plan procedure learning context event |
--event-start | When it happened (YYYY, YYYY-MM, YYYY-MM-DD) |
--event-end | End of a time range |
--when | past present future timeless (default: timeless) |
Show
nmem m show <id>
nmem m show <id> --content-limit 500Update
nmem m update <id> --title "New title"
nmem m update <id> --importance 0.9
nmem m update <id> --content "Updated content"Move between spaces
Use this when you already saved memories in one space and want to move them into another one.
nmem m move <id> --space "Research Agent" --to-space "Archive"
nmem m move <id1> <id2> --space "Research Agent" --to-space "Archive" -f
nmem m move --all-in-space "Research Agent" --to-space "Archive" --dry-run
nmem m move --all-in-space "Research Agent" --to-space "Archive" -f--space is the source space. --to-space is the destination. For whole-space moves, use --dry-run first if you want to preview the count before changing anything.
Delete
nmem m delete <id>
nmem m delete <id> -f # Skip confirmation
nmem m delete <id1> <id2> # Multiple IDsnmem m delete is interactive by default. For scripts, agents, CI, or any non-interactive shell, use -f so the command does not block waiting for confirmation.
Thread Commands (nmem t)
List and search
nmem t # Recent threads
nmem t list --source openclaw -n 20 # Recent OpenClaw threads only
nmem t list --offset 20 -n 20 # Next page of recent threads
nmem t search "architecture decisions"Use list when you want the newest threads in order. Use search when you want full-text matches inside thread content.
Show
nmem t show <id>
nmem t show <id> -n 50 # Show up to 50 messages
nmem t show <id> --content-limit 200Create
# From text
nmem t create -t "Quick note" -c "Remember to review the API changes"
# From a file
nmem t create -t "Meeting notes" -f notes.md
# With structured messages
nmem t create -t "Chat session" \
-m '[{"role":"user","content":"Hello"},{"role":"assistant","content":"Hi!"}]'
# With a stable ID (idempotent, safe to re-run)
nmem t create -t "OpenClaw session" --id "openclaw-abc123-session"Append
Add messages to an existing thread. Safely idempotent: duplicate messages are filtered by content hash or external ID.
# Single message
nmem t append <id> -c "Follow-up note"
# Structured messages
nmem t append <id> \
-m '[{"role":"user","content":"Question"},{"role":"assistant","content":"Answer"}]'
# With idempotency key (safe for retries / repeated hook fires)
nmem t append <id> \
-m '[{"role":"user","content":"msg"}]' \
--idempotency-key "oc-batch-session-001"Save Claude Code / Codex / Gemini CLI session
nmem t save --from claude-code # Save Claude Code session
nmem t save --from codex # Save Codex session
nmem t save --from codex -s "Summary" # With session summary
nmem t save --from gemini-cli # Save Gemini CLI sessionBy default, nmem reads Claude Code from ~/.claude and Codex from ~/.codex. If you keep those tools in a custom location, CLAUDE_CONFIG_DIR and CODEX_HOME are respected automatically.
| Option | Description |
|---|---|
--from | claude-code, codex, or gemini-cli (required) |
-p, --project | Project directory path (default: current dir) |
-m, --mode | current (latest) or all sessions |
--session-id | Specific session ID (Codex only) |
-s, --summary | Brief session summary |
--truncate | Truncate large tool results (>10KB) |
Delete
nmem t delete <id>
nmem t delete <id> -f # Force
nmem t delete <id> --cascade # Also delete associated memoriesMove between spaces
nmem t move <id> --space "Research Agent" --to-space "Archive"
nmem t move <id1> <id2> --space "Research Agent" --to-space "Archive" -f
nmem t move --all-in-space "Research Agent" --to-space "Archive" --dry-run
nmem t move --all-in-space "Research Agent" --to-space "Archive" -fAs with memories, --space is the source guard and --to-space is the destination. Mem resolves whole-space moves on the server, so scripts do not need to page through every result first.
Library Sources (nmem sources)
Your Library (PDFs, spreadsheets, Word files, presentations, Markdown, code, and URLs) is reachable from the terminal. Use nmem sources when a script needs to find a document, read a passage from it, or pull structured analysis out of a spreadsheet without opening the app.
nmem sources aliases to nmem s.
List, add, show, delete
nmem sources list # Sources in the current space
nmem sources add notes.pdf # Import a file
nmem sources add https://example.com/doc # Capture a URL
nmem sources show src_abc123 # Metadata for one source
nmem sources delete src_abc123 -f # Delete (non-interactive)Search across the Library
nmem sources search "meeting notes"
nmem sources search roadmap -n 10Full-text match against filenames and parsed summaries. Returns source IDs you can feed into the commands below.
Read parsed content
nmem sources read src_abc123 # First 8000 characters
nmem sources read src_abc123 --offset 8000 # Next page
nmem sources read src_abc123 --limit 16000 # Larger windowReturns the parsed text of one document, paged by character offset. Useful for feeding a specific section into another tool.
Search inside a single document
nmem sources search-chunks src_abc123 "risk factors"
nmem sources search-chunks src_abc123 budget -n 3Runs a full-text search against the indexed chunks of one source. Each match comes back with the actual passage, chunk index, and score, so you and any downstream agent can see what was matched, not just how many chunks matched.
Analyze tabular sources
nmem sources analyze src_abc123 # All columns
nmem sources analyze src_abc123 --column price --column region # Specific columnsRuns structured analysis on CSV, TSV, XLSX, or XLS sources: column stats, distributions, and basic shape. For narrative documents, use search-chunks and read instead.
Same tools your agents use
search, read, search-chunks, and analyze are the same Library tools available to AI Now, the Feed Agent, the Graph Intelligence Agent, and MCP-connected clients. Anything you can do from the terminal, agents can do on your behalf, and vice versa.
Working Memory (nmem wm)
Working Memory is the AI-generated daily briefing: focus areas, open questions, and recent activity. Background Intelligence updates it each morning.
The Default space keeps the familiar compatibility file at ~/ai-now/memory.md. If spaces are enabled, nmem wm can read or edit the briefing for any space with --space "<space name>".
Read
nmem wm # Today's Working Memory
nmem wm --space work # Working Memory for one space
nmem wm --date 2026-02-12 # Archived date
nmem wm history # List available archived datesEdit
nmem wm edit # Opens $EDITOR
nmem wm edit --space work # Edit one space
nmem wm edit -m "## Focus Areas\n- Ship v0.6" # Set directlyPatch a section (non-destructive)
Replace or append to one section without touching the rest of the document:
# Replace a section
nmem wm patch --heading "## Focus Areas" --content "- Finish OpenClaw plugin release"
# Append to a section
nmem wm patch --heading "## Notes" --append "Reminder: deploy to staging tonight"The heading is matched case-insensitively and partially. "Focus" matches "## Focus Areas".
Spaces (nmem spaces)
Use this only when you want more than the default space.
nmem spaces
nmem spaces create "Research Agent"
nmem spaces update "Research Agent" --instructions "Prefer research notes and hypotheses"
nmem spaces show "Research Agent"If you need a stable storage key for automation, --id is still available as an advanced option. Most people should let Mem generate it.
Graph Commands (nmem g)
Expand graph neighborhood
Explore connected memories, entities, crystals, and source documents around a given memory:
nmem g expand <memory-id>
nmem g expand <memory-id> --depth 2 # Two hops out
nmem g expand <memory-id> -n 10 # Limit neighbors per hopShow EVOLVES version chain
See how a memory has been refined or superseded over time:
nmem g evolves <memory-id>Feed (nmem f)
The activity feed shows what was saved, learned, synthesized, or ingested, in chronological order.
nmem f # Last 7 days (high-signal events)
nmem f --days 1 # Today only
nmem f --days 30 # Last 30 days
nmem f --type crystal_created # Only crystal synthesis events
nmem f --from 2026-02-10 --to 2026-02-14 # Exact date range
nmem f --all # Include low-signal background events
nmem f -n 50 # Limit events (default: 100)| Option | Description |
|---|---|
--days | How many days back (default: 7; use 1 for today) |
--type | Filter by event type |
-n, --limit | Max events to fetch (default: 100) |
--all | Include low-signal background events |
--from, --to | Exact date range (YYYY-MM-DD) |
Event types: memory_created · crystal_created · insight_generated · source_ingested · source_extracted · daily_briefing · url_captured
Knowledge Communities (nmem c)
Browse topic clusters automatically detected in your knowledge graph:
nmem c # List communities
nmem c -n 20
nmem c show <community-id> # Show community details (entities, memories)
nmem c detect # Trigger community detection (background)Configuration & Models
Search Index Model
nmem models status # Check current model status
nmem models download # Download the Search Index Model
nmem models reindex # Rebuild the search indexLLM provider
nmem config provider list
nmem config provider set openai --api-key sk-xxx --model gpt-4o
nmem config provider testProcessing settings
nmem config settings # Show all settings
nmem config settings set briefingHour 8 # Change morning briefing timeClient connection settings
Use this when the current machine needs to connect to a remote Mem server:
nmem config client show
nmem config client set url https://mem.example.com
nmem config client set api-key nmem_...
nmem config client clear api-keynmem config client ... updates the local client config used by this machine's CLI and plugins. It is separate from nmem config access ..., which controls how a Mem server is exposed to other devices.
License
nmem license status
nmem license activate <key> [email] # Email is inferred from the license key when possible
nmem license renew # Refresh or renew this device's authorization
nmem license deactivate # Deactivate license on this deviceRemote Access
# LAN / private network
export NMEM_API_URL=http://192.168.1.100:14242
nmem status
# Cloudflare tunnel (from desktop app: Settings → Access Mem Anywhere)
export NMEM_API_URL=https://<your-url>
export NMEM_API_KEY=nmem_...
nmem m search "notes"
# One-off without env vars
nmem --api-url https://<your-url> status| Variable | Description | Default |
|---|---|---|
NMEM_API_URL | API server URL | http://127.0.0.1:14242 |
NMEM_API_KEY | API key (Bearer auth) | (unset) |
Full guide: Access Mem Anywhere.
JSON Output
Add --json (or -j) before the subcommand for machine-readable output:
nmem --json m search "API design" | jq '.memories[0].id'
nmem --json m add "Note" | jq -r '.id'
nmem --json f --days 1 | jq '.events[].title'Search response
{
"query": "API design",
"total": 3,
"search_mode": "fast_bm25_vector",
"memories": [
{
"id": "abc123-def456-...",
"title": "REST API versioning decision",
"content": "We use /v1/ prefix for all public endpoints...",
"score": 0.91,
"relevance_reason": "Text Match (89%) + Semantic Match (73%) | decay[imp:high]",
"importance": 0.8,
"labels": ["architecture", "api"],
"event_start": "2025-09",
"temporal_context": "past",
"source": "cli"
}
]
}Feed response
{
"events": [
{
"id": "evt-...",
"event_type": "memory_created",
"severity": "info",
"title": "Memory or event title",
"description": "Summary text...",
"metadata": { "source": "claude", "unit_type": "fact" },
"related_memory_ids": ["..."],
"created_at": "2026-02-20T02:35:28+00:00"
}
]
}Error response
{
"error": "api_error",
"status_code": 404,
"detail": "Memory not found"
}Status and Statistics
nmem status
# nmem v0.6.2
# status ok
# api http://127.0.0.1:14242
# database connected
# search ready
nmem stats
# Database Statistics
# memories 83
# threads 27
# entities 248
# labels 177
# communities 32If search needs attention, nmem status tells you which case you are in:
search rebuild needed: runnmem models reindexsearch updating metadata: Mem is filling new search metadata in the background. No rebuild is needed.
AI Agent Integration
The --json flag and stable exit codes make nmem easy to drive from AI agents.
# Search for context before responding
nmem --json m search "authentication flow" | jq '.memories[:3]'
# Save an insight
nmem m add "Rate limiting is per-user, not per-IP" \
--unit-type learning --importance 0.8 -l backend
# Save a decision with when it was made
nmem m add "Chose Postgres over MySQL for task events" \
--unit-type decision --event-start 2026-02 -l architecture
# Browse what was worked on last week
nmem --json f --days 7 | jq '.events[].title'
# Create a session thread backup
nmem t create -t "Debug session $(date +%Y%m%d)" \
-m '[{"role":"user","content":"Investigate auth failures"},{"role":"assistant","content":"Found rate limit issue"}]'TUI
An interactive terminal UI for browsing memories, threads, and the knowledge graph:
nmem tuiIf you launch the TUI with NMEM_SPACE="Research Agent", the Memories and Threads tabs stay inside that space. This is useful for agent workstations or terminal-only servers where one shell session belongs to one project or agent lane.
For moving many records between spaces, use the app or the nmem m move / nmem t move commands. The TUI keeps browsing and editing scoped, but it does not add a separate multi-select move workflow.
In the Settings tab, you can also manage Access Anywhere (Quick link / stable Cloudflare account mode) from terminal-only environments. This is the same remote-access feature documented in Access Mem Anywhere.

Troubleshooting
"command not found: nmem"
- PyPI install:
pip install nmem-cli(Python 3.11+) - Run without installing:
uvx --from nmem-cli nmem --help - macOS desktop: Settings → Preferences → Developer Tools → Install CLI
- Windows: open a new terminal after app installation
"Cannot connect to server"
- Ensure Nowledge Mem is running
- Try:
nmem --api-url http://127.0.0.1:14242 status - Check for proxy or VPN blocking localhost