Skip to main content

Membase

membase-ai

One memory. Every AI.
Drop-in memory infrastructure for AI agents and apps — the Membase SDK.

PyPI npm MIT

Website · Docs · Web app · Discord · X

Sources go into one memory that every AI and app reads

The Membase SDK: a Python client, the membase command line, an MCP server and a TypeScript client. The memory lives in your Membase account or on your machine, behind the same API.

Write from code, read from Claude Code

Your code writes a memory; Claude Code reads it over MCP

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

Benchmarks

LoCoMo 93.1%, LongMemEval_S 92.6%, DMR 92.2%

Install

Hosted, local in process, or local over HTTP

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
npm install membase-ai              # TypeScript · Node 18+

The package is membase-ai; membase on PyPI is unrelated.

from membase import Membase

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

m.memories.add("We picked Postgres for the ledger service.", container="Engineering")
m.search("what database is the ledger on?")
m.add("Design notes …", container="Engineering", custom_id="design-1")   # a document
m.profile()
m.ask("Which database did we choose for the ledger?")

Client methods: read, write, remove, answer

  • Deleting a document or forgetting a memory needs confirm=True; without it you get what would be removed.
  • Hosted, ask needs an agent-endpoint key, and each key is limited to its containers and access level.

Conversations, documents and agent traces

Command line

membase --local add "We picked Postgres for the ledger" --container Engineering
membase --local search "what did we pick for the ledger?"
membase --local ask "Which database is the ledger on?"
membase --local import ~/Downloads/claude-export.json     # Claude, ChatGPT, markdown or JSON chats
membase --local import ~/chats/ --dry-run                 # a directory; --dry-run only reports
membase --local documents add notes.md --container Engineering
membase --local agent ingest trace.json --agent coder
membase --local agent search "fix flaky deploy" --agent coder
  • --local and --store DIR go before the command. Without them, commands use the hosted API.
  • agent and serve are local only. import needs membase-ai[local] to read the exports.
  • MEMBASE_LOCAL=1 makes local the default when MEMBASE_API_KEY is not set.

MCP

MCP clients, hosted or local server, same tools

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

Hosted without the header, the connection signs you in and is read-only.

Local memory over HTTP

membase --local serve            # http://127.0.0.1:8787/v1

The hosted API's agent-protocol routes, answered by the local engine: point any client's base URL at it. Set MEMBASE_LOCAL_TOKEN to require it as a bearer token.

Local settings

Stores: ~/.membase/memory.db (default container), ~/.membase/containers/<id>/ (others), ~/.membase/profile/ (static facts). Settings come from the environment, or from a .env file in the current directory or a parent.

Setting Default
OPENAI_API_KEY chat and embeddings
MEMBASE_LLM_PROVIDER from your keys openai, anthropic, ollama or openai-compat for chat; set the models below to match
MEMBASE_LLM_ENDPOINT base URL for ollama or openai-compat
MEMBASE_EMBED_PROVIDER openai openai-compat uses MEMBASE_LLM_ENDPOINT
MEMBASE_EMBED_MODEL text-embedding-3-small embeddings
MEMBASE_EPISODE_MODEL gpt-4.1-mini conversations into episodes
MEMBASE_DECIDER_MODEL gpt-4o-mini picks the episodes a search returns
MEMBASE_READER_MODEL gpt-4o ask answers
MEMBASE_KNOWLEDGE_MODEL gpt-4o-mini documents into topic trees
MEMBASE_AGENT_MODEL gpt-4o-mini agent traces
MEMBASE_LANG en zh for Chinese extraction prompts

Repository

membase/ is the Python package (client.py, cli.py, local/ for local memory and membase serve, mcp/ for membase mcp); typescript/ is the npm package. membase-sdk (PyPI and npm) is the earlier name, kept as an alias.

License

MIT. membase-ai[local] also installs membase-core, the compiled engine, under Unibase's proprietary license.

Metadata

Release files for membase-ai 0.2.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for membase-ai 0.2.17
File Size Uploaded
membase_ai-0.2.17.tar.gz 25.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for membase-ai 0.2.17
File Interpreter ABI Platform
membase_ai-0.2.17-py3-none-any.whl Python 3 none any Details

Total release size: 56.2 kB

Release files / membase_ai-0.2.17.tar.gz

Download URL membase_ai-0.2.17.tar.gz
Size 25.5 kB
Tags Source
SHA-256 checksum
How to use checksums
55b38cba8e3949404a46b6d111fdeff67d207286c13f9ecd70e8a3689fcd8eb2
BLAKE2b-256 checksum
How to use checksums
cbdeadf37bd969fb4c5c3ef0014db1b89bc4c94a1f43363ad4d9dd1dc9b25c8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Release files / membase_ai-0.2.17-py3-none-any.whl

Download URL membase_ai-0.2.17-py3-none-any.whl
Size 30.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2f2643a32d84065a451590f976178646cf06f020ce31bacce8521675af52676
BLAKE2b-256 checksum
How to use checksums
b8e80189932e88089d4bded2eec3fccd9c1dd9b0080fe551b0dac9eaff5adc77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page