Skip to content

An open-source, faster Devin alternative

TypeScript

docs: apply the final review corrections to the memory pages

Igor Zalutski10bc33af43c9
diff --git a/docs/agents/document-memory.mdx b/docs/agents/document-memory.mdx
index 5f0a1a39..48c7077b 100644
--- a/docs/agents/document-memory.mdx
+++ b/docs/agents/document-memory.mdx
@@ -36,10 +36,13 @@ export const requirements = defineMemory({
Development and Production have separate documents, even when resource and
document IDs match. Definitions sharing an ID within one deployment must agree
-on the provider and its configuration. The deployment selected for an
-environment sets its shared resource limit. That limit applies to writes made
-after the deployment is selected, from all sessions, including sessions whose
-agent code is pinned to an older deployment.
+on the provider and its configuration. The deployment promoted to an
+environment sets its shared resource limit. Promotion applies the memory
+configuration just before it selects the code, so the limit governs writes
+from that moment, from all sessions, including sessions whose agent code is
+pinned to an older deployment. A promotion that applies its configuration and
+then fails to select the code leaves the configuration in force; re-run the
+promotion or promote another deployment.
`maxBytes` is a rule for future writes, not a check on stored data. Lowering
it never fails a deployment and never truncates a document. A document that
@@ -63,8 +66,11 @@ chosen by the application.
The tools have fixed names. Each takes an optional `memory` argument naming
the resource; it is required only when more than one bound resource offers
-that tool with the needed access. The tool description lists the bound
-resources with the descriptions from their declarations.
+that tool with the needed access. It resolves against the resources the
+render that produced the call selected with `useMemory()`, not against every
+binding the session holds. The tool description lists those resources with
+the descriptions from their declarations. `memory` is a reserved argument
+name; provider tool schemas may not declare it.
Access defaults to `read`. Collection-wide writes are not supported. The
resource must be declared by the session's deployment, and a document binding
@@ -167,10 +173,13 @@ The tool result is structured, so instructions can branch on it:
| `{ "status": "rejected", "reason": "not_bound", "bound": ["requirements"] }` | `memory` named a resource this session cannot write; the result lists what it can. |
A conflict or rejection is a result, not a tool error: the turn continues and
-the model decides what to do. Every committed save is also recorded in the
-session's event log as `memory.saved` with `resource`, `documentId`,
-`revision` and `bytes`, so an application can refresh its view of the notes
-without polling the document or parsing tool results.
+the model decides what to do. When the session observes a successful save it
+records a `memory.saved` event with `resource`, `documentId`, `revision` and
+`bytes`, so an application can refresh its view of the notes without parsing
+tool results. The event is a notification of observed success, not a
+guaranteed change feed: a save whose reply was lost is durable without an
+event. Refresh documents from the API when attaching to a session, after a
+reconnect and when work completes.
There is no automatic extraction at turn end or compaction, and no separate
read tool for a document binding: the next render reads the document.
diff --git a/docs/agents/memory-providers.mdx b/docs/agents/memory-providers.mdx
index c5bca932..ed965f2a 100644
--- a/docs/agents/memory-providers.mdx
+++ b/docs/agents/memory-providers.mdx
@@ -35,6 +35,7 @@ export const knowledge = defineMemory({
name: "remember",
description: "Save a verified fact for future work.",
access: "write",
+ idempotent: false,
input: {
type: "object",
properties: { fact: { type: "string", maxLength: 2_000 } },
@@ -187,21 +188,27 @@ model response therefore receive the same cursor.
## Failures and retries
-Each operation has a ten-second deadline covering all attempts. OpenComputer
-retries transport failures, HTTP 408, 429 and 5xx at most twice, using the same
-operation ID and request body. Delays are 250 ms and one second; a valid
-`Retry-After` takes precedence when it fits the deadline. Other 4xx responses
-are not retried. Errors use the envelope above; `details` is optional.
-
-Tool operation IDs identify individual calls, not whole turns. A provider
-with write tools must deduplicate `(partition, operationId)`, reject reuse
-with a different tool, arguments or cursor, and retain the original result at
-least until `deadlineAt`. Concurrent duplicates must share the same operation.
-Commit the write and its receipt atomically, or use equivalent deduplication
-in the storage service. OpenComputer never retries after the original deadline.
-Reject new operations past that deadline even if a receipt has been removed.
-A timeout does not prove a write failed; subsequent inspection or recall may
-show its result.
+Each operation has a ten-second deadline covering all attempts. Recall and
+read tools are retried on transport failures, HTTP 408, 429 and 5xx at most
+twice, using the same operation ID and request body. Delays are 250 ms and one
+second; a valid `Retry-After` takes precedence when it fits the deadline.
+Other 4xx responses are not retried. Errors use the envelope above; `details`
+is optional.
+
+Write tools are retried only when declared `idempotent: true`. Declare that
+only if your endpoint deduplicates `(partition, operationId)`, rejects reuse
+with a different tool, arguments or cursor, and returns the original result
+for a duplicate until `deadlineAt`. Many upstream services cannot promise
+this through a thin adapter: some answer writes with a pending status and
+some create duplicates on resubmission. For a tool declared
+`idempotent: false` (the default), a transport failure or timeout is not
+retried; the model receives `{ "status": "uncertain" }` and the next request
+recalls current state. A timeout never proves a write failed.
+
+A write result reports what the provider can vouch for: `{ "status":
+"stored" }` when the data is available to recall, `{ "status": "accepted" }`
+when the endpoint has queued it upstream and recall may lag. Return the one
+that is true; OpenComputer passes it to the model unchanged.
Requests and responses are limited to 64 KiB each. A response may contain up
to 100 sources; IDs and cursors are limited to 1,024 UTF-8 bytes each. Invalid