MESA
Health Uyari
- License — License: Apache-2.0
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 6 GitHub stars
Code Basarisiz
- rm -rf — Recursive force deletion command in .github/workflows/ci.yml
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
Local-first, source-linked evidence engine for documents and AI agents. Hybrid search (BM25 + vectors) with exact citations (document, revision, character span, page), point-in-time legal versions, LLM answers with "not found", and MCP. Self-hosted.
MESA — Memory Engine for Structured Agents
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, runmesa 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-backedmesa_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
- Getting Started Guide
- Install on Your Own Server (Docker)
- Configuration Reference
- API Reference
- MCP Integration Guide
- Architecture
- Documentation Index
License
MESA is licensed under the Apache License, Version 2.0. See NOTICE for copyright information.
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi