CortexDB · docs

CortexDB 0.15.0 — governed memory formation: you decide what memory learns

0.15.0 is 0.14.2 plus governed memory formation: control over what CortexDB's background enrichment learns from your events, recorded decisions you can read back, and corrections that stay corrected. Customer logic enters as data, never as code inside CortexDB:

This is a breaking release: its first start upgrades the data directory one way. Like 0.14.0, 0.15.0 arms the data directory at its first start, now for format 11: no 0.14.x binary opens the directory afterwards, and the way back is the backup taken before the upgrade. Read "Upgrade (one-way)" before you upgrade.

Without a policy, nothing you read changes. A deployment that stages no derivation policy, writes no subject settings and makes no correction gets the same recall packs, answers and default reads as 0.14.2, but for what "Breaking changes" lists (chiefly the directives.extract fixes and the warnings on directives nothing reads). New provenance is stored on every derived fact and served only when a read asks for it (include=derivation). We compared the two releases on the same data with no policy: every recall pack, answer context, compose result, write acknowledgement and default read of facts, beliefs, episodes, events, claims and conflicts was 0.14.2's, byte for byte apart from request ids and times, with the data directory held at format 10 and armed for 11.

Getting 0.15.0. It is released on the customer channel only. Customers download it from the customer portal, https://customer.cortexdb.ai (Releases), with their company's license: the Linux amd64 and arm64 binaries, a docker load image file per platform, and the image in the private registry the portal names. Release builds enforce the license, and the install commands on the portal carry yours. There is no public download: no Docker Hub image, no latest tag and no public GitHub release. Every new capability is experimental in 0.15.0: its responses carry X-Cortex-Stability: experimental.

The routes are in docs/API_REFERENCE_V1.md (§8.7.22 to §8.7.28, §8.22.7 and §8.32; §16 lists every error code) and docs/schemas/openapi.json. This page is the summary an operator needs.

Breaking changes

What a 0.14.x deployment that sets none of the new variables sees change at the upgrade.

Upgrade (one-way)

A single node first; "On a cluster" and "With the one-click updater" follow.

