Skip to content

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

ParameterTypeDescription
projectIdstringFilter by project ID
typestringFilter by item type (e.g., "architecture", "convention", "implementation", "decision", "bug", "todo")
schemaKeystringFilter by schema key
statusstringFilter 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

FieldTypeDescription
idstringUnique item identifier
titlestringShort descriptive title
contentstringDetailed content in markdown
typestringCategory of knowledge
schemaKeystringHierarchical schema key
statusstringApproval status
confidencenumberAI confidence score (0-1)
sourceRefstringReference to the originating session
filesarrayRelated 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

FieldTypeRequiredDescription
titlestringNoUpdated title
contentstringNoUpdated content
typestringNoUpdated type category
statusstringNo"approved", "draft", or "deprecated"
schemaKeystringNoUpdated 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

TypeDescription
architectureTech stack, patterns, project structure
conventionCoding conventions, style rules, team agreements
implementationFeatures built, components created, APIs implemented
decisionKey decisions with rationale and trade-offs
bugBugs found, fixes applied, workarounds
todoPending tasks, known issues, planned improvements

Confidence scores

Each item has a confidence score between 0 and 1, assigned during enrichment:

RangeMeaning
0.9 - 1.0High confidence, directly verified against code
0.7 - 0.89Moderate confidence, supported by evidence
0.5 - 0.69Lower confidence, may need review
Below 0.5Low confidence, flagged for verification

Items with low confidence scores should be reviewed manually in the dashboard.

Next steps