---
title: "ai.memory-write-request@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/ai.memory-write-request"
updated: null
---

# ai.memory-write-request@1 · OpenVibe.Services

HTML: [ai.memory-write-request@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/ai.memory-write-request)

# AiMemoryWriteRequest `ai.memory-write-request@1`

Generated at 2026-11-13 06:25:48 UTC from [`openvibe-contracts v0.419.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.419.0) and [`openvibe-sdk v0.161.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.161.0).

- Version: 1.0.0
- Owner: ai
- Visibility: first-party
- Status: active
- Compatibility: backward
- Schema: [`https://openvibe.network/contracts/ai/memory-write-request.v1.json`](/docs/contracts/ai.memory-write-request.json)

ai.memory-write-request@1 (OpenVibe.AI; Memory M2): the body of POST /api/v1/memory/items:batch (up to 200 items), PATCH /api/v1/memory/items/{id} (text, kind, scope or status) and DELETE /api/v1/memory/items?source= (the source to delete). Secret shapes are redacted again on the server, and an item that is only a secret is refused. AI-produced items are suggestions until the person accepts them.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `items` | array of object |  |  | - `minItems 1`<br>- `maxItems 200`<br>- `items: no other fields` |
| `items[].id` | string |  |  | - `pattern ^mem_[0-9A-HJKMNP-TV-Z]{26}$` |
| `items[].text` | string | yes |  | - `minLength 1`<br>- `maxLength 8000` |
| `items[].kind` | enum |  |  | - `one of "preference", "fact", "project_rule", "procedure", "decision", "lesson"` |
| `items[].scope` | string |  |  | - `pattern ^(user\|project:[a-z0-9][a-z0-9._-]{0,63})$` |
| `items[].source` | string |  |  | - `minLength 1`<br>- `maxLength 100` |
| `items[].source_ref` | object \| null |  |  |  |
| `items[].status` | enum |  |  | - `one of "active", "suggested", "archived", "conflict"` |
| `items[].confidence` | number |  |  | - `minimum 0`<br>- `maximum 1` |
| `items[].machine` | string \| null |  |  | - `maxLength 100` |
| `items[].no_looks` | boolean |  |  |  |
| `items[].seen_at` | string |  |  | - `format date-time` |
| `text` | string |  |  | - `minLength 1`<br>- `maxLength 8000` |
| `kind` | enum |  |  | - `one of "preference", "fact", "project_rule", "procedure", "decision", "lesson"` |
| `scope` | string |  |  | - `pattern ^(user\|project:[a-z0-9][a-z0-9._-]{0,63})$` |
| `status` | enum |  |  | - `one of "active", "suggested", "archived", "conflict"` |
| `source` | string |  |  | - `minLength 1`<br>- `maxLength 100` |

## Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

 Valid: batch

~~~~
{
  "items": [
    {
      "text": "Use the repo's formatter before a commit.",
      "kind": "procedure",
      "scope": "project:openvibe-link",
      "source": "claude-code",
      "source_ref": {
        "path": ".claude/CLAUDE.md",
        "heading": "Style"
      },
      "confidence": 1
    }
  ]
}
~~~~

Rejected: empty-batch

~~~~
{
  "items": []
}
~~~~

## Validate

~~~~
const contracts = require('openvibe-contracts');
contracts.validate('ai.memory-write-request@1', value);   // { valid, errors: [{ path, message }] }
~~~~
