Skip to main content

lunaris

PyO3 0.26 Python bindings for the Lunaris agent memory engine.

Installation

From source (development):

cd crates/lunaris-py
uv venv --python 3.11 .venv
source .venv/bin/activate
uv pip install maturin
maturin develop --release

A PyPI wheel will ship with the v0.1.1 release via the Plan 08-04 multi-platform prebuild matrix.

For the full user-facing install + quickstart guide covering both Python and TypeScript, see docs/bindings.md.

Requirements

  • Python 3.11+ (abi3 stable ABI — one wheel covers 3.11, 3.12, 3.13)
  • A Moon backend reachable from the process. moon:// is the only supported URL scheme — postgres:// and sqlite:// were removed in 0.7.0 and now return UnsupportedScheme. See docs/migration/0.6-to-0.7.md.

Example

import asyncio
import lunaris

async def main():
    handle = await lunaris.open("moon://127.0.0.1:6380")
    lsn = await handle.ingest({
        "id": "01JABCDEFGHJKMNPQRSTVWXYZ0",
        "scope": "_dev_",
        "source": "py-example",
        "content": "Lunaris bi-temporal hello.",
        "metadata": {},
        "t_ref": None,
        "bt": {"valid": [{"wall_ms": 0, "counter": 0, "node_id": 0}, None],
               "sys":   [{"wall_ms": 0, "counter": 0, "node_id": 0}, None]},
    })
    print("ingested at", lsn)

    hits = await handle.recall().query("bi-temporal hello").top(5).execute()
    for h in hits:
        print(h)

asyncio.run(main())

Custom embedder + reranker

The default embedder is granite-embedding-311m-multilingual-r2 (768-d), served from a Q4_K_M GGUF in-process via llama.cpp — no Ollama, no external service required. Stage the GGUF at ~/.lunaris/models/ (the MCP server does this lazily; other deployments download out-of-band). An air-gapped Ollama HTTP embedder remains available as an operator escape hatch behind --features embed-remote.

The EmbedderConfig and RerankerConfig factories swap the backend at handle-construction time; the env-driven default remains in place for callers that don't pass one.

import asyncio
import lunaris
from lunaris import EmbedderConfig, RerankerConfig

async def main():
    mem = await lunaris.open(
        "moon://127.0.0.1:6380",
        embedder=EmbedderConfig.llamacpp(),   # granite-r2 Q4_K_M GGUF, in-process llama.cpp
        reranker=RerankerConfig.llamacpp(),   # bge-reranker-v2-m3 Q5_K_M GGUF cross-encoder
    )
    # ... ingest / recall as usual

asyncio.run(main())

See docs/sdk/embedder-config.md for the full customization guide — in-process llama.cpp, noop, and the operator Ollama escape hatch — with troubleshooting and the FFI-cliff limits.

Surface parity

The Python class / method surface is generated from crates/lunaris-codegen/annotations/surface.toml (Plan 08-01). The parity-check CI job fails any PR that drifts the committed snapshot from the regenerated output — pip install lunaris never lags the Rust crate.

Three-surface pipeline toggles

The GraphPipeline and ConsolidatorPipeline default to OFF (blueprint §5.1 / §5.2). Flip them at any of three surfaces:

Surface Example
Code handle.graph_pipeline.enable()
Env LUNARIS_GRAPH_ENABLED=1 python run.py
Config await lunaris.open(url, config={"graph_pipeline": {"enabled": True}})

Resolution order: code > env > config — code is always authoritative.

Metadata

Release files for lunaris 0.8.0

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

Built distributions (wheels)

Table of built distributions (wheels) for lunaris 0.8.0
File Actions
lunaris-0.8.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for lunaris-0.8.0-cp311-abi3-win_amd64.whl
lunaris-0.8.0-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details for lunaris-0.8.0-cp311-abi3-manylinux_2_28_x86_64.whl
lunaris-0.8.0-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details for lunaris-0.8.0-cp311-abi3-manylinux_2_28_aarch64.whl
lunaris-0.8.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for lunaris-0.8.0-cp311-abi3-macosx_11_0_arm64.whl
lunaris-0.8.0-cp311-abi3-macosx_10_15_x86_64.whl CPython 3.11 abi3 macOS 10.15+ x86-64 Details for lunaris-0.8.0-cp311-abi3-macosx_10_15_x86_64.whl

Total release size: 25.1 MB

Release files / lunaris-0.8.0-cp311-abi3-win_amd64.whl

Download URL lunaris-0.8.0-cp311-abi3-win_amd64.whl
Size 5.2 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
db649bd9d465a11345d6baaafc2cbca287cc095443b69a092b22683a1e1ff79c
BLAKE2b-256 checksum
How to use checksums
5b6995253b8b207a9f6a7c4a74fba985ca792b1f222c043c72bd3a92484ac6fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / lunaris-0.8.0-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL lunaris-0.8.0-cp311-abi3-manylinux_2_28_x86_64.whl
Size 5.3 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
2e01063f696085c2a28703d4df0354e78dfbe75b4e0206c2c163c7e4f8614866
BLAKE2b-256 checksum
How to use checksums
3b85e3debb8fb52c632244852532a433d81923d70d9869fc5c2fc37438e29e29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / lunaris-0.8.0-cp311-abi3-manylinux_2_28_aarch64.whl

Download URL lunaris-0.8.0-cp311-abi3-manylinux_2_28_aarch64.whl
Size 4.9 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
5c846e55c8f49ac84f8b0926f7f91cc05dfa9cd864658259ee1176323baad4e0
BLAKE2b-256 checksum
How to use checksums
a3b134570e81158c8932fa3c31034d18dd0509e382f3c21b5d5069bf35b2a5b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / lunaris-0.8.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL lunaris-0.8.0-cp311-abi3-macosx_11_0_arm64.whl
Size 4.7 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
68257656589bf29e77d2a7ade6bc6fe675cc10000f62a3f0f4771e16c1b38da0
BLAKE2b-256 checksum
How to use checksums
183a98acea6538e55b0dcf639c7c2dc5068aa35b04ed4c942402876a1cb0ccf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / lunaris-0.8.0-cp311-abi3-macosx_10_15_x86_64.whl

Download URL lunaris-0.8.0-cp311-abi3-macosx_10_15_x86_64.whl
Size 4.9 MB
Tags CPython 3.11 abi3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
8a32e364a2406e9a06e6cffc75ba6b08d82ba4beb3c3cf6d7c896bce79fd4218
BLAKE2b-256 checksum
How to use checksums
d2c51e865441a4cce0ce0cc61b70c26566378765c6d54ec1d68a7fb7a67ab8b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Security for lunaris 0.8.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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