AiMemoryWriteRequest ai.memory-write-request@1

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk 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

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

FieldTypeRequiredDescriptionConstraints
itemsarray of object
  • minItems 1
  • maxItems 200
  • items: no other fields
items[].idstring
  • pattern ^mem_[0-9A-HJKMNP-TV-Z]{26}$
items[].textstringyes
  • minLength 1
  • maxLength 8000
items[].kindenum
  • one of "preference", "fact", "project_rule", "procedure", "decision", "lesson"
items[].scopestring
  • pattern ^(user|project:[a-z0-9][a-z0-9._-]{0,63})$
items[].sourcestring
  • minLength 1
  • maxLength 100
items[].source_refobject | null
items[].statusenum
  • one of "active", "suggested", "archived", "conflict"
items[].confidencenumber
  • minimum 0
  • maximum 1
items[].machinestring | null
  • maxLength 100
items[].no_looksboolean
items[].seen_atstring
  • format date-time
textstring
  • minLength 1
  • maxLength 8000
kindenum
  • one of "preference", "fact", "project_rule", "procedure", "decision", "lesson"
scopestring
  • pattern ^(user|project:[a-z0-9][a-z0-9._-]{0,63})$
statusenum
  • one of "active", "suggested", "archived", "conflict"
sourcestring
  • minLength 1
  • 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 }] }