Agent Memory

File summaries

File summaries API: 3 endpoints under /v1.

Store file summaries

POST /v1/files/document

Sends file contents so Agent Memory can store a short summary and structural information per file; the file contents themselves are not stored as memories. At most 50 files per request, text content only. Requires the write permission.

See also: File summaries.

Request body (DocumentWorkspaceRequest)

FieldTypeDescription
filesmap of stringMap of file path to the file's text content. At most 50 files per request.
workspaceIdstring (uuid)Target workspace.

Responses

StatusDescription
200The number of files that were actually documented.

Response fields

FieldDescription
documentedNumber of files documented successfully.

Example

curl -X POST "$API/v1/files/document" \
  -H "Authorization: Bearer $KEY" \
  -H 'Content-Type: application/json' \
  -d '{"workspaceId":"$WS"}'

Search file summaries

POST /v1/files/search

Finds the stored file summaries that best match a query, for example to locate the file that handles a feature. topK defaults to 5 and is clamped to 1 to 50. Requires the read permission.

See also: File summaries.

Request body (FileSearchRequest)

FieldTypeDescription
querystringText describing what the file does.
topKintegerNumber of files to return; defaults to 5, clamped to 1 to 50.
workspaceIdstring (uuid)Workspace to search.

Responses

StatusDescription
200A list of matching file summaries.

Example

curl -X POST "$API/v1/files/search" \
  -H "Authorization: Bearer $KEY" \
  -H 'Content-Type: application/json' \
  -d '{"topK":10,"workspaceId":"$WS"}'

List file summaries

GET /v1/files/{workspaceId}

Returns every stored file summary in the workspace. Requires the read permission.

See also: File summaries.

Parameters

NameInTypeDescription
workspaceId (required)pathstring (uuid)Workspace to act in. A workspace the credential cannot access returns 404.

Responses

StatusDescription
200A list of file summaries with path, type, summary, purpose and structural information.

Example

curl -X GET "$API/v1/files/$WS" \
  -H "Authorization: Bearer $KEY"

On this page