Before you start

  1. Decide whether to arm now. Arming is what turns the new features on. To upgrade the binary and arm later, set CORTEX_FORMAT_CEILING=10 in the server's environment before its first start of 0.15.0 (below, "Holding the ceiling at 10").

  2. Take a cold backup with the 0.14.x binary, and keep it with that binary or image. With the server stopped (docker stop -t 120 cortexdb, or systemctl stop with TimeoutStopSec=120):

    python scripts/cold_backup.py backup DATA_DIR ARCHIVE.tar.gz
    python scripts/cold_backup.py verify ARCHIVE.tar.gz
    

    (or the 0.14.x binary's own cortexdb backup DATA_DIR ARCHIVE and cortexdb backup-verify ARCHIVE). The first start of 0.15.0 arms the directory one way; this archive is the only way back.

  3. Rehearse on a restored copy (recommended), never on the live directory:

    python scripts/upgrade_rehearsal.py --old-binary ./cortexdb-0.14.2 --new-binary ./cortexdb \
        --data-dir /backups/a-copy --env-file /etc/cortexdb/cortexdb.env
    

    It boots both binaries on a restored copy with your environment and lists what the new one loses or answers differently: every scope record, event, fact, belief, erasure receipt and token you name, and from 0.15.0 each scope's derivation policy hash, its corrections, its open review items, its declared episodes and the re-derivation jobs you name with --job-id ID=SCOPE. A rehearsal that reads nothing on the old binary stops with exit 2 instead of passing.

  4. Check your clients against "Breaking changes": directives.extract lists, change-set writers of attrs:unit that clear enrich by omission, importers that relied on duplicates, and anything that reads acks' warnings.

  5. If CORTEX_LLM_MODEL is unpriced, declare its rate in CORTEX_MODEL_PRICES.

Steps

  1. Download 0.15.0 from the customer portal, https://customer.cortexdb.ai (Releases): the binary, the docker load image file or the image in the private registry the portal names, as its install commands say. Those commands carry your company's license, which release builds enforce. Docker Hub has no 0.15.0: do not docker pull cortexdb/cortexdb.
  2. Pin the deployment to 0.14.x so nothing restarts it on 0.15.0 while you work, and stop it with its full grace.
  3. Back up and verify (above).
  4. Start 0.15.0 on the same directory with the same environment and license. Before it serves, it arms the directory and logs a warning, "shard armed for apply format 11: this is one-way, and this data directory no longer opens on an older binary…", with code SHARD_ARMED_ONE_WAY and format 11; every later start logs SHARD_ARMED_ONE_WAY at INFO. If the log says instead that the ceiling allows arming but the shard is held below it, with reason=reserved_path_in_use, a registry record sits at a reserved path (paths names them) and the node serves unarmed, as 0.14.0 described. GET /v1/admin/ready answers 200 once it serves.
  5. Verify:
    • GET /v1/admin/version: crate_version 0.15.0 and the new capabilities ("New capabilities").
    • DATA_DIR/format_armed.json holds {"format": 11}.
    • GET /v1/admin/metrics shard_format reads {"binary": 11, "ceiling": 11, "armed": 11, "pending": null}.
    • GET /v1/derivation/policy?scope=<a scope> answers "policy_hash": "dp1:none" and "format_armed": 11: no policy yet, so derivation runs as before.
    • A memory you know is found by GET /v1/events/{id} and by /v1/recall, and a retry of a recent write with its idempotency key replays it.

Holding the ceiling at 10

With CORTEX_FORMAT_CEILING=10 set before the first start, 0.15.0 serves at format 10: everything 0.14.2 served, plus the parts of this release that need no new stored state (the directives.extract fixes, include=derivation, GET /v1/derivation/decisions, the status's extraction block, the policy read, the templates and the taxonomy, the policy test, the change feed without consumer marks, derived_by, GET /v1/memory/about without corrections or held candidates, and the importers). Derive records in change sets, subject settings, policy texts, corrections and their undo, conflict resolution as corrections, review, declared episodes and feed consumer marks answer 503 FORMAT_UPGRADE_PENDING with details.reason: "arming_disabled", which is not retriable.

To arm later on a single node: remove the setting (or raise it to 11) and restart, or use the console's Settings page, which shows the shard format (binary, ceiling, armed, and why it is pending) and lists the ceiling as a one-way setting, shard_format. Its save arms nothing until you type the data directory's path and confirm you have a cold backup (else 422 ONE_WAY_CONFIRMATION_REQUIRED); the next restart arms. A ceiling below the format the directory is already armed for holds nothing back and is refused (409 FORMAT_ARMED_ONE_WAY). Holding at 10 is not a way back to 0.14.x either: the backup is.

On a cluster

Upgrade every node. Until every member of a shard runs 0.15.0 the shard stays at format 10, and the routes that need 11 answer 503 FORMAT_UPGRADE_PENDING with details.reason: "members_behind" (retriable, with Retry-After: 30) naming the member. An ingress lists each new capability only once every Active data node reports it. Once the last member runs 0.15.0, the shard's leader arms it. To hold a cluster at 10, set format_ceiling = 10 in every member's [engine] table before the rolling upgrade, and raise it later with a rolling restart; a data node reads no override file, so the console cannot set it there. After arming, a member restarted on 0.14.x refuses to start, and a new member must run 0.15.0. A data node takes the new settings below in its [engine] table too.

With the one-click updater

The sidecar pulls 0.15.0 from the repository your CortexDB container runs, without registry credentials. Docker Hub has no 0.15.0 image and the customer portal's registry needs credentials, so a server installed from the customer portal is upgraded by hand, as above: load the 0.15.0 image file, then start it on the same volume. What follows applies to a server that runs its image from a registry of your own that the sidecar can pull from.

An update from 0.14.x to 0.15.0 crosses the image's one-way label, so the sidecar fails the first attempt with ONE_WAY_CONSENT_REQUIRED before CortexDB stops; the Updates page then asks for a separate confirmation that names the one-way migration, the backup and these notes, and sends accept_one_way: true. The backup is required (BACKUP_REQUIRED with CORTEX_UPDATER_BACKUP=off). Once 0.15.0 has started, the sidecar never starts the old container on the data again: a failure leaves it stopped and names the backup. Run the sidecar from 0.15.0: it knows the 0.15.0 boundary itself and refuses a downgrade below 0.15.0 onto a directory armed for format 11 (ARMED_DATA_DIRECTORY); an older sidecar sees the boundary only in the image's label (docs/PRODUCTION_DEPLOYMENT.md, "One-way upgrades").

The way back

Only from the backup. Stop 0.15.0 and keep its directory aside. Restore the archive into a new, empty directory with the 0.14.x tools (python scripts/cold_backup.py restore ARCHIVE NEW_DIR --cortexdb ./cortexdb-0.14.2, or the 0.14.x binary's cortexdb restore ARCHIVE NEW_DIR) and start 0.14.x on it. Every write made after the upgrade is lost. Never start 0.14.x on the upgraded directory: it refuses it.

What's new

Derivation policies (derivation_policy_v1)

What the policy decides, and how you see it

Corrections (corrections_v1)

Review before commit (derivation_review_v1)

Re-derivation (derivation_rederive_v1)

A policy applies to what is learned from then on. When it changes, the rows made under the old one read as unsynced (the status's governance block counts them), and POST /v1/derivation/rederive brings them in line, a dry run first:

A job is a replicated record: a new leader adopts it after a failover, one job runs on a root at a time, a scope move waits for it (MOVE_DERIVATION_JOB_ACTIVE), and GET /v1/derivation/rederive/{job_id} and .../cancel read and stop it; forgets and erasures are never held. CORTEX_DERIVATION_REEXTRACT decides who may run a reextract (an Owner, the operator only, or nobody); a regate needs only an Owner. GET /v1/derivation/report is what was derived over a period, counts and ids only, as JSON or CSV, for a regulator or a risk assessment. An undo of a rejection re-extracts the events whose candidates the gate dropped under it, under the daily budget. A change set's preview names the rows it leaves unsynced (unsynced_impact). POST /v1/admin/derived/rederive stays the trusted operator's repair (docs/DERIVED_REDERIVE_RUNBOOK.md); it now waits for an event a spent budget deferred.

Outside workers

The read-time use rule (derivation_use_rules_v1)

A policy's use rule withholds earlier-session memory from recall, answers and compositions for a user not age-assured as an adult, as New York's General Business Law Article 48 asks of the apps it covers. The minor@1 template carries the rule ny_unassured_window (twelve hours, and other sessions); no other template does. Reads take a new session field; an event is withheld when it was captured before the window or in another session, and so is everything derived only from such events, and the read says use_rule_withheld: <n> events from earlier sessions in its warnings. The application asserts age_assured_adult in the subject's settings; CortexDB verifies no age and stores no age-assurance evidence. The subject's own access reads (/v1/events, /v1/facts, /v1/memory/about, the export) are never filtered.

Send session only to a server that lists derivation_use_rules_v1. A server before 0.15.0 (checked against 0.14.0 to 0.14.2) does not know the field: /v1/recall and /v1/recall/stream refuse it with 422 INVALID_BODY (they take no unknown field), while /v1/answer and /v1/compose ignore it and the /mcp recall tool drops it, so nothing is withheld there. The SDKs document the same.

The console

Erasure and audit

New capabilities

GET /v1/admin/version lists nine more names than 0.14.2. Each is experimental; on a cluster an ingress lists one only once every Active data node reports it. A name says what the binary builds, not what the data directory is armed for: below format 11 the routes that need it answer 503 FORMAT_UPGRADE_PENDING.

New settings

On a cluster data node, set them in the node config's [engine] table.

VariableDefaultMeaning
CORTEX_DERIVATION_MODELSunset: only the model the process's enrichment runs (none without one)the models (or provider-fleet names) a policy's model and entity_model may name, comma-separated; another is refused at staging (422 DERIVATION_MODEL_NOT_ALLOWED), and a policy that names none runs on the process's own models. The start logs a name it cannot route (DERIVATION_MODEL_UNROUTABLE), and the configuration lint one the price book cannot price (DERIVATION_MODEL_UNPRICED)
CORTEX_DERIVATION_BUDGET_USD5US dollars a tenant's policy tests and reextract dry runs may spend a UTC day
CORTEX_DERIVATION_BUDGET_MAX_USD500the most a reextract job's approval may cap its spend at
CORTEX_DERIVATION_REEXTRACTtenantwho may run a reextract: tenant (an Owner, within the cap), operator (the trusted operator only) or off (nobody; a regate is never refused by it). Another value refuses the start (exit 78 DERIVATION_REEXTRACT_CONFIG)
CORTEX_FORMAT_CEILINGthe newest format, 11as in 0.14.0; 10 holds the directory at format 10. On a single node the console's Settings page also sets it, as a one-way setting (shard_format)

A budget value that is not 0 to 1,000,000 refuses the start (exit 78 DERIVATION_BUDGET_CONFIG).

New error codes

docs/API_REFERENCE_V1.md §16 has each in full. None is retriable.

HTTPCodeWhere
409CORRECTION_CONFLICTan open correction of the same claim and action, or a pin and a reject of one claim
409REVIEW_ITEM_DECIDEDa decision's result: the held candidate was decided before
409WRITER_NOT_ALLOWEDa declared write a policy's writer rule refuses (a typed triple, a bulk item, an import row, a declared belief, a replacement)
409FORMAT_ARMED_ONE_WAYthe console's shard_format: a ceiling below the armed format
422CORRECTION_TARGET_UNKNOWNno live fact states the claim
422DERIVATION_POLICY_INVALID, DERIVATION_POLICY_WIDENS, DERIVATION_MODEL_NOT_ALLOWED, DERIVATION_TEXT_INVALIDa derive record in a change set, subject settings, a policy test's draft
422POLICY_TEST_TOO_LARGEa policy test past its events, its cap or the tenant's day
422DERIVED_BY_INVALIDa derived_by stamp out of its grammar, or on anything but a typed triple
422FEED_CURSOR_INVALIDa feed cursor the feed did not issue, or another root's or consumer's
422ONE_WAY_CONFIRMATION_REQUIREDthe console's shard_format: a ceiling that arms, without the data directory's path and the backup confirmation

Re-derivation's: 409 REDERIVE_ESTIMATE_REQUIRED (an apply with no live estimate of the same selection), REDERIVE_ESTIMATE_STALE (the selection moved since the dry run), REDERIVE_BUDGET_EXHAUSTED (a cap below the first page, an unpriced model, or the day's budget of dry runs spent) and DERIVATION_JOB_ACTIVE (another job holds the root); 403 REEXTRACT_NOT_ALLOWED. cortexdb admin scope move refuses MOVE_DERIVATION_JOB_ACTIVE while a job holds the root, naming it (details.job_id), and the mover reports the same code for a job opened after the move began: run the move again once the job closes. Existing codes with new uses: FORMAT_UPGRADE_PENDING (every route that needs format 11), IDEMPOTENCY_CONFLICT (a correction's or a declared episode's key, an import row changed under its id), PROVENANCE_ERASED and PROVENANCE_UNKNOWN (declared episodes, review), EVENT_LIST_UNAVAILABLE (a feed page an erasure overtook, retriable) and COHORT_WARMING (a cohort read under a use rule while it warms).

Fixes

Known limitations

Clients

Four clients are released with 0.15.0, on PyPI and npm, as 0.14.0's and 0.14.1's were; the connectors are unchanged. Upgrade a client with the server: against a server before 0.15.0 every new route answers 404, which reads like "not found", so a client checks the capability first (each SDK's README says so beside its new calls).

PackageRegistryBeforeWith 0.15.0What it adds
cortexdbai (Python SDK)PyPI0.13.10.14.0every new route on Cortex and AsyncCortex: policies, settings, texts, templates, taxonomy, the policy test, derive records (derive_record), corrections (correct(..., bind=, value=, valid=, reason=, subject_principal=, idempotency_key=) and its shorthands), memory_about (corrections and held items by default), review, declared episodes, the feed (derivation_feed, feed_iter) and its consumers (feed_consumers), re-derivation (rederive(scope, mode, event_ids=...), the unsynced rows without event_ids; rederive_job, rederive_cancel, rederive_wait) and the report (derivation_report(scope, since=, until=, csv=)), derived_by, include=derivation, decisions; cortexdb.workers.DerivationWorker; cortexdb.memory_tool.CortexMemoryTool
cortexdbai (TypeScript SDK)npm0.11.10.12.0the same calls in camelCase, but deriveRecord is a module export and resolveConflict takes no loser; memoryAbout with the same default; two more, derivationReportCsv and feedConsumersPages; the worker's port (DerivationWorker) and CortexMemoryTool, a handler for the Anthropic SDK's betaMemoryTool
cortexdb-cliPyPI0.7.10.8.0cortexdb derivation (policy, stage, test, settings, texts, templates, taxonomy, status, decisions, feed, consumers, and the jobs: rederive, a dry run unless --apply, of the unsynced rows unless --events; job, cancel and report), cortexdb corrections, cortexdb review, cortexdb episodes declare and delete, cortexdb memory about (--corrections); --derived-by on experience write, beliefs create and episodes declare
cortexdb-mcpPyPI0.9.00.10.0the read tools memory_why, derivation_policy, memory_about and review_list; memory_correct, review_decide and correction_undo, each in the write profile only and marked destructive. Every new tool takes scope, but memory_why takes tenant_id
cortexdb-connectorsPyPI0.3.00.3.0no change

The server's own MCP endpoint (/mcp, CORTEX_MCP=on) gains memory_why and memory_about in its read profile and correct in its write profile.

Performance against 0.14.2

On a single node with no derivation policy, 0.15.0 is as fast as 0.14.2. Both release builds ran interleaved, round by round, on one quiet 48-vCPU machine (five rounds, medians; jemalloc with the image's MALLOC_CONF, mock embeddings and the stub answer renderer), 0.15.0's final server code against v0.14.2:

Part of the bulk-write gain is a change outside governed memory: the vector quantizer's rotation now flips signs without a branch, with bit-identical results. With no policy set, governed memory formation adds no measurable work to the write path.

Compatibility