1import type * as bedrock from "@distilled.cloud/aws/bedrock-agent-runtime";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { AgentAlias } from "./AgentAlias.ts";
5
6/**
7 * The `DeleteAgentMemory` request with the binding-injected `agentId` and
8 * `agentAliasId` removed — they are supplied automatically from the bound
9 * {@link AgentAlias}.
10 */
11export interface DeleteAgentMemoryRequest extends Omit<
12 bedrock.DeleteAgentMemoryRequest,
13 "agentId" | "agentAliasId"
14> {}
15
16/**
17 * Runtime binding for `bedrock-agent-runtime:DeleteAgentMemory` — delete the
18 * memory an agent has stored, for one session, one memory id, or everything.
19 *
20 * Bind an {@link AgentAlias} inside a function runtime to get a callable
21 * that clears the agent's long-term memory. The binding grants the function
22 * `bedrock:DeleteAgentMemory` scoped to exactly that alias. Deletion is
23 * idempotent — deleting a session or memory id that holds no memory
24 * succeeds.
25 *
26 * ### Deleting Agent Memory
27 * **Example:** Forget One Session
28 * ```typescript
29 * // init
30 * const deleteAgentMemory = yield* Bedrock.DeleteAgentMemory(alias);
31 *
32 * // runtime
33 * yield* deleteAgentMemory({ sessionId });
34 * ```
35 *
36 * **Example:** Forget Everything for a Memory Id
37 * ```typescript
38 * yield* deleteAgentMemory({ memoryId: userId });
39 * ```
40 *
41 * @binding
42 */
43export interface DeleteAgentMemory extends Binding.Service<
44 DeleteAgentMemory,
45 "AWS.Bedrock.DeleteAgentMemory",
46 <A extends AgentAlias>(
47 alias: A,
48 ) => Effect.Effect<
49 (
50 request: DeleteAgentMemoryRequest,
51 ) => Effect.Effect<
52 bedrock.DeleteAgentMemoryResponse,
53 bedrock.DeleteAgentMemoryError
54 >
55 >
56> {}
57export const DeleteAgentMemory = Binding.Service<DeleteAgentMemory>(
58 "AWS.Bedrock.DeleteAgentMemory",
59);