Skip to main content

MESA — Memory Engine for Structured Agents

MESA CI Release License: Apache 2.0 Python: 3.11+

MESA stores source documents and finds passages an application is authorized to read. Every search hit links to its document, revision and location. Ingestion and BM25 search work without models. Add an embedding model for semantic search or a chat model for answers with citations and document summaries.

Package version: 0.10.0. V4 is the current API. Production qualification remains at the release candidate stage: NO-GO until the release gates pass.

Installation

pip install mesa-memory

Supported natively on Linux, macOS (Apple silicon), and Windows 10/11 (Python 3.12–3.14), with no WSL or Docker required. Install this checkout with pip install -e . to try unreleased features.

Start the server

mesa start

Starts the local server on http://127.0.0.1:8000, initializes storage at ~/.mesa/data, and creates credentials at ~/.mesa/credentials.json (mode 0600).

Add and search documents

In another terminal, add and search documents immediately:

mesa add document.pdf
mesa search "your query"

Python SDK

from mesa_client import Mesa

with Mesa() as mesa:
    document = mesa.add_file("document.pdf", wait=True)
    print(mesa.search("your query", document_ids=[document["document_id"]]))

Mesa() uses MESA_API_KEY and MESA_BASE_URL when they are set, otherwise the local credentials in ~/.mesa/credentials.json.

See Law versions to store revisions of a law and search the wording in force on a date.

Optional models and answers

Run mesa setup to choose embeddings and a chat model. Restart mesa start to apply the saved settings. With a chat model configured, run mesa ask "your question" for a cited answer or mesa summarize <document-id> for a single-document summary. Applications can call POST /v1/chat/completions with a MESA API key and model mesa.

The SDK also exports OpenAI-format search, read_text and list_documents tools for applications that handle their own model calls. Model configuration · Answering and tools

Connect MCP clients

Run mesa mcp config codex or select a supported client to print its configuration. MCP supports agent memory insert and recall, plus model-backed mesa_ask and mesa_summarize. MCP guide

Canonical V4 fact extraction is owned by FactExtractionService and can be enabled separately with MESA_EXTRACTION_ENABLED=true and a configured chat model.

Docker

Run MESA on your own server with one command (non-root container, persistent volume, rate limits enabled by default, bootstrap API key printed once on first boot):

docker compose -f docker-compose.v4.yml up --build -d

Read the one-time bootstrap key from first-start logs (docker compose -f docker-compose.v4.yml logs mesa-v4) or /var/lib/mesa/credentials.json in the persistent volume:

docker compose -f docker-compose.v4.yml exec mesa-v4 cat /var/lib/mesa/credentials.json
docker compose -f docker-compose.v4.yml exec -T mesa-v4 mesa add - --source file://document.txt < document.txt
docker compose -f docker-compose.v4.yml exec mesa-v4 mesa search "your query"

No variables are required; models and external providers default off. See Install on your own server for hardware minimums, optional embedding/LLM environment settings, TLS reverse proxy setup, backups, and upgrades. If you set MESA_API_KEY and MESA_PRINCIPAL_ID for existing HTTP clients, the server accepts that key too, and the mesa commands inside the container use it first; add -e MESA_API_KEY= after exec to use the local credentials instead. Build with --build-arg MESA_EXTRAS=ml to add local sentence-transformers. Ollama defaults to http://host.docker.internal:11434 (the Docker host).

Google Colab

Run MESA with GPU-accelerated Ollama in Colab: Colab Quickstart

Development

uv sync --locked --python 3.11

See testing for local tests and test markers.

Documentation

License

MESA is licensed under the Apache License, Version 2.0. See NOTICE for copyright information.

Metadata

Release files for mesa-memory 0.10.0

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

Source distribution (sdist)

Source distribution for mesa-memory 0.10.0
File Size Uploaded Provenance Actions
mesa_memory-0.10.0.tar.gz 1.6 MB With provenance Details for mesa_memory-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mesa-memory 0.10.0
File Interpreter ABI Platform Actions
mesa_memory-0.10.0-py3-none-any.whl Python 3 none any Details for mesa_memory-0.10.0-py3-none-any.whl

Total release size: 2.8 MB

Release files / mesa_memory-0.10.0.tar.gz

Download URL mesa_memory-0.10.0.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
f37802f5073645b0e980ce3c7da49662476b6185b731a29ba49e45cecb175292
BLAKE2b-256 checksum
How to use checksums
733409efbd76c78f6ea7a9768d1b260913579e0bbddba48c853df3d54cd4b41b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / mesa_memory-0.10.0-py3-none-any.whl

Download URL mesa_memory-0.10.0-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
5f04a15caf67fbfa6fe7794734717a966d1348896eef271807f0a62fd9ade495
BLAKE2b-256 checksum
How to use checksums
aa328ecc03abb5722aed3c356eafce729e67ff036bf278d6ceb55f1039c241b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for mesa-memory 0.10.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mesa_memory-0.10.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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