Skip to main content
Store useful evidence or constraints, query with that state, and correct the record when the information changes. Use the State gateway when the integration does not need a task-specific Domain contract. This example keeps an operating constraint available across calls. Use the API key from the quickstart.

Record, query, and correct

1

Store a useful constraint

Store evidence
Keep the returned storage_result.memory_id. It identifies the record you can later correct or remove.
2

Query with the retained evidence

Read relevant context
Inspect memory_context, confidence_score, and the optional reasoning. Check that the evidence supports the constraint your application will use.
3

Correct the record and query again

Save this as correction.json, replacing MEMORY_ID_FROM_STORE with the returned ID:
correction.json
Apply the correction
Repeat the query and inspect how the corrected evidence affects the result. Keep both responses when validating the integration.

Choose a read operation

Query, search, and explain default to update_memory_state: true. Set it to false for a read-only comparison. Explain a result describes the response fields and their limits.

Manage the record lifecycle

All operations above use POST. Inspect each batch result before retrying: records stored before a later failure remain stored. The compatibility alias /api/v1/batch_store remains available.
Hosted identity follows the bearer token. The body value session_id: ignored satisfies the compatibility contract; changing it does not select another tenant./memory/state also accepts summary_only: true. When pruning, set max_records, optional max_bytes, and include_unique deliberately. Inspect the dry-run candidates before applying them with dry_run: false.A Domain is useful when events, relations, targets, or action outcomes need a stable task contract. State and Domain histories have different reset boundaries; see Operations and retries.

Explain the result

Inspect evidence, support, and unresolved information.

Create a task-scoped learner

Move from continuing evidence to a Domain with an observable target.