AI Twins
Your AI Twin is a personalised view of how Chainabit understands you. The system maintains it automatically — you observe it via these endpoints, tune the limited behavioural preferences, and forget or flag items you don't want.
Identity is system-managed. There is no endpoint to author a twin's profile or memories by hand.
Endpoints
| Method | Path | Description | Auth |
|---|---|---|---|
GET | /agents/twins/export | Export the signed-in person's Twin data | JWT |
PATCH | /agents/twins/me/preferences | Update the signed-in person's Twin preferences | JWT |
GET | /workspaces/{workspaceId}/ai/twins | List twins in a workspace | JWT |
GET | /workspaces/{workspaceId}/ai/twins/skill-coverage | Skill coverage summary | JWT |
GET | /workspaces/{workspaceId}/ai/twins/behavioral-baseline | Behavioral baseline summary | JWT |
GET | /workspaces/{workspaceId}/ai/twins/{twinId}/brain | Read the latest twin profile | JWT |
GET | /workspaces/{workspaceId}/ai/twins/{twinId}/confidence | Per-field confidence values | JWT |
GET | /workspaces/{workspaceId}/ai/twins/{twinId}/evidence | Provenance for the twin's claims | JWT |
GET | /workspaces/{workspaceId}/ai/twins/{twinId}/timeline | History of twin profile versions | JWT |
PATCH | /workspaces/{workspaceId}/ai/twins/{twinId}/preferences | Update behavioural preferences | JWT |
POST | /workspaces/{workspaceId}/ai/twins/{twinId}/test | Run a sample prompt against the twin | JWT |
DELETE | /workspaces/{workspaceId}/ai/twins/{entityTwinId}/contributions/{userId} | Admin: revoke a member's contributions to an entity twin | JWT, admin role |
POST | /workspaces/{workspaceId}/ai/twins/{entityTwinId}/contributions/{userId}/regrant | Admin: make a member eligible to contribute again | JWT, admin role |
GET | /agents/twins/me/beliefs | What your Twin currently believes about how you decide, with its basis | JWT |
POST | /agents/twins/me/beliefs/rulings | Confirm or reject one belief | JWT |
DELETE | /agents/twins/me/beliefs | Erase every belief your Twin holds about you | JWT |
GET | /agents/twins/{twinId}/memories | List memories | JWT |
POST | /agents/twins/{twinId}/memories/{id}/deletions/preview | Review a memory before forgetting it | JWT |
POST | /agents/twins/{twinId}/memories/{id}/deletions/cancel | Cancel a pending memory deletion | JWT |
DELETE | /agents/twins/{twinId}/memories/{id} | Forget a memory | JWT |
POST | /agents/twins/{twinId}/memories/{id}/flag | Flag a memory as wrong | JWT |
GET /agents/twins/export
Returns the signed-in person's Twin record and its memories, behavioral evidence, and workspace policies in a JSON response. The response has a data object with twin, memories, evidence, and policies fields. Returns 404 if that person has no Twin to export. Access requires a JWT and the applicable Twin entitlement and policy checks.
GET /workspaces/{workspaceId}/ai/twins/{twinId}/brain
Description
Returns the current profile of the twin: its personality dimensions and the most-supported claims it has formed about you. If the twin is still gathering its first signals, the response indicates status: "seeded".
Request
- Headers:
Authorization: Bearer <token> - Path params:
workspaceIdtwinId
Response
200 OKjson{ "data": { "version": 12, "personality": { "threatSensitivity": 0.2, "rewardSensitivity": 0.6, "impulseControl": 0.7, "socialTrust": 0.5, "uncertaintyTolerance": 0.4, "emotionalRegulation": 0.65, "goalPersistence": 0.8 }, "topClaims": [ { "fieldPath": "preference.terse_replies", "claim": "terse_replies", "confidence": 0.82, "evidenceCount": 14 } ] } }
Code Example
curl -H "Authorization: Bearer $TOKEN" \
https://api.chainabit.com/api/v1/workspaces/$WORKSPACE/ai/twins/$TWIN/brainGET /workspaces/{workspaceId}/ai/twins/{twinId}/confidence
Description
Returns a flat map of fieldPath → confidence (0..1) for every claim the twin currently holds. Use it to decide which claims to display prominently and which to surface as tentative.
Request
- Path params:
workspaceId,twinId
Response
200 OKjson{ "data": { "preference.terse_replies": 0.82, "style.code_oriented": 0.61 } }
Code Example
curl -H "Authorization: Bearer $TOKEN" \
https://api.chainabit.com/api/v1/workspaces/$WORKSPACE/ai/twins/$TWIN/confidenceGET /workspaces/{workspaceId}/ai/twins/{twinId}/evidence
Description
Returns the recent provenance rows that back the twin's claims. Optionally filter by fieldPath (e.g. preference.terse_replies) to see what supports a specific claim.
Request
- Path params:
workspaceId,twinId - Query:
fieldPath(optional),limit(optional, default 50)
Response
200 OK— array of evidence entries withclaim,polarity,confidence,extractor,channel,createdAt.
Code Example
curl -H "Authorization: Bearer $TOKEN" \
"https://api.chainabit.com/api/v1/workspaces/$WORKSPACE/ai/twins/$TWIN/evidence?fieldPath=preference.terse_replies"GET /workspaces/{workspaceId}/ai/twins/{twinId}/timeline
Description
Returns the recent versions of the twin profile, newest first. Use it to see how the twin has evolved over time.
Request
- Path params:
workspaceId,twinId - Query:
limit(optional, default 20)
Response
200 OK— array of profile snapshots ordered byversiondesc.
Code Example
curl -H "Authorization: Bearer $TOKEN" \
"https://api.chainabit.com/api/v1/workspaces/$WORKSPACE/ai/twins/$TWIN/timeline?limit=20"PATCH /workspaces/{workspaceId}/ai/twins/{twinId}/preferences
Description
Update the twin's behavioural preferences. This is the only writable surface on a twin's identity. Identity itself is system-managed.
Allowed fields:
| Field | Type | Notes |
|---|---|---|
paused | boolean | Pause background twin updates. |
observationEnabled | boolean | Allow the system to observe signals for this twin. |
aggregationCron | string | Cron expression (subject to policy bounds). |
memoryRetentionDays | integer (1–3650) | How long memories are retained. |
sensitivityLevel | "low" | "med" | "high" | Privacy / sharing sensitivity. |
publicBrainShowcase | boolean | Opt-in to the public brain showcase on your profile. Off by default. |
Workspace and enterprise admin policies may override or restrict these fields.
Request
- Headers:
Authorization: Bearer <token>,Content-Type: application/json - Body:json
{ "paused": false, "memoryRetentionDays": 180, "sensitivityLevel": "med" }
Response
200 OK—{ "data": { "preferences": { ... } } }400 Bad Request— invalid field values403 Forbidden— caller not in twin's scope
Code Example
curl -X PATCH \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "paused": false, "memoryRetentionDays": 180, "sensitivityLevel": "med" }' \
https://api.chainabit.com/api/v1/workspaces/$WORKSPACE/ai/twins/$TWIN/preferencesDELETE /workspaces/{workspaceId}/ai/twins/{entityTwinId}/contributions/
Description
Admin-only. Revokes a single member's contributions to a team / workspace / enterprise twin. The member's own user twin is unaffected.
Use ?cascade=teams on an enterprise twin to also revoke from every team within the enterprise.
Request
- Path params:
workspaceId,entityTwinId,userId - Query:
cascade=teams(optional)
Response
200 OK—{ "data": { "evidenceRowsDeleted": 42, "teamsCascaded": 3 } }403 Forbidden— caller is not an admin in scope.
Code Example
curl -X DELETE \
-H "Authorization: Bearer $TOKEN" \
"https://api.chainabit.com/api/v1/workspaces/$WORKSPACE/ai/twins/$ENTITY_TWIN/contributions/$USER_ID?cascade=teams"POST /workspaces/{workspaceId}/ai/twins/{entityTwinId}/contributions/{userId}/regrant
Account admins can remove a prior contribution exclusion for an active member. This does not change the member's observation consent; it only makes the member eligible to contribute again if consent and policy allow it.
The 201 Created response reports participation: "eligible_if_consented", whether the exclusion changed, and confirms that observation consent was not changed.
Beliefs
Beyond individual memories, your Twin keeps a small set of evidence-backed beliefs about how you tend to decide and communicate — for example that you prefer fixes that address root causes, in engineering work. A belief is only ever one choice from a fixed list of dimensions and stances, scoped to a context, so it never contains free text.
A belief earns its standing from repeated evidence on different days. A single inferred observation does not guide personalization; a preference you explicitly state or confirm can qualify sooner. Beliefs can guide Agents that use your Twin, rather than being included automatically in every conversation. Your current request always takes priority. Observation requires your consent and stops while paused; beliefs remain personal to you.
GET /agents/twins/me/beliefs
Returns the beliefs your Twin holds in the data array. Each item includes a readable statement and eligibleForPersonalization, a boolean indicating whether current consent and evidence allow it to guide personalization. Eligibility does not mean the belief is included in every conversation.
Items also have dimension, stance, context (general, engineering, business, personal, learning or creative), status (hypothesis, emerging, established, contested or stale), basis (observed, stated or mixed), confidence (tentative, moderate or high), supportDays, firstObservedAt and lastSupportedAt. Dimensions: detail_level, answer_format, solution_scope, solution_origin, delivery_style, risk_attitude, speed_quality, cost_attitude, delegation, evidence_standard, privacy_stance, learning_style.
POST /agents/twins/me/beliefs/rulings
Rule on one belief. Body: { "dimension": "solution_scope", "context": "engineering", "stance": "systemic", "ruling": "confirmed" }. ruling is confirmed or rejected. A confirmation can establish a valid preference even if it has not previously been observed. A rejection retires existing support for that stance; only later evidence can rebuild it. Rejection is a correction, not physical deletion of individual evidence. Allowed even after you withdraw consent. Responds 201 Created with { "data": { "ruled": true } }, or 422 for an unsupported dimension, context or stance combination.
DELETE /agents/twins/me/beliefs
Erases every belief and its evidence. Responds 200 OK with { "data": { "erased": 12 } }; erased counts removed pieces of supporting evidence. Saved memories and individual Agents' experience are separate and are not erased by this operation.
DELETE /agents/twins/{twinId}/memories/
Description
Review the exact memory first. Delete only after the user explicitly confirms the returned semantic fact. The confirmation expires after ten minutes and is bound to the requesting user, workspace, Twin, memory and revision. A changed memory requires a new preview. A direct DELETE without a confirmation receipt is rejected.
Request
- Path parameters:
twinId,idfrom the memory list. - JSON body:
{ "previewToken": "<receipt returned by preview>" }. - Use the same workspace context for preview, cancellation and confirmation.
- To cancel, POST the same body to
/agents/twins/{twinId}/memories/{id}/deletions/cancel; the memory remains unchanged.
Response
- Preview:
data.success,data.previewToken,data.expiresAt,data.totalFound, anddata.willForget(semanticcontentandtype). A missing or inaccessible memory produces no confirmation receipt. - Confirmed deletion:
200 OKwith{ "data": { "success": true, "preview": false, "deletedCount": 1 } }. Repeating the confirmed operation returns the same count withreplayed: true. - Missing, expired, cancelled, changed or incorrectly scoped confirmation:
400 Bad Request. The service does not disclose another user’s memory.
Code example
# Read-only preview; show willForget to the user.
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "X-Workspace-Id: $WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{}' \
https://api.chainabit.com/api/v1/agents/twins/$TWIN/memories/$MEMORY_ID/deletions/preview
# Run only after explicit user confirmation. PREVIEW_TOKEN comes from the preview.
curl -X DELETE \
-H "Authorization: Bearer $TOKEN" \
-H "X-Workspace-Id: $WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d "{\"previewToken\":\"$PREVIEW_TOKEN\"}" \
https://api.chainabit.com/api/v1/agents/twins/$TWIN/memories/$MEMORY_IDPOST /agents/twins/{twinId}/memories/{id}/flag
Description
Flag a memory as wrong. The system demotes the memory's influence going forward and may tombstone it if it accumulates further flags within a short window.
Request
- Path params:
twinId,id(the memory ID, from List memories'sGET /agents/twins/{twinId}/memoriesresponse)
Response
200 OK—{ "data": { "flaggedCount": 1 } }
Code Example
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
https://api.chainabit.com/api/v1/agents/twins/$TWIN/memories/$MEMORY_ID/flagPOST /workspaces/{workspaceId}/ai/twins/{twinId}/test
Description
Run a sample prompt against the twin and return what the twin would have produced. Useful for QA and product-tuning. Does not affect the twin's stored state.
Request
- Headers:
Authorization: Bearer <token>,Content-Type: application/json - Body:
{ "prompt": "string", "context": { ... } }
Response
200 OK— the sample response and any tool calls the twin would have made.
Code Example
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "prompt": "How would you phrase a reminder for this user?" }' \
https://api.chainabit.com/api/v1/workspaces/$WORKSPACE/ai/twins/$TWIN/testNotes
- Rate limits and pagination apply per the standard platform headers.
- Auth is JWT with workspace-scoped entitlements; admin endpoints additionally require an admin role in the enterprise.
- For agent execution records (run history, approvals, automation rules), see the agent actions reference.
- For the Brain Simulator (brain graph, memory graph, live activity, narration), see Twin Brain.