cortexdb-cli
Command-line interface for CortexDB — the long-term memory layer for AI systems.
Wraps the v1 HTTP API in a small, fast Click + Rich CLI. Anonymous signup in one command, no email or card; works against the public SaaS or any self-hosted CortexDB deployment.
Install
pip install cortexdb-cli
Requires Python 3.10+.
Quickstart
# 1. One-time setup — anonymous signup, writes ~/.cortexdb/state.json
cortexdb init
# 2. Store a memory
cortexdb remember "Q3 revenue: $2.4M. We're on track for $10M ARR by year-end."
# 3. Recall it
cortexdb recall "Q3 revenue?"
# 4. Or just type — drops into a REPL
cortexdb
The signup token has a 7-day TTL on the free tier.
Re-running cortexdb init does not refresh it. init reuses an existing
identity and changes nothing; against an expired one it refuses and exits 3.
That is deliberate: a new identity is a new brain, and memories written
under the old actor stay where they are, unreachable from the new config.
When a token expires you have two safe options:
cortexdb init --api-key <token> --actor <actor>— keep the same brain with a token you already hold (e.g. from your IdP).cortexdb init --force— deliberately start a NEW brain. The previous identity is backed up tostate.json.replacedfirst.
For a second brain alongside the first, isolate instead of replacing:
cortexdb --config-dir <dir> init, or set CORTEXDB_HOME.
Commands
cortexdb init anonymous signup; persist token + actor
cortexdb remember "..." store a memory (POST /v1/experience)
cortexdb recall "..." recall a stratified context pack
cortexdb search "..." granular event-level search
cortexdb forget --memory-id ... delete with audit
cortexdb episodes {list,get,delete} episode CRUD
cortexdb entities {list,get,link} entity rollups over the Facts layer
cortexdb admin {health,usage,layers} diagnostics
cortexdb import data.json bulk-load (JSON / JSONL / CSV / TXT)
cortexdb export -o backup.json export memories
cortexdb config {show,set} view / edit ~/.cortexdb/config.toml
cortexdb interactive REPL
Configuration
Three layers, in precedence order:
- CLI flags —
--api-key,--endpoint,--actor,--scope,--profile - Environment —
CORTEXDB_API_KEY,CORTEXDB_URL,CORTEXDB_ACTOR,CORTEXDB_SCOPE - Persisted state:
~/.cortexdb/config.toml— endpoint, profile names (human-editable)~/.cortexdb/state.json— token, actor, scope, expiry (managed byinit, 0600 on POSIX)
The state.json format matches the cortexdb-mcp 0.3.0 server's, so you can copy state across to use both tools from the same anonymous identity.
Pipe-friendly
Auto-detects when stdout isn't a TTY and emits JSON:
cortexdb recall "Q3 revenue" | jq .context_block
cortexdb entities list | jq '.[].subject'
echo "remember this" | cortexdb remember -
Force JSON mode any time with --json.
Auth notes
- The v1 API requires both
Authorization: Bearer <PASETO>andX-Cortex-Actor. The CLI stamps both on every request — you never need to pass them by hand. - 401s show the specific error code (
TOKEN_EXPIRED,actor_mismatch, …) and the remediation. Note thatTOKEN_EXPIREDis not fixed by re-runningcortexdb init— see the identity note above; that would mint a different brain rather than restore access to yours. - 403s cite the missing capability and the policy tier that denied. If a
recall returns
diagnostics.read denied, pass--diagnostics none— free-tier tokens don't carry thediagnostics.readcapability.
License
Apache-2.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cortexdb_cli-0.5.3.tar.gz.
File metadata
- Download URL: cortexdb_cli-0.5.3.tar.gz
- Upload date:
- Size: 57.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4278683a57afd96c91a1deea68c36c327e36dba1d38a9932f1778cc77d75c970
|
|
| MD5 |
c42fa8a2efb6569b5a0a39c05411fe49
|
|
| BLAKE2b-256 |
78105ebb48cd66a3bb7b837085cc857a23cdcbf7be8c45f8b0800c8a0bb06c65
|
File details
Details for the file cortexdb_cli-0.5.3-py3-none-any.whl.
File metadata
- Download URL: cortexdb_cli-0.5.3-py3-none-any.whl
- Upload date:
- Size: 80.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac9b791332928c373596c6172cdd7a52143161a6827f8e839e4f533c763f4d63
|
|
| MD5 |
147652adffba07283b07c8665487b3e1
|
|
| BLAKE2b-256 |
ff2a23129a8d94a2a34c13aeea8334e021d2ee2d6bcebdc6c56bf0b03fbe1faa
|