Documentation

Memobase provides a persistent, shared memory layer for AI agents. It ensures context is never lost and intelligence is unified across all your tools.

How Memobase Works

Memobase is a dedicated memory server designed for the unique needs of LLMs. It combines several advanced technologies to give agents a reliable sense of history and project awareness.

Knowledge Graph

Every memory is parsed for entities (people, projects, concepts) and their relationships. This allows agents to navigate context via association, exploring related memories through a semantic graph.

Hybrid Search

We combine Semantic Vector Search (understanding meaning) with Keyword BM25 Search (exact term matching). This hybrid approach ensures agents find the right context regardless of how it's queried.

Memory Consolidation

Memobase doesn't just store logs; it evolves them. Background workers deduplicate, merge, and update memories as you provide new information, ensuring your "knowledge base" stays accurate and current.

Context Reconstruction

Agents can call reconstruct_context to get a comprehensive snapshot of a project or session, instantly loading all relevant history and decisions into their current working window.

Unlocking Continuity

The Problem: Fragmented Intelligence

Today's AI agents are functionally "siloed." Every session starts from a blank slate, and intelligence is trapped within specific tools. If you spend hours architecting a feature in Claude Code, your ChatGPT instance has no way to access those decisions. This leads to:

  • Context Regurgitation: Constantly repeating your tech stack, preferences, and project goals.
  • Lost Rationale: Forgetting why a specific trade-off was made in a previous conversation.
  • Workflow Friction: The inability to hand off tasks between specialized agents (e.g., coding in Claude, drafting in ChatGPT).

The Solution: Memobase Shared Memory

Memobase acts as a universal context layer that sits behind all your AI tools. It provides a single source of truth that is updated in real-time as you work.

1

Observe

Agents automatically log progress, decisions, and tool activity to Memobase.

2

Unify

Memory is consolidated and synced across all your connected agents instantly.

3

Resume

Any agent can pick up exactly where another left off by querying the shared graph.

The Role of the System Prompt

Connecting Memobase via MCP or OpenAI Actions provides the agent with tools, but it doesn't automatically make the agent proactive. Without instructions, an agent might only use memory when you explicitly ask it to.

Why it's necessary:

  • Proactive Recall: The prompt tells the agent to check memory at the start of a task to see if relevant context already exists.
  • Durable Storage: It instructs the agent to distinguish between "chitchat" and "durable info" (like a tech stack decision) that should be saved for the future.
  • Tool Selection: It helps the agent understand when to use search_memory vs. knowledge_graph_query for best results.

Note: Integrations like HTTP Hooks bypass this need by automatically triggering recall and storage at the protocol level, but for standard MCP connections, a well-tuned system prompt is your best friend.

Integrations

Model Context Protocol (MCP)

MCP is the native way to connect Memobase to modern agents like Claude Desktop, Claude Code, and Gemini CLI.

How it works:

Memobase provides an MCP-native server. When connected, the agent gains direct access to a set of memory "tools" (e.g., search_memory, store_memory). The agent decides when to use these tools based on its system prompt.

Configuration URL

https://mcp.memobase.ai

HTTP Hooks (Claude Code)

A specialized integration for Claude Code that enables automated session tracking and background context management.

Why use Hooks?

Zero-Config Recall

Hooks fire on startup to automatically inject capabilities and recent context without requiring any system prompt setup.

Auto-Saving Sessions

Recent user/assistant turns and completion milestones are compacted and flushed to your memory graph on session end, so progress survives terminal restarts.

Claude Code Configuration Snippet

{
  "hooks": {
    "SessionStart": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "http",
            "url": "https://mcp.memobase.ai/hooks/claude",
            "headers": {
              "Authorization": "Bearer $MEMOBASE_API_KEY"
            },
            "allowedEnvVars": [
              "MEMOBASE_API_KEY"
            ],
            "timeout": 30
          }
        ]
      }
    ],
    "UserPromptSubmit": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "http",
            "url": "https://mcp.memobase.ai/hooks/claude",
            "headers": {
              "Authorization": "Bearer $MEMOBASE_API_KEY"
            },
            "allowedEnvVars": [
              "MEMOBASE_API_KEY"
            ],
            "timeout": 10
          }
        ]
      }
    ],
    "Stop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "http",
            "url": "https://mcp.memobase.ai/hooks/claude",
            "headers": {
              "Authorization": "Bearer $MEMOBASE_API_KEY"
            },
            "allowedEnvVars": [
              "MEMOBASE_API_KEY"
            ],
            "timeout": 15
          }
        ]
      }
    ],
    "TaskCompleted": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "http",
            "url": "https://mcp.memobase.ai/hooks/claude",
            "headers": {
              "Authorization": "Bearer $MEMOBASE_API_KEY"
            },
            "allowedEnvVars": [
              "MEMOBASE_API_KEY"
            ],
            "timeout": 15
          }
        ]
      }
    ],
    "SessionEnd": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "http",
            "url": "https://mcp.memobase.ai/hooks/claude",
            "headers": {
              "Authorization": "Bearer $MEMOBASE_API_KEY"
            },
            "allowedEnvVars": [
              "MEMOBASE_API_KEY"
            ],
            "timeout": 30
          }
        ]
      }
    ]
  }
}

OpenAI Actions (ChatGPT)

Connect your Custom GPTs to Memobase using OpenAI's Action system. This allows ChatGPT to persist knowledge across chats and share memory with your other agents.

  1. 1. Open your GPT configuration and click Create new action.
  2. 2. Set Authentication to OAuth (Memobase handles this natively).
  3. 3. Import the Memobase OpenAPI schema to expose memory tools.

Partial OpenAPI Specification

openapi: 3.1.0
info:
  title: Memobase API
  description: Persistent long-term memory for AI agents.
  version: 1.0.0
servers:
  - url: https://mcp.memobase.ai
paths:
  /api/memories/search:
    post:
      operationId: search_memory
      summary: Search through your long-term memory
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                query: { type: string }
                mode: { type: string, enum: [hybrid, semantic, keyword] }
  /api/memories/store:
    post:
      operationId: store_memory
      summary: Store a new durable memory

Troubleshooting

Hooks aren't firing?
Ensure MEMOBASE_API_KEY is exported in your current shell session. Run printenv | grep MEMOBASE to verify the environment variable is active.
Getting 401 Unauthorized?
Check that your API key is active in the Dashboard and that you are using the correct Authorization header format (Bearer mb_live_...). Note that keys are only shown once upon creation.