thezakuloGet the newsletter
← All setup guides

Setup guide · 4 steps · about 10 minutes

How to start using membaseai/membase

Membase is a memory layer for AI agents that stores facts, documents, and chats in one memory you can search and that other AIs read through its SDK, CLI, or MCP server.

Built from the official docs: raw.githubusercontent.com · checked 25 November 2026

Local Python (no API key)

  1. Install the package

    Install the local build with pip. The local option needs Python 3.12 or 3.13 and an OpenAI key.

    pip install 'membase-ai[local]'
  2. Set your OpenAI key

    The local install reads OPENAI_API_KEY from the environment. Replace the placeholder with your own key.

    export OPENAI_API_KEY=<your-openai-api-key>
  3. Add and search a memory in Python

    Create a local client, add a fact, then search it. Local memory lives in ~/.membase and answers the same routes as hosted.

    from membase import Membase
    
    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": [...]}
  4. Or use the command line

    The same package gives you the membase command. Use --local before the command to run against your local store.

    membase --local add "We picked Postgres for the ledger"
    membase --local search "what did we pick for the ledger?"
    membase --local ask "Which database is the ledger on?"

Check it worked

Running the search or ask command returns a result referencing the fact you added (for example, that the ledger is on Postgres); the Python search returns an object shaped like {items, has_more, partial}.

Try these first

Get every issue by email

One email a week with the written issue. Free, one-click unsubscribe

Subscribe