Overview
Memory items are the structured knowledge units extracted by the enrichment pipeline. Each item represents a discrete piece of project knowledge -- an architectural decision, a coding convention, a bug fix, an implementation detail, and so on.
List items
Retrieves memory items for a project.
GET /api/v2/items
Query parameters
| Parameter | Type | Description |
|---|---|---|
projectId | string | Filter by project ID |
type | string | Filter by item type (e.g., "architecture", "convention", "implementation", "decision", "bug", "todo") |
schemaKey | string | Filter by schema key |
status | string | Filter by status ("approved", "draft", "deprecated") |
Response
json
[
{
"id": "item_abc123",
"title": "JWT Authentication Pattern",
"content": "Using JWT with refresh tokens for API auth...",
"type": "architecture",
"schemaKey": "root/architecture/auth",
"status": "approved",
"confidence": 0.95,
"sourceRef": "sess_xyz789",
"files": ["src/middleware/auth.ts", "src/lib/jwt.ts"],
"createdAt": "2025-01-20T12:00:00Z",
"updatedAt": "2025-01-20T12:00:00Z"
}
]
Item fields
| Field | Type | Description |
|---|---|---|
id | string | Unique item identifier |
title | string | Short descriptive title |
content | string | Detailed content in markdown |
type | string | Category of knowledge |
schemaKey | string | Hierarchical schema key |
status | string | Approval status |
confidence | number | AI confidence score (0-1) |
sourceRef | string | Reference to the originating session |
files | array | Related file paths |
Get item
Retrieves a single memory item by ID.
GET /api/v2/items/[id]
Response
Returns the full item object including content and metadata.
Update item
Updates a memory item's properties.
PATCH /api/v2/items/[id]
Request body
| Field | Type | Required | Description |
|---|---|---|---|
title | string | No | Updated title |
content | string | No | Updated content |
type | string | No | Updated type category |
status | string | No | "approved", "draft", or "deprecated" |
schemaKey | string | No | Updated schema key |
Example
bash
curl -X PATCH https://contox.dev/api/v2/items/item_abc123 \
-H "Authorization: Bearer contox_sk_yourkey" \
-H "Content-Type: application/json" \
-d '{"status": "deprecated"}'
Delete item
Permanently deletes a memory item.
DELETE /api/v2/items/[id]
Returns 204 No Content on success.
Item types
| Type | Description |
|---|---|
architecture | Tech stack, patterns, project structure |
convention | Coding conventions, style rules, team agreements |
implementation | Features built, components created, APIs implemented |
decision | Key decisions with rationale and trade-offs |
bug | Bugs found, fixes applied, workarounds |
todo | Pending tasks, known issues, planned improvements |
Confidence scores
Each item has a confidence score between 0 and 1, assigned during enrichment:
| Range | Meaning |
|---|---|
| 0.9 - 1.0 | High confidence, directly verified against code |
| 0.7 - 0.89 | Moderate confidence, supported by evidence |
| 0.5 - 0.69 | Lower confidence, may need review |
| Below 0.5 | Low confidence, flagged for verification |
Items with low confidence scores should be reviewed manually in the dashboard.
Next steps
- V2 Hygiene -- Automated cleanup and maintenance
- Memory Dashboard -- View and manage items in the UI
- Enrichment Guide -- How items are extracted