Skip to content

Commit f987f21

Browse files
feat(memory): agent identity memory store attachments — API layer
1 parent cfd9f36 commit f987f21

3 files changed

Lines changed: 141 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 23
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta/warp-api-e752e75a35d88b84870729ef94b0c32783172983420cbff1b204ca14375553f7.yml
3-
openapi_spec_hash: 34787afc1e1c84a643431a0f0eb352ae
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta/warp-api-2783b07289e9f71f07550497c5180824f3dbc92477b5d1d8a80fa6dce4e3b8b6.yml
3+
openapi_spec_hash: e1d4cff965beed1ec255bf387d55d940
44
config_hash: 5a6e285f6e3a958a887b31b972a3f49c

src/resources/agent/agent_.ts

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ export interface AgentResponse {
9494
*/
9595
created_at: string;
9696

97+
/**
98+
* Memory stores attached to this agent. Always present; empty when no stores are
99+
* attached.
100+
*/
101+
memory_stores: Array<AgentResponse.MemoryStore>;
102+
97103
/**
98104
* Name of the agent
99105
*/
@@ -132,6 +138,26 @@ export interface AgentResponse {
132138
}
133139

134140
export namespace AgentResponse {
141+
/**
142+
* Reference to a memory store to attach to an agent.
143+
*/
144+
export interface MemoryStore {
145+
/**
146+
* Access level for the store.
147+
*/
148+
access: 'read_write' | 'read_only';
149+
150+
/**
151+
* Instructions for how the agent should use this memory store. Must not be empty.
152+
*/
153+
instructions: string;
154+
155+
/**
156+
* UID of the memory store.
157+
*/
158+
uid: string;
159+
}
160+
135161
/**
136162
* Reference to a managed secret by name.
137163
*/
@@ -159,6 +185,13 @@ export interface CreateAgentRequest {
159185
*/
160186
description?: string | null;
161187

188+
/**
189+
* Optional list of memory stores to attach to the agent. Each store must be
190+
* team-owned by the same team as the agent. Duplicate UIDs within a single request
191+
* are rejected.
192+
*/
193+
memory_stores?: Array<CreateAgentRequest.MemoryStore>;
194+
162195
/**
163196
* Optional list of secrets associated with the agent. Duplicate names within a
164197
* single request are rejected. Each entry is unioned into the run-time secret
@@ -177,6 +210,26 @@ export interface CreateAgentRequest {
177210
}
178211

179212
export namespace CreateAgentRequest {
213+
/**
214+
* Reference to a memory store to attach to an agent.
215+
*/
216+
export interface MemoryStore {
217+
/**
218+
* Access level for the store.
219+
*/
220+
access: 'read_write' | 'read_only';
221+
222+
/**
223+
* Instructions for how the agent should use this memory store. Must not be empty.
224+
*/
225+
instructions: string;
226+
227+
/**
228+
* UID of the memory store.
229+
*/
230+
uid: string;
231+
}
232+
180233
/**
181234
* Reference to a managed secret by name.
182235
*/
@@ -212,6 +265,12 @@ export interface UpdateAgentRequest {
212265
*/
213266
description?: string | null;
214267

268+
/**
269+
* Replacement list of memory stores. Omit to leave unchanged, pass an empty array
270+
* to clear, or pass a non-empty array to replace.
271+
*/
272+
memory_stores?: Array<UpdateAgentRequest.MemoryStore> | null;
273+
215274
/**
216275
* The new name for the agent
217276
*/
@@ -231,6 +290,26 @@ export interface UpdateAgentRequest {
231290
}
232291

233292
export namespace UpdateAgentRequest {
293+
/**
294+
* Reference to a memory store to attach to an agent.
295+
*/
296+
export interface MemoryStore {
297+
/**
298+
* Access level for the store.
299+
*/
300+
access: 'read_write' | 'read_only';
301+
302+
/**
303+
* Instructions for how the agent should use this memory store. Must not be empty.
304+
*/
305+
instructions: string;
306+
307+
/**
308+
* UID of the memory store.
309+
*/
310+
uid: string;
311+
}
312+
234313
/**
235314
* Reference to a managed secret by name.
236315
*/
@@ -258,6 +337,13 @@ export interface AgentCreateParams {
258337
*/
259338
description?: string | null;
260339

340+
/**
341+
* Optional list of memory stores to attach to the agent. Each store must be
342+
* team-owned by the same team as the agent. Duplicate UIDs within a single request
343+
* are rejected.
344+
*/
345+
memory_stores?: Array<AgentCreateParams.MemoryStore>;
346+
261347
/**
262348
* Optional list of secrets associated with the agent. Duplicate names within a
263349
* single request are rejected. Each entry is unioned into the run-time secret
@@ -276,6 +362,26 @@ export interface AgentCreateParams {
276362
}
277363

278364
export namespace AgentCreateParams {
365+
/**
366+
* Reference to a memory store to attach to an agent.
367+
*/
368+
export interface MemoryStore {
369+
/**
370+
* Access level for the store.
371+
*/
372+
access: 'read_write' | 'read_only';
373+
374+
/**
375+
* Instructions for how the agent should use this memory store. Must not be empty.
376+
*/
377+
instructions: string;
378+
379+
/**
380+
* UID of the memory store.
381+
*/
382+
uid: string;
383+
}
384+
279385
/**
280386
* Reference to a managed secret by name.
281387
*/
@@ -300,6 +406,12 @@ export interface AgentUpdateParams {
300406
*/
301407
description?: string | null;
302408

409+
/**
410+
* Replacement list of memory stores. Omit to leave unchanged, pass an empty array
411+
* to clear, or pass a non-empty array to replace.
412+
*/
413+
memory_stores?: Array<AgentUpdateParams.MemoryStore> | null;
414+
303415
/**
304416
* The new name for the agent
305417
*/
@@ -319,6 +431,26 @@ export interface AgentUpdateParams {
319431
}
320432

321433
export namespace AgentUpdateParams {
434+
/**
435+
* Reference to a memory store to attach to an agent.
436+
*/
437+
export interface MemoryStore {
438+
/**
439+
* Access level for the store.
440+
*/
441+
access: 'read_write' | 'read_only';
442+
443+
/**
444+
* Instructions for how the agent should use this memory store. Must not be empty.
445+
*/
446+
instructions: string;
447+
448+
/**
449+
* UID of the memory store.
450+
*/
451+
uid: string;
452+
}
453+
322454
/**
323455
* Reference to a managed secret by name.
324456
*/

tests/api-resources/agent/agent_.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ describe('resource agent', () => {
2626
name: 'name',
2727
base_model: 'base_model',
2828
description: 'description',
29+
memory_stores: [
30+
{
31+
access: 'read_write',
32+
instructions: 'instructions',
33+
uid: 'uid',
34+
},
35+
],
2936
secrets: [{ name: 'name' }],
3037
skills: ['string'],
3138
});

0 commit comments

Comments
 (0)