aiana_memory_add
Store new memories with automatic secret scrubbing for privacy. Supports notes, preferences, patterns, and insights while associating them with specific projects.
Instructions
Store a new memory. Content is automatically scrubbed for secrets before embedding and storage.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The memory content to store. | |
| memoryType | No | Memory type. Default: note. | |
| project | No | Associate memory with a project. |
Implementation Reference
- src/layers/memories.ts:18-25 (handler)The core addMemory handler implementation that scrubs sensitive content from the input before delegating to the adapter for embedding and storage.
export async function addMemory( adapter: AianaAdapter, content: string, opts: { project?: string; memoryType?: string; sessionId?: string } = {}, ): Promise<string> { const clean = scrubSensitive(content); return adapter.addMemory(clean, opts); } - src/app.ts:52-76 (registration)Tool registration for aiana_memory_add with name, description, input schema (content, memoryType, project), and execute handler that returns the memory ID with success status.
{ name: "aiana_memory_add", description: "Store a new memory. Content is automatically scrubbed for secrets before embedding and storage.", inputSchema: { type: "object", properties: { content: { type: "string", description: "The memory content to store." }, memoryType: { type: "string", enum: ["note", "preference", "pattern", "insight"], description: "Memory type. Default: note.", }, project: { type: "string", description: "Associate memory with a project." }, }, required: ["content"], }, execute: async (args) => { const id = await layers.memories.addMemory(adapter, args.content as string, { memoryType: args.memoryType as string | undefined, project: args.project as string | undefined, }); return { id, stored: true }; }, }, - src/app.ts:69-75 (handler)Execute function that processes the tool arguments, calls the memories layer addMemory, and returns a response with the new memory ID.
execute: async (args) => { const id = await layers.memories.addMemory(adapter, args.content as string, { memoryType: args.memoryType as string | undefined, project: args.project as string | undefined, }); return { id, stored: true }; }, - src/layers/scrub.ts:33-39 (helper)Helper function that redacts sensitive patterns (GitHub tokens, API keys, JWTs, passwords) from text before embedding and storage.
export function scrubSensitive(text: string): string { let result = text; for (const [pattern, replacement] of SCRUB_RULES) { result = result.replace(pattern, replacement); } return result; }