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.

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

lunaris-0.8.0-cp311-abi3-win_amd64.whl (5.2 MB view details)

Uploaded CPython 3.11+Windows x86-64

lunaris-0.8.0-cp311-abi3-manylinux_2_28_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ x86-64

lunaris-0.8.0-cp311-abi3-manylinux_2_28_aarch64.whl (4.9 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ ARM64

lunaris-0.8.0-cp311-abi3-macosx_11_0_arm64.whl (4.7 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

lunaris-0.8.0-cp311-abi3-macosx_10_15_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.11+macOS 10.15+ x86-64

File details

Details for the file lunaris-0.8.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: lunaris-0.8.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 5.2 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.15.0

File hashes

Hashes for lunaris-0.8.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 db649bd9d465a11345d6baaafc2cbca287cc095443b69a092b22683a1e1ff79c
MD5 b7a56b1bc39bdf5130705ba9b1604f11
BLAKE2b-256 5b6995253b8b207a9f6a7c4a74fba985ca792b1f222c043c72bd3a92484ac6fb

See more details on using hashes here.

File details

Details for the file lunaris-0.8.0-cp311-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lunaris-0.8.0-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2e01063f696085c2a28703d4df0354e78dfbe75b4e0206c2c163c7e4f8614866
MD5 15d3b2fa60c2571630df40ba96b5c0f6
BLAKE2b-256 3b85e3debb8fb52c632244852532a433d81923d70d9869fc5c2fc37438e29e29

See more details on using hashes here.

File details

Details for the file lunaris-0.8.0-cp311-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for lunaris-0.8.0-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5c846e55c8f49ac84f8b0926f7f91cc05dfa9cd864658259ee1176323baad4e0
MD5 b85cf85311a0f8c809925565b2d056c7
BLAKE2b-256 a3b134570e81158c8932fa3c31034d18dd0509e382f3c21b5d5069bf35b2a5b1

See more details on using hashes here.

File details

Details for the file lunaris-0.8.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lunaris-0.8.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 68257656589bf29e77d2a7ade6bc6fe675cc10000f62a3f0f4771e16c1b38da0
MD5 8b562e270c5bd2b6931b3c454a6ff22d
BLAKE2b-256 183a98acea6538e55b0dcf639c7c2dc5068aa35b04ed4c942402876a1cb0ccf5

See more details on using hashes here.

File details

Details for the file lunaris-0.8.0-cp311-abi3-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for lunaris-0.8.0-cp311-abi3-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 8a32e364a2406e9a06e6cffc75ba6b08d82ba4beb3c3cf6d7c896bce79fd4218
MD5 aef38966e77e44066d5170038429d558
BLAKE2b-256 d2c51e865441a4cce0ce0cc61b70c26566378765c6d54ec1d68a7fb7a67ab8b3

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.8.0 This release

5 files

0.7.1

5 files

0.7.0

5 files

0.6.2

5 files

0.5.0

5 files

0.3.0

5 files

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