ChatGPT / GPT-4o

Persistent Memory for ChatGPT Agents & GPT-4o

OpenAI's function calling and Assistants API are powerful — but memory still resets every session. AgentMind gives your GPT agents a persistent memory layer that works with function calling, tool use, and the Assistants API out of the box.

Function calling
compatible
Drop in as a tool. GPT decides when to remember and recall.
Assistants API
compatible
Works alongside file search and code interpreter tools.
$0.01
per memory op
Cheaper than a single GPT-4o input token.

Function calling integration — JS/TS

Define AgentMind as a native GPT tool. The model decides when to save and recall on its own.

Complete working example
// 1. Define AgentMind as a function in your GPT agent
const tools = [{
  type: "function",
  function: {
    name: "save_memory",
    description: "Save important information to persistent memory that will be available in future sessions",
    parameters: {
      type: "object",
      properties: {
        key: { type: "string", description: "Unique identifier for this memory" },
        value: { type: "string", description: "The information to remember" },
        type: { type: "string", enum: ["preference", "context", "fact", "workflow"] }
      },
      required: ["key", "value"]
    }
  }
}, {
  type: "function",
  function: {
    name: "recall_memory",
    description: "Retrieve a previously saved memory",
    parameters: {
      type: "object",
      properties: { key: { type: "string" } },
      required: ["key"]
    }
  }
}];

// 2. Handle the tool calls
async function handleToolCall(name, args) {
  const AGENT_KEY = process.env.AGENTMIND_KEY;
  const headers = { "X-API-Key": AGENT_KEY, "Content-Type": "application/json" };

  if (name === "save_memory") {
    await fetch("https://agentmind.dev/api/ac/memory", {
      method: "POST", headers,
      body: JSON.stringify({ agent_key: AGENT_KEY, memory_key: args.key, memory_value: args.value, memory_type: args.type })
    });
    return { saved: true };
  }

  if (name === "recall_memory") {
    const res = await fetch(`https://agentmind.dev/api/ac/memory?agent_key=${AGENT_KEY}&memory_key=${args.key}`, { headers });
    const data = await res.json();
    return { value: data.memory?.memory_value || null };
  }
}

What GPT agents can remember with AgentMind

User preferences
Tone, format, language, timezone, recurring choices
Previous conversations
Key decisions, topics covered, commitments made
Project context
Codebase details, requirements, architecture notes
Task state
Multi-step workflow progress, pending items, blockers
Learned facts
User-specific data the agent discovers during sessions
Tool results
Cache expensive API calls across conversations

Give your GPT agents a real memory.

Free tier. $0.50 credits on signup. No card needed.

Get API Key Free