Memory API
Lists the API routes that read, list, and patch the project memory of an owner, the current map of its project.
On this page
GET /v1/memory
Lists projects with their sections. owner limits it to one project. Without it, the answer covers your own account and each team where you are an active member. A project with no sections is left out.
Answer: {"projects": [{"owner", "rev", "sections": [{"name", "scope", "size", "version", "updated_at", "updated_by"}]}]}.
GET /v1/memory/{owner}
Reads the document. scope is team, user or merged (default). section limits it to one section. A section in the wrong scope is 422.
Answer: {"owner", "scope", "rev", "sections": [{"name", "scope", "version", "updated_at", "updated_by", "content"}], "markdown"}. Sections come in the fixed order, and a missing section is absent.
GET /v1/memory/{owner}/rev
The change signal, from one listing and without reading any section. Answer: {"owner", "rev", "sections": {"{name}": "{hash}"}}. rev is 0 for a project with no sections. The runtime appends it to every tool answer.
PUT /v1/memory/{owner}/{section}
Patches a section. The scope follows the section: open-work is your overlay, every other section is the team's.
| Field | Type | Required | Rule |
|---|---|---|---|
if_version | integer | yes | The version you read. 0 means the section must not exist. |
edits | array | one of three | {"find", "replace"} pairs, applied in order and all or nothing. Each find must match exactly once. |
content | string | one of three | Creates a new section. On an existing section it is 422. |
delete | boolean | one of three | Removes the section. |
Answer: {"name", "scope", "version", "updated_at", "updated_by", "size"}.
Errors:
404— the section name is unknown.409—if_versionis stale. The body carriescurrent:{"version", "content", "updated_at", "updated_by"}. Merge into it and write again.422— a missingif_version, or none or several of the three fields.422— afindthat matches no place or several. The sentence names the edit.422— a result over 16384 bytes.