Skip to main content

Mneme: a self-hosted catalog of callables (OpenAPI operations, library symbols) and persistent memory for AI agents.

Project description

Mneme

CI PyPI Python License: Apache-2.0 GHCR

A self-hosted catalog of callables and persistent memory for AI agents.

Mneme is a local-first indexer and search service. An LLM agent uses it to find the right HTTP API operation, library symbol, or saved note — then pull a minimal slice instead of loading entire docs into context.

Published on PyPI as mneme-server; the CLI is mneme.

Quickstart

pip install mneme-server
mneme demo                            # index a bundled spec, run a sample search
mneme mcp-config --client cursor      # paste-ready MCP config
mneme doctor                          # environment diagnostics

Index popular public APIs in one shot:

mneme crawl-seeds examples/seeds.popular.txt

The default index lives in a per-user directory (XDG-aware), so later commands work without --db.

What gets indexed

Mneme searches callables — individual things an agent can invoke or recall:

Kind Example
HTTP operation POST /v1/refunds
Python symbol httpx.Client.get
JS/TS symbol axios.create
Agent note a saved scratch-pad entry

All kinds share one SQLite + FTS5 index and one MCP search tool (search_callables).

flowchart LR
  openapi[OpenAPI specs] --> normalize
  pylib[Python packages] --> symbols
  jslib[.d.ts files] --> symbols
  normalize --> sqlite[(SQLite + FTS5)]
  symbols --> sqlite
  notes[Notebook + workspace] --> notesdb[(notes.db)]
  sqlite --> mcp[MCP server]
  sqlite --> httpapi[HTTP API]
  notesdb --> mcp
  mcp --> agent[Agent]
  httpapi --> agent

Install

pip install mneme-server              # base CLI + HTTP API
pip install 'mneme-server[mcp]'       # + local MCP server
pip install 'mneme-server[libraries]' # + Python + JS/TS library indexing

From source:

git clone https://github.com/Joshwani/mneme.git && cd mneme
python -m venv .venv && source .venv/bin/activate
python -m pip install -e '.[dev,mcp,libraries]'

CLI

# index
mneme add-file examples/specs/todo.yaml
mneme add-spec https://example.com/openapi.yaml
mneme discover example.com --ingest
mneme crawl-seeds examples/seeds.popular.txt
mneme add-pylib httpx
mneme add-jslib --package axios --file ./axios.d.ts

# search
mneme search "create refund" --method POST
mneme search-callables "create request" --kind http_operation

# memory
mneme notes-add --title "T" --body "B" --tag x
mneme notes-search "query"
mneme workspace-enable --scope notes --max-mb 10
mneme workspace-write --scope notes --path a.md --content "..."

# serve
mneme serve --host 127.0.0.1 --port 8080
mneme mcp-server
mneme stats
mneme doctor

Use --db <path> to override the default index path.

MCP server

Mneme runs locally over stdio (or streamable HTTP). Credentials and notes stay on your machine.

pip install 'mneme-server[mcp]'
mneme mcp-server
mneme mcp-config --client cursor      # Cursor
mneme mcp-config --client claude      # Claude Desktop
mneme mcp-config --client continue    # Continue.dev

Main tools: search_callables, get_operation, get_library_symbol, prepare_http_call, execute_http_call, notes_*, workspace_*, mneme_stats. HTTP execution is dry-run by default; real calls require explicit confirmation.

Library indexing

Python — static analysis via griffe (no code execution):

pip install 'mneme-server[pylib]'
mneme add-pylib httpx
mneme add-pylib mymod --source-dir ./src

JavaScript/TypeScript — parse a local .d.ts via tree-sitter (no Node required):

pip install 'mneme-server[jslib]'
mneme add-jslib --package axios --file ./node_modules/axios/index.d.ts

Memory

Two opt-in primitives in a separate notes.db:

  • Notebook — FTS5-backed scratch pad (notes-add, notes-search, …).
  • Scoped workspace — small file area for snippets; off until you workspace-enable a scope.

Auth profiles

Store credentials in env vars, reference them by profile name. Agents see redacted previews, not secrets.

{
  "profiles": {
    "github": {
      "provider_domain": "api.github.com",
      "base_url": "https://api.github.com",
      "allow_methods": ["GET", "POST"],
      "auth": { "type": "bearer", "token_env": "GITHUB_TOKEN" }
    }
  }
}

Default path: ~/.config/mneme/auth.json. See examples/auth.json for a fuller example.

mneme auth-profiles
mneme prepare-call op_... --auth-profile github --json-body '{}'
mneme execute-call op_... --auth-profile github --send --confirm

HTTP API

mneme serve --host 127.0.0.1 --port 8080
curl -s -X POST http://127.0.0.1:8080/search \
  -H 'content-type: application/json' \
  -d '{"query":"create a todo","limit":5}'

Endpoints: GET /health, GET /stats, POST /search, GET /operations/{id}, GET /operations/{id}/spec-slice, POST /operations/{id}/prepare-call, POST /operations/{id}/execute-call.

Docker

docker pull ghcr.io/joshwani/mneme:latest
cd deploy && docker compose up --build -d

See deploy/ for systemd, cron, and compose examples.

Default paths

What Env override Default (Linux/macOS)
API/library index MNEME_DB ~/.local/share/mneme/mneme.db
Notes index MNEME_NOTES_DB ~/.local/share/mneme/notes.db
Workspace root MNEME_WORKSPACE_ROOT ~/.local/share/mneme/workspace/
Auth config ~/.config/mneme/auth.json

Troubleshooting

Run mneme doctor first — it prints resolved paths, index size, installed extras, and a network check.

Problem Fix
Empty search results Run mneme demo or mneme crawl-seeds examples/seeds.popular.txt
MCP ImportError pip install 'mneme-server[mcp]'
401/403 on execute Check env vars referenced in your auth profile
Host not allowed Adjust profile allow_methods / hosts, or MNEME_HTTP_ALLOW_HOSTS

Development

python -m pip install -e '.[dev,mcp,libraries]'
ruff check && ruff format --check && pytest

See CONTRIBUTING.md and CHANGELOG.md.

License

Apache License 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mneme_server-0.4.0.tar.gz (68.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mneme_server-0.4.0-py3-none-any.whl (70.5 kB view details)

Uploaded Python 3

File details

Details for the file mneme_server-0.4.0.tar.gz.

File metadata

  • Download URL: mneme_server-0.4.0.tar.gz
  • Upload date:
  • Size: 68.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mneme_server-0.4.0.tar.gz
Algorithm Hash digest
SHA256 21a4ef0cef6d261d004641d86ad31ec426a62bde2c730b4d4d6f042d9c420c87
MD5 2969dbae94c52924cb6b693ed4cf7ec6
BLAKE2b-256 82da6a86c2ed4f360287b3a3c4b0724cd307b0e7bf99cb69e876182982ae2dc0

See more details on using hashes here.

Provenance

The following attestation bundles were made for mneme_server-0.4.0.tar.gz:

Publisher: release.yml on Joshwani/mneme

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mneme_server-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: mneme_server-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 70.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mneme_server-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0e099154ba2220da481f6f1b9dbf7c78d680aa942997b7422eef21dfee7cefb
MD5 c0f2ba660f2b3631f5907bf511beec1d
BLAKE2b-256 272c267c57365ae97036092d09b2f0edea18da68c0b0f6a935358ae456861cbe

See more details on using hashes here.

Provenance

The following attestation bundles were made for mneme_server-0.4.0-py3-none-any.whl:

Publisher: release.yml on Joshwani/mneme

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page