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 or Postgres backend reachable from the process; moon:// and postgres:// URL schemes are supported.

Example

import asyncio
import lunaris

async def main():
    handle = await lunaris.open("moon://127.0.0.1:6380")
    lsn = await handle.ingest({
        "id": "01JABCDEFGHJKMNPQRSTVWXYZ0",
        "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().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.6.2-cp311-abi3-win_amd64.whl (7.8 MB view details)

Uploaded CPython 3.11+Windows x86-64

lunaris-0.6.2-cp311-abi3-manylinux_2_28_x86_64.whl (7.9 MB view details)

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

lunaris-0.6.2-cp311-abi3-manylinux_2_28_aarch64.whl (7.5 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ ARM64

lunaris-0.6.2-cp311-abi3-macosx_11_0_arm64.whl (7.0 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

lunaris-0.6.2-cp311-abi3-macosx_10_15_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.11+macOS 10.15+ x86-64

File details

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

File metadata

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

File hashes

Hashes for lunaris-0.6.2-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7007404d6b128f5b95924851339e85532306b5cf0c0a9b48a5e1879ae578d637
MD5 42bbed351859652e41d95ef9a7bc1336
BLAKE2b-256 16dff685d3c1aa6b03f9d84fd771aa6791512b42cc2ef06a8e135b07473b9e0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lunaris-0.6.2-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 18d16a014d3fa1e31dcf1ba4c418516c9e254659d97482b3734a535c5fd16a80
MD5 c2357ef828d1909698a52eaf5cb5cdee
BLAKE2b-256 17db853ab8e2580579289abcf6c3ca0f5b3213307e7b39d942ea7a6187aec6cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lunaris-0.6.2-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 586cd68dc4fdb76f810fbd13e508f94a89079b8d77452d9d1feb82de5afabbda
MD5 c5bcf3312d4debbf4c8a8e29f5f3bca3
BLAKE2b-256 88dc551ddea19a77ef4bcb5e8785c3c3866bb48e612b4e9a7115211aef0de2a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lunaris-0.6.2-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cbd22789cf0e8230726cef8416d8574206c385861ac1de05cd1d7f3c939ff51b
MD5 04d1c435c1b6701d2964b0ac508cb911
BLAKE2b-256 1949e5528c66019fe58436d0cabc6c7e985af3104c45e56b8cbd2eb34c18e5e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lunaris-0.6.2-cp311-abi3-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 cd53416fa7218664d20d17295bef3edde6912c70a10ac548cb4f299723f881f0
MD5 fb0c7ad6a824498519e1a237258c8912
BLAKE2b-256 7bc4bbf931994d1a83fdfff7ec30738e4713a81fe96f45a732ddfbc5294e60fe

See more details on using hashes here.

Release history Release notifications | RSS feed

0.8.0

5 files

0.7.1

5 files

0.7.0

5 files

This release

0.6.2 This release

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