Python binding for Mnemix — a local-first memory layer for AI coding agents
Project description
Mnemix Python Binding
A thin, typed Python client for Mnemix — a local-first memory layer for AI coding agents.
All product logic lives in the Rust mnemix CLI binary. This package
wraps its --json output surface; no core behavior is duplicated here.
Requirements
- Python 3.11 or later
- On supported platforms, the published wheel bundles the
mnemixbinary automatically - On unsupported platforms or source installs, install the CLI separately via
cargo install --path crates/mnemix-clior setMNEMIX_BINARY=/path/to/mnemix
Installation
Install the Python wrapper from PyPI:
pip install mnemix
If you primarily want the mnemix CLI as an isolated command-line tool,
prefer pipx:
pipx install mnemix
On supported platforms, this wheel includes the Rust mnemix CLI
binary and should work without any additional setup.
If no bundled wheel is available for your platform, install the CLI separately
and ensure mnemix is on PATH, or set MNEMIX_BINARY to an explicit
binary path.
Installation (development)
cd python
pip install -e ".[dev]"
Quick Start
from pathlib import Path
from mnemix import Mnemix, RememberRequest
tp = Mnemix(store=Path(".mnemix"))
tp.init()
tp.remember(RememberRequest(
id="mem-001",
scope="my-project",
kind="observation",
title="Initial scaffolding complete",
summary="Rust project scaffold created with workspace layout.",
detail="Added Cargo.toml workspace, core, lancedb, cli, and types crates.",
tags=["scaffolding"],
))
results = tp.search("scaffolding", scope="my-project")
for m in results:
print(f"{m.id}: {m.title}")
context = tp.recall()
for entry in context.pinned_context:
print(f"[pinned] {entry.memory.title}")
stats = tp.stats()
print(f"Total memories: {stats.total_memories}")
API Overview
| Method | Purpose |
|---|---|
init() |
Initialise the store (idempotent) |
remember(request) |
Persist a memory record |
show(memory_id) |
Retrieve full detail for a memory |
search(text, *, scope, limit) |
Full-text search |
recall(request) |
Layered context recall |
pins(*, scope, limit) |
List pinned memories |
history(*, scope, limit) |
List recent memories |
checkpoint(request) |
Create a named checkpoint |
versions(*, limit) |
List store versions |
restore(request) |
Restore to a checkpoint or version |
optimize(request) |
Compact and optionally prune old versions |
stats(*, scope) |
Get store statistics |
export(destination) |
Export the store |
import_store(source) |
Import a store archive |
Errors
| Exception | When raised |
|---|---|
MnemixError |
Base class for all errors |
MnemixCommandError |
CLI returned a non-zero exit or error JSON |
MnemixBinaryNotFoundError |
mnemix binary not found on PATH |
MnemixDecodeError |
CLI output could not be decoded |
Running Tests
cd python
pip install -e ".[dev]"
pytest
Release Validation
Before publishing a new version, from a local clone of this repository run the release checks from the repository root:
# From the repository root (source checkout)
./scripts/check-python-package.sh
This runs Python tests, builds the wheel and sdist, and validates package
metadata rendering with twine check. It also installs the freshly built wheel
into a clean virtual environment and verifies that mnemix imports and
exposes __version__ correctly.
Binding Strategy
The current binding uses the CLI --json surface as the execution boundary.
Direct FFI via PyO3 is deferred until a dedicated stable Rust application API
exists and there is a concrete need that the CLI boundary cannot satisfy.
If you are using Mnemix as a Python library inside an application, use
pip install mnemix. If you are installing it mainly for the mnemix command,
pipx install mnemix is usually the better fit.
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mnemix-0.4.0.tar.gz.
File metadata
- Download URL: mnemix-0.4.0.tar.gz
- Upload date:
- Size: 20.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29321e3df34dafab01244e8c7c978e28be30813ebcd4f873710ac40be8f7f614
|
|
| MD5 |
5fc7fa305dba56293cef04e7ed8db856
|
|
| BLAKE2b-256 |
7601e203a9055ba773b33f5f3c224f2180d91e6236e68128205d8e7dfba4ac13
|
Provenance
The following attestation bundles were made for mnemix-0.4.0.tar.gz:
Publisher:
publish-python.yml on micahcourey/mnemix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mnemix-0.4.0.tar.gz -
Subject digest:
29321e3df34dafab01244e8c7c978e28be30813ebcd4f873710ac40be8f7f614 - Sigstore transparency entry: 1291556947
- Sigstore integration time:
-
Permalink:
micahcourey/mnemix@cf7d25d82f1b617841ff71f1acb4ece7722f7d55 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/micahcourey
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@cf7d25d82f1b617841ff71f1acb4ece7722f7d55 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mnemix-0.4.0-py3-none-win_amd64.whl.
File metadata
- Download URL: mnemix-0.4.0-py3-none-win_amd64.whl
- Upload date:
- Size: 94.1 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
856f09fc50cb645e6ba113591cd97a71ac3dcbe4d7eed5b9ec290e412e02c5c3
|
|
| MD5 |
834e90fc55972b1743fd21f44c1aa2ad
|
|
| BLAKE2b-256 |
5733d990ca540ce9b9375a4142812f5310f20f5ecffd651e8e98ab2b50fb7b00
|
Provenance
The following attestation bundles were made for mnemix-0.4.0-py3-none-win_amd64.whl:
Publisher:
publish-python.yml on micahcourey/mnemix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mnemix-0.4.0-py3-none-win_amd64.whl -
Subject digest:
856f09fc50cb645e6ba113591cd97a71ac3dcbe4d7eed5b9ec290e412e02c5c3 - Sigstore transparency entry: 1291557189
- Sigstore integration time:
-
Permalink:
micahcourey/mnemix@cf7d25d82f1b617841ff71f1acb4ece7722f7d55 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/micahcourey
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@cf7d25d82f1b617841ff71f1acb4ece7722f7d55 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mnemix-0.4.0-py3-none-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: mnemix-0.4.0-py3-none-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 98.0 MB
- Tags: Python 3, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02f8eea541ae047259b09ba057b60d570bdd9a29e253e7d8d0e316a25731f608
|
|
| MD5 |
2233742d985cc03701a97858e8ec1206
|
|
| BLAKE2b-256 |
31d42f867f7a2b3ad3469803407cbbd9f35c22e2b37b157babd470a1774e06c9
|
Provenance
The following attestation bundles were made for mnemix-0.4.0-py3-none-manylinux_2_35_x86_64.whl:
Publisher:
publish-python.yml on micahcourey/mnemix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mnemix-0.4.0-py3-none-manylinux_2_35_x86_64.whl -
Subject digest:
02f8eea541ae047259b09ba057b60d570bdd9a29e253e7d8d0e316a25731f608 - Sigstore transparency entry: 1291557302
- Sigstore integration time:
-
Permalink:
micahcourey/mnemix@cf7d25d82f1b617841ff71f1acb4ece7722f7d55 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/micahcourey
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@cf7d25d82f1b617841ff71f1acb4ece7722f7d55 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mnemix-0.4.0-py3-none-macosx_10_9_universal2.whl.
File metadata
- Download URL: mnemix-0.4.0-py3-none-macosx_10_9_universal2.whl
- Upload date:
- Size: 89.5 MB
- Tags: Python 3, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
026704d420b9f3a2af614faabfbc1298bd3674df5edddd4e0505b5d7fcb99695
|
|
| MD5 |
b4b0487b5637b44569ae82765fbb5363
|
|
| BLAKE2b-256 |
cf5bd7c17d52385cb30fafbcf748c151c91c25a7321d0e6719b428638730eb52
|
Provenance
The following attestation bundles were made for mnemix-0.4.0-py3-none-macosx_10_9_universal2.whl:
Publisher:
publish-python.yml on micahcourey/mnemix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mnemix-0.4.0-py3-none-macosx_10_9_universal2.whl -
Subject digest:
026704d420b9f3a2af614faabfbc1298bd3674df5edddd4e0505b5d7fcb99695 - Sigstore transparency entry: 1291557061
- Sigstore integration time:
-
Permalink:
micahcourey/mnemix@cf7d25d82f1b617841ff71f1acb4ece7722f7d55 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/micahcourey
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@cf7d25d82f1b617841ff71f1acb4ece7722f7d55 -
Trigger Event:
release
-
Statement type: