Skip to main content

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 mnemix binary automatically
  • On unsupported platforms or source installs, install the CLI separately via cargo install --path crates/mnemix-cli or set MNEMIX_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

mnemix-0.3.0.tar.gz (20.2 kB view details)

Uploaded Source

Built Distributions

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

mnemix-0.3.0-py3-none-win_amd64.whl (93.4 MB view details)

Uploaded Python 3Windows x86-64

mnemix-0.3.0-py3-none-manylinux_2_35_x86_64.whl (97.3 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

mnemix-0.3.0-py3-none-macosx_10_9_universal2.whl (88.9 MB view details)

Uploaded Python 3macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file mnemix-0.3.0.tar.gz.

File metadata

  • Download URL: mnemix-0.3.0.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mnemix-0.3.0.tar.gz
Algorithm Hash digest
SHA256 2c0085fbe1c87302ef4f9bbe39e8e68ccb97acdc6373d0880788807fa18763a9
MD5 e1dd8646c4a07f7db77bcf368f5d54e5
BLAKE2b-256 3eaf22f6a280637aa14cc2cfe2e18c603a5b07c92eb121166c9b1cdb36abf8fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for mnemix-0.3.0.tar.gz:

Publisher: publish-python.yml on micahcourey/mnemix

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

File details

Details for the file mnemix-0.3.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: mnemix-0.3.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 93.4 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mnemix-0.3.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d5245c1e4ad7d1799f771204b5b08a3a49ccf2f1c7df7d6be4af3ab09574f96d
MD5 a1be02372c47af03f59096fd1c9a46ca
BLAKE2b-256 b1ff07cdc7681903a432a976c61e8eb42f5dcf2b27f2aa28c8207ceff3cfdcd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for mnemix-0.3.0-py3-none-win_amd64.whl:

Publisher: publish-python.yml on micahcourey/mnemix

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

File details

Details for the file mnemix-0.3.0-py3-none-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for mnemix-0.3.0-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 1ca2746aeb9715673a534a7c347367cb66b7c9e68ec31442629a6c0f47b1fb51
MD5 5b9e7fc7092b048c9b1a84dc0aa98832
BLAKE2b-256 18bf88c608e8771fe03742a9707a83bb305e9baf284de9b2829710980ab2c6e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for mnemix-0.3.0-py3-none-manylinux_2_35_x86_64.whl:

Publisher: publish-python.yml on micahcourey/mnemix

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

File details

Details for the file mnemix-0.3.0-py3-none-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for mnemix-0.3.0-py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 dfe707a9237be52a81a3ec93df4d22fab64e692d32b9c5a72f8d31073c274c6f
MD5 862c851c3e9f7e3901508e88e6d8c5da
BLAKE2b-256 b2568acd942a16f397fcb699afdebf082fba1ce53d6cdd43168e60a26f5e702f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mnemix-0.3.0-py3-none-macosx_10_9_universal2.whl:

Publisher: publish-python.yml on micahcourey/mnemix

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