Generated banner for membase
Generated logo for membase

membase

Memory serverOfficial Unibase project

Created by Unibase

Published in unibaseio/membase. Publisher page

139 GitHub stars

What it is

npm workspaces: @unibaseio/membase (typescript/), @unibaseio/membase-cli (cli/) and @unibaseio/membase-ai-sdk (integrations/ai-sdk/).
— the description by Unibase

AutoGineer overview, from the brain’s own files

Membase acts as a centralized memory layer for AI agents, allowing users to store facts, documents, and media in a single location that is accessible across various AI models and tools. By decoupling memory from specific AI providers, it ensures that knowledge is persistent and reusable, preventing the need to re-explain context when switching between different agents or platforms. Membase supports both a hosted service and a local execution mode, providing flexibility for data privacy and integration requirements. It features a robust CLI, Python and TypeScript SDKs, and an MCP server, enabling seamless connectivity with popular AI development environments like Claude Code, Cursor, and various agent frameworks.

How it works

Memory model: SQL database

AutoGineer overview, from the brain’s own files

Membase functions as a memory server that stores information in a structured format. Users can add data such as facts, documents, or media files through the CLI or SDK. This data is then indexed and made available to AI agents via an MCP server or API. The system manages memory isolation through project-specific contexts and supports both cloud-hosted storage and local storage options where the memory resides on the user's machine.

Folders
FolderRoleFiles
.githubagent-config1
assetsattachments11
docsdocs1
scriptsscripts3
teststests8
clifolder9
integrationsfolder130
membasefolder23
typescriptfolder12

Requirements

Runtimes: Node.js, Python >=3.10

Databases: PostgreSQL

API keys (by name): MEMBASE_API_KEY, OPENAI_API_KEY

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Google Antigravity, Kiro, OpenCode, Amp, Roo Code, Cline, JetBrains Junie, Devin (ex-Windsurf)

Set it up

  1. Add membase to .mcp.json:

    {
      "mcpServers": {
        "membase": {
          "type": "http",
          "url": "https://api.app.membase.com/mcp-http"
        }
      }
    }
    
  2. Or add it with the Claude Code CLI:

    claude mcp add --transport http membase https://api.app.membase.com/mcp-http
  3. Your data is sent to api.app.membase.com.

  4. Not scanned by AutoGineerIts dependencies are installed by pip or uv when you run it and were not scanned by AutoGineer (1 declared). https://pypi.org/project/unibaseio-membase/
  5. Created by Unibase. Published in unibaseio/membase. Licence: MIT License.

Usage

AutoGineer overview, from the brain’s own files

  • Integrate Membase into AI agent workflows to provide persistent long-term memory.
  • Use the CLI to import chat exports from various platforms into a unified knowledge base.
  • Connect AI coding assistants to Membase via MCP to maintain project-specific context.
  • Manage and query multi-modal data including text, documents, and media files.
  • Utilize the SDK to build custom agent integrations that read and write to the Membase memory layer.
“membase --local add "The project uses Postgres for the primary database."”
Stores the fact in the local memory instance for future retrieval by any connected AI agent.
“membase --local search "What database are we using?"”
Returns the relevant fact from the local memory store, providing the agent with accurate project context.

Documentation by Unibase

<p align="center"> <img src="https://raw.githubusercontent.com/unibaseio/membase/main/assets/membase-logo.png" width="72" alt="Membase"> </p>

<h1 align="center">Membase</h1>

<p align="center"> <b>One memory. Every AI. Only yours.</b><br> Teach it once. Every AI remembers. </p>

<p align="center"> <a href="https://pypi.org/project/unibaseio-membase/"><img src="https://img.shields.io/pypi/v/unibaseio-membase?label=pypi" alt="PyPI"></a> <a href="https://www.npmjs.com/package/@unibaseio/membase"><img src="https://img.shields.io/npm/v/@unibaseio/membase?label=npm" alt="npm"></a> <a href="https://github.com/unibaseio/membase/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT"></a> </p>

<p align="center"> <a href="https://membase.com">Website</a> · <a href="https://docs.membase.com">Docs</a> · <a href="https://app.membase.com">Web app</a> · <a href="https://discord.gg/nB9EfPGsSf">Discord</a> · <a href="https://x.com/Unibase_AI">X</a> </p>

<p align="center"> <img src="https://raw.githubusercontent.com/unibaseio/membase/main/assets/hero.svg" width="840" alt="Add sources, manage one memory, use it from every AI and app"> </p>

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 unibaseio-membase[local].

Write once, read from any AI

<p align="center"> <img src="https://raw.githubusercontent.com/unibaseio/membase/main/assets/in-action.svg" width="840" alt="Your app writes a memory; any AI reads it, here Claude Code"> </p>

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

Accuracy

<p align="center"> <img src="https://raw.githubusercontent.com/unibaseio/membase/main/assets/results.svg" width="840" alt="LoCoMo 93.1%, LongMemEval_S 92.6%, DMR 92.2%"> </p>

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

<p align="center"> <img src="https://raw.githubusercontent.com/unibaseio/membase/main/assets/architecture.svg" width="840" alt="Hosted, local in process, or local over HTTP"> </p>

pip install unibaseio-membase              # hosted · Python 3.10+ · needs MEMBASE_API_KEY
pip install 'unibaseio-membase[local]'     # local  · Python 3.12 or 3.13 · needs OPENAI_API_KEY
pip install 'unibaseio-membase[media]'     # local + photos, videos and audio
npm install @unibaseio/membase              # TypeScript · Node 18+
npm install -g @unibaseio/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 unibaseio-membase (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 unibaseio-membase[local], and media add and media ask (local only) need unibaseio-membase[media]: see Media memory. A local store with several Memories writes where MEMBASE_WRITE_TARGET names.

MCP

<p align="center"> <img src="https://raw.githubusercontent.com/unibaseio/membase/main/assets/mcp.svg" width="840" alt="MCP clients, hosted or local server, same tools"> </p>

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/unibaseio/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. unibaseio-membase[local] also installs unibaseio-membase-core, the compiled engine, under its own Unibase license.

CHANGELOG.md

Changelog

membase-google-adk 0.1.0 and membase-haystack 0.1.0

Two new integrations, both on unibaseio-membase 0.4:

  • integrations/google-adk/: MembaseMemoryService, a BaseMemoryService that ADK's preload_memory and load_memory search (time-boxed recall that fails open; writing sessions is opt-in with capture=True), and membase_tools() with membase_search, membase_save and membase_profile. client_for maps ADK's user id to that user's own client.

  • integrations/haystack/: MembaseMemoryStore, a MembaseMemoryRetriever component (time-boxed, fails open, serializes with the pipeline) and membase_tools() for a Haystack Agent.

@unibaseio/membase-ai-sdk 0.1.0 — Vercel AI SDK tools

A new integration, integrations/ai-sdk/: membaseTools() gives an AI SDK 6 or 7 agent the membase_search, membase_save and membase_profile tools over @unibaseio/membase 0.4.

0.4.0 — the memory API

unibaseio-membase 0.4.0, @unibaseio/membase 0.4.0, @unibaseio/membase-cli 0.4.0 and every integration (below) move to the Membase memory API. This is a breaking change: the request and answer shapes changed in place under /v1, the writes moved to POST + an action (below), and the earlier shapes and routes are no longer served. Earlier releases (0.3.x, npm 0.3.2) speak the earlier shapes and stop working against the hosted API once it serves the memory API.

No request names a Memory
  • containers / containers.list() and GET /v1/containers are gone, and so is every container= parameter. Reads cover every Memory the key reaches; writes land in the key's write target — a key that reaches exactly one text Memory writes there, and one that reaches several is refused with 422 write_target_required (WriteTargetRequiredError) rather than written somewhere by guess. capabilities() names the Memories a key reaches, the actions it holds and the user's standing rules.

  • Sending a field the API does not know (a container, static, metadata) is a 422.

  • memories.add(..., static=True) is gone: a standing fact about the user is a profile fact (profile_facts.add).

New shapes
0.30.4
searchsearch(q, container=, limit=) → {query, results, containers}search(q, limit=, mode="full") → {items: [{type, id?, content, score, memory_name, title?}], partial}
facts—memories.list(limit=), memories.get(id) (mem_… ids)
add a factmemories.add(content, container=, static=, title=) → variedmemories.add(content, title=) → 202 {id: "doc_…", kind: "note", status, learning}
add a documentadd(content, container=, url=, metadata=, custom_id=)add(content, url=, title=, custom_id=) (= documents.add) → 202 {id, kind: "file", status, learning}
documentsdocuments.list(container=) → {documents}documents.list(kind=, limit=) → {items, has_more, partial}; doc_… ids
medialocal only, container=media.list(limit=), get, search(q, kind=, limit=), delete; med_… ids; file_url/thumb_url routes
removal without confirm200 {status: "confirmation_required", …}428 confirmation_required → ConfirmationRequiredError; nothing changes
removal with confirm=Truevaried{id, status: "forgotten"} (facts, profile facts) or {id, status: "deleted"}
profileprofile(q=) → {static, dynamic, results}profile_facts.list(limit=) → {items: [{id: "pf_…", content, source_kind, recorded_at}], has_more, partial}; profile_facts.add(content) → the fact and created; profile_facts.forget(id, confirm=)
rulesrules() → GET /v1/rulesrules in capabilities(): {citation_required, retention_notice, version}
askask(message, model=) → the exposed agent's answerask(message) → {answer, citations: [{memory_name}], partial}, written by the memory itself; held only by a credential granted it (a marketplace buyer's), a model is a 422
capabilities—capabilities() → {actions, memories: [{name, kind}], rules, features}
Writes are POST + an action

Reads stay GET (and POST /v1/search, POST /v1/media/search, POST /v1/ask, local POST /v1/media/ask); every write is a POST naming its action. confirm stays a query parameter and the bodies are unchanged. The earlier method on the earlier path answers 405 method_not_allowed. The SDK methods keep their names.

