Skip to main content
Glama

Membase is the memory layer for AI agents. It keeps one memory for everything you and your agents know, and every AI you use reads it. You stop re-explaining yourself each time you switch models or tools.

  • Add. Facts, documents, web pages and chat exports from Claude or ChatGPT go into one memory.

  • Manage. Memories keep projects apart; search them, ask them questions, forget what should go.

  • Use. Your code, Claude Code, Cursor, Codex and ChatGPT read the same memory through the SDK or MCP.

This repository is the developer side: Python and TypeScript clients, the membase command line and an MCP server. The memory lives in your Membase account, which the web app and browser extension also fill, or on your machine with membase-ai[local].

Write once, read from any AI

Recordings: Python SDK (57 s) · Claude Code (1 min 33 s). The answer above is illustrative.

Related MCP server: Recall

Accuracy

93.1% on LoCoMo, 92.6% on LongMemEval_S and 92.2% on DMR, using about 3× fewer tokens than the full history on LoCoMo and 11× fewer on LongMemEval_S. Method and results: membase.com/research

Quickstart

pip install membase-ai              # hosted · Python 3.10+ · needs MEMBASE_API_KEY
pip install 'membase-ai[local]'     # local  · Python 3.12 or 3.13 · needs OPENAI_API_KEY
pip install 'membase-ai[media]'     # local + photos, videos and audio
npm install @membaseai/membase              # TypeScript · Node 18+
npm install -g @membaseai/membase-cli       # the `membase` command (hosted) without Python
from membase import Membase

m = Membase()                    # hosted
# m = Membase(local=True)        # local, in ~/.membase

m.memories.add("We picked Postgres for the ledger service.")   # a fact
m.search("what database is the ledger on?")                    # {"items": [...], "partial": [...]}
m.add("Design notes …", custom_id="design-1")                   # a document
m.profile_facts.list()                                         # who the user is (Your profile ticked)
m.capabilities()                                               # what this key may do, and the rules

No call names a Memory: reads cover every Memory the key reaches, and writes land in its write target (a key that reaches several Memories and has none is refused with WriteTargetRequiredError). Ids are typed (mem_… a fact, doc_… a document, med_… a photo or video), lists are {items, has_more, partial}, and a removal without confirm=True raises ConfirmationRequiredError. Local memory answers the same routes with the same shapes.

Every method, its REST route and MCP tool, and the access it needs: SDK reference. Upgrading from 0.3: see the changelog. The Python package is membase-ai (import membase); membase on PyPI is unrelated.

Command line

membase --local add "We picked Postgres for the ledger"
membase --local search "what did we pick for the ledger?"
membase --local memories list
membase --local ask "Which database is the ledger on?"
membase --local import ~/Downloads/claude-export.json     # Claude, ChatGPT, markdown or JSON chats
membase --local agent ingest trace.json --agent coder
membase --local agent search "fix flaky deploy" --agent coder
membase --local media add ~/Movies/trip.mp4                # shots, speech and speakers
membase --local media search "someone skiing"   # any language

Without --local (or --store DIR, both before the command) commands use the hosted API; agent, import and serve need membase-ai[local], and media add and media ask (local only) need membase-ai[media]: see Media memory. A local store with several Memories writes where MEMBASE_WRITE_TARGET names.

MCP

claude mcp add membase -- membase --local mcp                                   # local
claude mcp add --transport http membase https://api.app.membase.com/mcp-http \
  --header "Authorization: Bearer $MEMBASE_API_KEY"                             # hosted

Hosted without the header, the connection signs you in and is read-only. Setup for Claude, ChatGPT, Cursor, Codex and other clients: Connect your AI.

Gemini CLI, as an extension (it signs you in on first use; /mcp auth membase signs in again):

gemini extensions install https://github.com/membaseai/membase

Cline: add the server to cline_mcp_settings.json; llms-install.md has the entry, with and without a developer key.

Docs

License

MIT; see LICENSE. membase-ai[local] also installs membase-core, the compiled engine, under its own proprietary license (Membase Core License).

Available Tools

20 tools
add_documentBInspect

Give the user's memory raw material to learn: content text or a public url. The same custom_id again is a no-op.

Inputs: url, title, content, custom_id. Returns: result

add_mediaAInspect

Store an image, video or audio file: a path on this machine or a public url. Shots, captions, speech and speakers are worked out before it returns (minutes for a long video).

Inputs: url, path, title, custom_id. Returns: result

add_memoryAInspect

Save one durable fact or a short exchange, in the user's words. It is written as a note (doc_ id) and learned; a standing fact about the user themselves goes to add_profile_fact.

Inputs: content (required), title. Returns: result

add_profile_factBInspect

