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)
| Field | Type | Description |
|---|---|---|
files | map of string | Map of file path to the file's text content. At most 50 files per request. |
workspaceId | string (uuid) | Target workspace. |
Responses
| Status | Description |
|---|---|
200 | The number of files that were actually documented. |
Response fields
| Field | Description |
|---|---|
documented | Number 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)
| Field | Type | Description |
|---|---|---|
query | string | Text describing what the file does. |
topK | integer | Number of files to return; defaults to 5, clamped to 1 to 50. |
workspaceId | string (uuid) | Workspace to search. |
Responses
| Status | Description |
|---|---|
200 | A 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
| Name | In | Type | Description |
|---|---|---|---|
workspaceId (required) | path | string (uuid) | Workspace to act in. A workspace the credential cannot access returns 404. |
Responses
| Status | Description |
|---|---|
200 | A list of file summaries with path, type, summary, purpose and structural information. |
Example
curl -X GET "$API/v1/files/$WS" \
-H "Authorization: Bearer $KEY"