0.30.4
memories.addPOST /v1/memoriesPOST /v1/memories/add
memories.forgetDELETE /v1/memories/{id}POST /v1/memories/{id}/forget?confirm=
add / documents.addPOST /v1/documentsPOST /v1/documents/add
documents.deleteDELETE /v1/documents/{id}POST /v1/documents/{id}/delete?confirm=
media.deleteDELETE /v1/media/{id}POST /v1/media/{id}/delete?confirm=
media.add (local only)POST /v1/mediaPOST /v1/media/add
profile_facts.listGET /v1/profile?q= (profile())GET /v1/profile-facts?limit=
profile_facts.add—POST /v1/profile-facts/add
profile_facts.forget—POST /v1/profile-facts/{id}/forget?confirm=
rules in capabilities()GET /v1/rules (rules())GET /v1/capabilities

Every list is {items, has_more, partial}: the newest limit (1–1000, default 100), whether more were left out, and the Memories that could not answer. Learning status is succeeded, processing, pending or failed. Answers carry a Memory's name (memory_name), never its id.

New errors: ConfirmationRequiredError (428) and WriteTargetRequiredError (a 422, subclass of UnprocessableEntityError). New: capabilities() and profile_facts (TypeScript profileFacts); profile() and rules() are gone. Each profile fact call needs the key's profile tick, and what it may do follows the access level: list at Read, add at Read & write, forget (with confirm) at Full access.

Local memory

Membase(local=...) and membase serve answer the same routes with the same shapes and refusals. A local store's write target is the Memory MEMBASE_WRITE_TARGET names, else its only one, else a new default; several and none named is the same 422. A fact added through the API is kept as a note (a kind: "note" document), so deleting the note forgets what it taught, as hosted. Local learning finishes before a write answers, so receipts say succeeded. Media items name their file and thumbnails as routes (/v1/media/{id}/file, …/thumbs/{name}, with Range support) instead of paths, read with media.file(id, thumb=, range=) (TypeScript media.file(id, {thumb, range})): the bytes, content type and, for a range, status 206 — with the key, hosted and local alike. Storing media (media.add) and media.ask stay local-only and take no container. Profile facts live in the store's profile (~/.membase/profile/) and need unibaseio-membase-core 0.3.5 (the [local] extra installs 0.3.6, which also reads a PDF from its own text layer and reranks a long passage by the part that answers); a statement added locally is user_stated, one kept with add --static before 0.4 reads as imported. Local ask is the engine's answer from the Memory whose facts match best.

Command line and MCP
  • membase (Python and npm): containers, profile, --container and --static are gone; new memories list|get, documents list --kind --limit, search --mode, capabilities, profile-facts list|add|forget, and hosted media list|get|search|delete (npm too). A removal without --confirm prints the API's answer and exits 1. Local import and agent write to the store's write target.

  • membase mcp offers the hosted MCP server's tools by the same names and arguments: get_capabilities, search_memories, ask_memory, list_memories, get_memory, add_memory, forget_memory, list_profile_facts, add_profile_fact, forget_profile_fact, list_documents, get_document, add_document, delete_document, and list_media, get_media, search_media, delete_media (hosted, or local with the media extra; local also add_media and ask_media). list_containers, get_profile, memory_rules, ask_agent and every container/static argument are gone. A refused call, a removal without confirm included, is a tool error carrying the API's code.

Integrations

All cite memory_name, report partial, take no container option and explain a missing write target: langchain-membase 0.2.0, agent-framework-membase 0.2.0, membase-strands 0.2.0, Hermes plugin unibaseio-membase 0.3.0, Dify plugin unibase/membase 0.1.0, OpenClaw plugin @unibaseio/membase 0.2.0. Each requires the 0.4 SDK. Their profile tool (membase_profile, Dify's get_profile) lists the user's profile facts and takes no topic. The Hermes plugin also takes tools: off (MEMBASE_TOOLS), recall_mode: fast (MEMBASE_RECALL_MODE), and, on a Hermes build with memory.user_store: provider, keeps the user's facts in their Membase profile (record_user_fact) and recalls the profile before each turn.

210 files · 192 not served here

Advantages

  • Provides a unified memory source that works across different AI models and tools, eliminating redundant context setup. evidence: README.md
  • Supports both hosted and local-first deployment options to accommodate different privacy and infrastructure needs. evidence: README.md

Limitations

  • Local memory features require specific Python versions (3.12 or 3.13) and additional dependencies. evidence: pyproject.toml
  • Operations involving multiple memories require an explicit write target to be defined to avoid errors. evidence: README.md

Security

Risk level: No risk found

This brain runs

MCP servers (1)

  • gemini-extension.json (membase): https://api.app.membase.com/mcp-http · uses the network

Attribution and licence

Created by
Unibase
Declared authors
  • Unibase (declared in pyproject.toml)
Publisher
Unibase (Official Unibase project)
Source
unibaseio/membase · commit 5910023
Licence
MIT License (files served here)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Unibase.

Install from source

192 of its files are not served here, so there is no ZIP. unibaseio/membase at 5910023