Skip to main content

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 to state.json.replaced first.

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:

  1. CLI flags — --api-key, --endpoint, --actor, --scope, --profile
  2. Environment — CORTEXDB_API_KEY, CORTEXDB_URL, CORTEXDB_ACTOR, CORTEXDB_SCOPE
  3. Persisted state:
    • ~/.cortexdb/config.toml — endpoint, profile names (human-editable)
    • ~/.cortexdb/state.json — token, actor, scope, expiry (managed by init, 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> and X-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 that TOKEN_EXPIRED is not fixed by re-running cortexdb 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 the diagnostics.read capability.

License

Apache-2.0

Metadata

Release files for cortexdb-cli 0.5.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cortexdb-cli 0.5.4
File Size Uploaded Provenance Actions
cortexdb_cli-0.5.4.tar.gz 63.5 kB Without provenance Details for cortexdb_cli-0.5.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cortexdb-cli 0.5.4
File Interpreter ABI Platform Actions
cortexdb_cli-0.5.4-py3-none-any.whl Python 3 none any Details for cortexdb_cli-0.5.4-py3-none-any.whl

Total release size: 149.5 kB

Release files / cortexdb_cli-0.5.4.tar.gz

Download URL cortexdb_cli-0.5.4.tar.gz
Size 63.5 kB
Tags Source
SHA-256 checksum
How to use checksums
29d27feb784a133caee918bff4e6037ca653f55213e426eae2e7652d0fa5ad64
BLAKE2b-256 checksum
How to use checksums
ca59aa1254430c5c1a767c77ef91146893c9c6ddf72f04f49affb363b2b359a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / cortexdb_cli-0.5.4-py3-none-any.whl

Download URL cortexdb_cli-0.5.4-py3-none-any.whl
Size 86.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ecf766e4e5a356db1cf0605bd67b6624bd4e681d3d944def805544b4de035964
BLAKE2b-256 checksum
How to use checksums
62916b45eb01dac3d1a46c849a1fc50091598204dd35bf3961efa67eb1180ab9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Security for cortexdb-cli 0.5.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page