Keep one standing statement about the user themselves, in their words. The same one again keeps the one there (created: false).

Inputs: content (required). Returns: result

ask_mediaCInspect

An answer from media memory alone, with the items it drew on.

Inputs: message (required). Returns: result

ask_memoryBInspect

One answer to message, written from what the user's memory holds, with the Memory it came from (citations). The passages themselves are not returned.

Inputs: message (required). Returns: result

delete_documentAInspect

Remove a document by its doc_ id and what was learned from it. Without confirm=true nothing changes and the call fails with confirmation_required.

Inputs: document_id (required), confirm. Returns: result

delete_mediaAInspect

Forget a media item by its med_ id and remove its file. Without confirm=true nothing changes and the call fails with confirmation_required.

Inputs: media_id (required), confirm. Returns: result

forget_memoryAInspect

Forget one learned fact by its mem_ id; the material it came from stays. Without confirm=true nothing changes and the call fails with confirmation_required.

Inputs: memory_id (required), confirm. Returns: result

forget_profile_factAInspect

Forget one profile statement by its pf_ id. To correct one, add the new statement and forget the old. Without confirm=true nothing changes and the call fails with confirmation_required.

Inputs: fact_id (required), confirm. Returns: result

get_capabilitiesAInspect

What this connection can do: the actions it holds, the Memories it may use (by name) and the user's standing rules for using them. Read-only.

Inputs: no named parameters. Returns: result

get_documentBInspect

One document by its doc_ id, with where its learning stands.

Inputs: document_id (required). Returns: result

get_mediaBInspect

One media item with its shots and spoken lines (times, speakers, thumbnails).

Inputs: media_id (required). Returns: result

get_memoryAInspect

One learned fact by its mem_ id (from search_memories or list_memories).

Inputs: memory_id (required). Returns: result

list_documentsBInspect

The material the user's memory was given, newest first; kind is file or note. limit is how many, newest first: 1-1000, default 100.

Inputs: kind, limit. Returns: result

list_mediaCInspect

The photos and videos in media memory, newest first, each with a one-sentence summary.

Inputs: limit. Returns: result

list_memoriesBInspect

The newest facts the user's memory learned, newest first. limit is how many, newest first: 1-1000, default 100.

Inputs: limit. Returns: result

list_profile_factsAInspect

Who the user is: standing statements (name, role, lasting preferences), newest first, each with its pf_ id and source_kind. limit is how many, newest first: 1-1000, default 100.

Inputs: limit. Returns: result

search_mediaBInspect

Photos and videos matching q (any language), best first, each with the moments that matched. kind is image or video (locally also audio or text).

Inputs: q (required), kind, limit. Returns: result

search_memoriesAInspect

Passages the user's memory holds on q, most relevant first, each naming the Memory it came from (memory_name); a fact carries its mem_ id. limit is the total number of passages (1-50); mode="fast" is one round with no model call. Retrieval, not an answer.

Inputs: q (required), mode, limit. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 20 tools

    Disambiguation4/5

    The set is organized into four clear resource families (learned facts, profile facts, documents, media), and descriptions explicitly steer between tricky pairs like add_memory vs add_profile_fact and search_memories (retrieval) vs ask_memory (answer). The one soft spot is add_memory writing a `doc_` note while add_document also creates notes, plus three near-parallel 'ask/list/search' tools across memory and media, but descriptions disambiguate each.

    Naming Consistency5/5

    Every tool follows a strict verb_noun pattern (add_/get_/list_/search_/delete_/forget_/ask_) with plural nouns for collection operations and singular for single-item ops. Only trivial deviation is get_capabilities using a plural object where no single capability resource exists.

    Tool Count4/5

    20 tools across four resource families is on the heavy side but each one maps to a distinct operation, with no redundant or speculative tools. The set could be trimmed slightly (e.g. ask_memory vs search_memories) but overall the count is earned by the breadth of the memory domain.

    Completeness4/5

    Full lifecycle coverage exists for media (add/list/get/search/delete/ask) and near-full for memories and profile facts, with documented workarounds (add-then-forget instead of update a profile fact). Gaps remain: documents have no update or search operation despite being a core resource, and there is no way to edit a learned memory in place.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Provides persistent, self-optimizing memory for AI agents, enabling them to remember preferences and context across sessions and share knowledge across multiple agents.
      4
      6 npm
      ISC
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides persistent, cross-session memory for AI agents, allowing them to store and automatically retrieve information across different conversations and sessions without repeating context.
      17 npm
      179
      MIT
    • F
      license
      C
      quality
      B
      maintenance
      Gives AI agents persistent memory, handoffs, and shared context across sessions, enabling seamless continuity and multi-agent collaboration.
      29
      53 npm
      71
      -