Skip to main content
Glama

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
NameRequiredDescriptionDefault
contentYesThe memory content to store.
memoryTypeNoMemory type. Default: note.
projectNoAssociate memory with a project.

Implementation Reference

  • 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 };
      },
    },
  • 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 };
    },
  • 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;
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/git-fabric/aiana'

If you have feedback or need assistance with the MCP directory API, please join our Discord server