MemNexus
GuidesIntegrations

ChatGPT

Use MemNexus memory with ChatGPT via custom GPTs or the API.

ChatGPT Desktop supports MCP via its Apps feature (available on Business, Enterprise, Education, and Plus plans), and MemNexus runs a hosted remote MCP server that ChatGPT can connect to natively. If you can't use MCP, you can also connect MemNexus using Custom GPTs with API actions or by building with the ChatGPT API.

ChatGPT's MCP Apps connect to remote MCP server URLs. MemNexus provides a hosted MCP endpoint at https://mcp.memnexus.ai/mcp, so ChatGPT Desktop can connect natively — run mx setup chatgpt to configure it. The Custom GPT and SDK options below remain available for ChatGPT surfaces that don't support MCP Apps.

Option 1: Native MCP (ChatGPT Desktop)

ChatGPT Desktop connects directly to the hosted MemNexus MCP server — no custom code, and you get the full MemNexus tool set (search, create, recall, and more) rather than the two API actions defined below.

mx setup chatgpt

This walks you through adding MemNexus as a remote MCP server (https://mcp.memnexus.ai/mcp) in ChatGPT Desktop's connector settings. Once connected, ChatGPT can search and create memories on its own, the same way Claude Desktop and Cursor do. See Model Context Protocol for how the connection works.

Option 2: Custom GPT with API actions

Create a Custom GPT that calls the MemNexus API directly. Use this when you want a shareable GPT or are on a ChatGPT surface without MCP Apps support.

1. Create a Custom GPT

In ChatGPT, go to Explore GPTs > Create a GPT.

2. Add instructions

You have access to MemNexus, a persistent memory system. Use the provided
actions to search and create memories.

WHEN TO SEARCH: Before answering questions about the user's projects,
preferences, or past conversations.

WHEN TO SAVE: When the user shares important decisions, preferences,
or project context.

Always search memory before asking the user to repeat information.

3. Add API actions

In the GPT configuration, add actions pointing to the MemNexus API:

Search memories:

openapi: 3.0.0
info:
  title: MemNexus Memory Search
  version: 1.0.0
servers:
  - url: https://api.memnexus.ai
paths:
  /api/memories/search:
    post:
      operationId: searchMemories
      summary: Search memories by meaning
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: string
                limit:
                  type: integer
                  default: 5
      responses:
        '200':
          description: Search results

Create memory:

  /api/memories:
    post:
      operationId: createMemory
      summary: Create a new memory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [content]
              properties:
                content:
                  type: string
                topics:
                  type: array
                  items:
                    type: string
      responses:
        '201':
          description: Memory created

4. Configure authentication

Set the authentication to API Key with:

  • Auth type: Bearer
  • API Key: Your MemNexus API key (cmk_live_xxx.yyy)

Option 3: ChatGPT API with MemNexus SDK

Build a custom chatbot that combines the ChatGPT API with MemNexus:

npm install openai @memnexus-ai/typescript-sdk
import { Memnexus } from "@memnexus-ai/typescript-sdk";
import OpenAI from "openai";

const mx = new Memnexus({ token: process.env.MX_API_KEY });
const openai = new OpenAI();

async function chat(message: string) {
  // Search for relevant memories
  const searchResponse = await mx.memories.searchMemories({
    query: message,
    limit: 5,
  });

  const context = (searchResponse.data?.data ?? [])
    .map((r) => `- ${r.memory.content}`)
    .join("\n");

  // Chat with memory context
  const response = await openai.chat.completions.create({
    model: "gpt-4o",
    messages: [
      {
        role: "system",
        content: `You are a helpful assistant with persistent memory.

Relevant memories:
${context || "No relevant memories found."}

If the user shares important information, note it so we can save it.`,
      },
      { role: "user", content: message },
    ],
  });

  return response.choices[0].message.content;
}

Limitations

  • MCP Apps require a supported plan — Native MCP (Option 1) needs ChatGPT Desktop on a plan that includes MCP Apps (Business, Enterprise, Education, or Plus). On other surfaces, use the Custom GPT or SDK options
  • Action limits — Custom GPTs (Option 2) have limits on the number and frequency of API calls, and expose only the two actions you define rather than the full MemNexus tool set
  • No proactive saving with Custom GPTs — A Custom GPT needs explicit instructions to save memories; native MCP lets ChatGPT decide when to search and save on its own

Next steps