---
title: "Apply one explicit factual-memory evolution operation"
method: POST
path: "/v1/evolve"
tags: ["memory"]
---

# Apply one explicit factual-memory evolution operation

`POST /v1/evolve`

## Request

- Base URL: `https://api.contextdb.ai`
- URL: `https://api.contextdb.ai/v1/evolve`
- Auth: HTTP bearer

Applies ADD, UPDATE, DELETE, or NOOP through the atomic public SDK
state machine. The project key fixes org/project scope and `user_id`
fixes the end-user partition. Service and evaluation keys are denied.

## Headers

- `Idempotency-Key` string, required

## Request body

- EvolveRequest: ADD requires content+source and rejects target_memory_id. UPDATE requires content+source plus target_memory_id or entity+attribute. DELETE accepts no content/write attributes and requires a target or slot. NOOP accepts no content/write attributes and requires a reason.
  - `user_id` string, required: End-user memory partition key. Not an identity assertion.
  - `operation` 'add' | 'update' | 'delete' | 'noop', required
  - `content` string
  - `source` 'user_stated' | 'agent_inferred' | 'third_party': Who vouches for the claim. Required on writes.
  - `confidence` number
  - `action_relevant` boolean
  - `entity` string
  - `attribute` string
  - `target_memory_id` string
  - `metadata` object
  - `noop_reason` string

## Response `200`

Applied operation and resulting consistency floor

- EvolveResponse
  - `requested_operation` 'add' | 'update' | 'delete' | 'noop', required
  - `applied_operation` 'add' | 'update' | 'delete' | 'noop', required
  - `outcome` 'added' | 'updated' | 'deleted' | 'noop' | 'contested', required
  - `memory` Memory, required
    - `id` string, required
    - `content` string, required: Stored content with PII redacted as `[TYPE]` placeholders
    - `user_id` string, nullable, required
    - `epistemic_source` 'user_stated' | 'agent_inferred' | 'third_party', required: Who vouches for the claim. Required on writes.
    - `confidence` number, required
    - `corroboration_count` integer, required
    - `action_relevant` boolean, required
    - `requires_confirmation` boolean, required
    - `confirmed` boolean, required
    - `independent_corroboration` integer, required
    - `injection_suspect` boolean, required
    - `entity_key` string, nullable, required
    - `attribute_key` string, nullable, required
    - `valid_until` string, date-time, nullable, required
    - `superseded_by` string, nullable, required
  - `previous_memory_ids` string[], required
  - `deleted_memory_ids` string[], required
  - `noop_reason` string, nullable, required
  - `memory_version` integer, required: Monotonic consistency version within one organization/project.
  - `primary_wal_lsn` string, nullable, required: Primary PostgreSQL WAL position observed after commit.
  - `request_id` string, required

## Other responses

- `400`: Malformed request or failed validation
- `401`: Missing, malformed, unknown, or revoked API key
- `403`: Authenticated but not allowed (entitlement or billing state)
- `404`: Target not found in the caller's partition (or missing)
- `409`: The key was reused with a different request, an identical request is still running, or a previous process ended with an ambiguous outcome.
- `413`: Body or batch exceeds the configured cap
- `429`: The client IP/project exceeded its request rate, or the project's idempotency retention capacity is full until older keys expire.
- `503`: Memory or metadata store unreachable

---

[API](https://skmtc.dev/contextdb/apis/contextdb-cloud-data-plane-api.md) · [All operations](https://skmtc.dev/contextdb/apis/contextdb-cloud-data-plane-api/llms.txt) · [OpenAPI document](https://skmtc.dev/contextdb/apis/contextdb-cloud-data-plane-api/revisions/9e441d2e21a7?raw)
