NylorunDocsBeta
Runtime APIAgentsMemory

Write a memory

PUT
/v1/agents/{agentId}/memories/{path}

Creates the memory or replaces its content, as the memory tool's create does, and records a version with the caller as its actor. This is how an app seeds an Agent's memory. With contentSha256 the write applies only while the memory still has that content ("": only while no memory has the path); otherwise 409 memory_conflict with the current memory. The path ends in .md; the Runtime limits memoryBytes (413) and memoriesPerAgent (409 limit_exceeded) hold.

Authorization

headerAuthorizationBearer <token>

An application key of the Tenant (PUT /v1/tenant/keys/{keyId}), or Studio's key, derived from the admin key. With Nylorun-Subject and Nylorun-Scopes, it acts for that person, narrowed to those scopes. Never accepted from a browser (Origin).

Path Parameters

agentId*string

The Agent id, percent-encoded

path*string

The memory's path under /memories, percent-encoded: conventions%2Frelease.md is /memories/conventions/release.md

Header Parameters

Nylorun-Protocol*string

The protocol version, 18

Nylorun-Subject?string

The person an application key acts for

Nylorun-Scopes?string

The subject's space-separated scopes; required with a subject

Request Body

application/json
  1. body
content*string
contentSha256?string

Response Body

The memory as written

application/json
  1. response
path*string
bytes*integer
Range0 <= value
contentSha256*string
description*string|null
version*integer
Range0 < value
updatedAt*string
content*string
import { createClient } from "@nylorun/agents";const client = await createClient();await client.agents.memories.put(  "users/alice/assistant",  "conventions/release.md",  "---\ndescription: How we cut a release\n---\nTag from main after CI passes.\n",  { contentSha256: "" }, // only while no memory has the path; else 409 memory_conflict);
{  "path": "string",  "bytes": 0,  "contentSha256": "string",  "description": "string",  "version": 1,  "updatedAt": "string",  "content": "string"}