AI Memory
Persistent memory entries that the AI uses to maintain context across sessions. Reading requires the ai.memory.read permission; creating requires ai.memory.write, in addition to authentication and any applicable entitlement. A valid token alone does not grant these permissions. A 403 response with auth_insufficient_permissions means the operation was refused before the body was processed; changing its content does not resolve that access failure.
Endpoints
| Method | Path | Description | Auth |
|---|---|---|---|
| GET | /ai/memory | List memories | JWT + Entitlement |
| POST | /ai/memory | Create a memory entry | JWT + Entitlement |
GET /ai/memory
List memory entries, optionally filtered by scope.
Authentication: JWT Bearer token + active AI entitlement required.
Request
| Parameter | Type | Required | Description |
|---|---|---|---|
scope | string | No | Filter by a supported scope listed below |
origin | string | No | Filter by origin: user, inferred, imported, system |
confidence | string | No | Filter by confidence: low, medium, high |
freshness | string | No | Filter by freshness: active, stale, archived |
chainyId | string | No | Filter by Project ID (UUID) |
Response
Response Example
{
"data": [
{
"id": "cm5mem01",
"content": "User prefers morning study sessions between 7-9 AM.",
"scope": "user",
"tags": ["preferences", "learning-style"],
"type": "preference",
"origin": "user",
"confidence": "high",
"freshness": "active",
"chainyId": null,
"importance": 5,
"createdAt": "2026-03-17T10:00:00.000Z"
}
]
}Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Memory ID |
content | string | Memory content |
scope | string | null | Memory scope; see the scope values below |
tags | string[] | Tags |
type | string | null | Memory type; see the supported type values below |
origin | string | null | Memory origin: user, inferred, imported, system |
confidence | string | null | Confidence level: low, medium, high |
freshness | string | Memory freshness: active, stale, archived |
chainyId | string | null | Linked Project ID |
importance | integer | null | Stored importance value |
createdAt | string | ISO 8601 |
Code Examples
curl "https://api.chainabit.com/api/v1/ai/memory?scope=user" \
-H "Authorization: Bearer $TOKEN"POST /ai/memory
Create a new memory entry.
Authentication: JWT Bearer token + active AI entitlement required.
Request
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
content | string | Yes | 20–2,000 characters, plus a 5–500 token content check | Memory content |
scope | string | No | See scope values below | Defaults to account. This label does not expand access permissions. |
tags | string[] | No | — | Tags for categorization |
importance | number | No | — | Importance value; defaults to 5 |
origin | string | No | user, inferred, imported, system | Memory origin. Defaults to user |
confidence | string | No | low, medium, high | Confidence level. Defaults to medium |
evidence | object[] | No | — | Supporting evidence objects |
sourceEntityType | string | No | chainy, chain, bit, session | Type of the source entity |
sourceEntityId | string | No | UUID | ID of the source entity |
chainyId | string | No | UUID | Linked Project ID |
type | string | No | See type values below | Defaults to fact |
Response
Response Example
{
"data": {
"id": "cm5mem01",
"content": "User prefers morning study sessions between 7-9 AM. Learns best with visual mnemonics.",
"scope": "user",
"tags": ["preferences", "learning-style"],
"type": "preference",
"origin": "user",
"confidence": "medium",
"freshness": "active",
"chainyId": null,
"importance": 5,
"createdAt": "2026-03-17T10:00:00.000Z"
}
}Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Memory ID |
content | string | Memory content |
scope | string | null | Memory scope; see the scope values below |
tags | string[] | Tags |
type | string | null | Memory type; see the supported type values below |
origin | string | null | Memory origin: user, inferred, imported, system |
confidence | string | null | Confidence level: low, medium, high |
freshness | string | Memory freshness: active, stale, archived |
chainyId | string | null | Linked Project ID |
importance | integer | null | Stored importance value |
createdAt | string | ISO 8601 |
Code Examples
curl -X POST https://api.chainabit.com/api/v1/ai/memory \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"content": "User prefers morning study sessions between 7-9 AM. Learns best with visual mnemonics.",
"scope": "user",
"type": "preference",
"tags": ["preferences", "learning-style"]
}'Memory Taxonomy
Each memory entry is classified along several dimensions:
Scope
Where the memory applies.
| Value | Description |
|---|---|
account | Default account-context label |
user | User-context label |
session | Session-context label |
conversation | Conversation-context label |
agent | Agent-context label |
global | Global-context label; does not make the record public |
chainy | Project-context label; use chainyId to link the project |
The supported scope values are labels on a memory record. Records remain bound to the caller’s authorized context. This endpoint does not accept a scopeId field, and setting a label does not attach a session, agent, or conversation. Use chainyId for an explicit project association. The wire value chainy is retained for compatibility.
Type
What kind of memory.
| Value | Description |
|---|---|
preference | User preferences (e.g., study times, UI choices) |
context | Situational context (e.g., current project, topic) |
behavioral | Observed patterns (e.g., learning work patterns, usage trends) |
goal | Explicit goals (e.g., targets, milestones) |
fact | Factual context (the default) |
instruction | A reusable instruction |
episodic | Context about an event or experience |
semantic | General knowledge |
procedural | A process or sequence of steps |
summary | Condensed context |
Origin
How the memory was created.
| Value | Description |
|---|---|
user | Explicitly created by the user |
inferred | AI-derived from interactions |
imported | Imported from an external source |
system | Platform-generated by the system |
Freshness Lifecycle
Memories progress through freshness states over time:
active → stale → archived
| Value | Description |
|---|---|
active | Current and relevant |
stale | Not recently accessed or updated — may need review |
archived | No longer active — retained for history |
Confidence
How reliable the memory is considered to be.
| Value | Description |
|---|---|
low | Uncertain — may need verification |
medium | Reasonable confidence (default for new memories) |
high | Well-established and verified |
Content Validation
INFO
Memory content is validated before storage. Requests that fail validation return a 400 Bad Request response.
- Content length: 20–2,000 characters, with a separate 5–500 token check
- Null bytes: Content containing null bytes (
\0) is rejected - Empty content: The
contentfield must be non-empty - Duplicates: An identical active memory in the same authorized context is rejected
- Context limit: At most 10 active memories per project context, or per account/user context when no project is linked