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.7.0-cp311-abi3-win_amd64.whl (5.1 MB view details)

Uploaded CPython 3.11+Windows x86-64

lunaris-0.7.0-cp311-abi3-manylinux_2_28_x86_64.whl (5.1 MB view details)

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

lunaris-0.7.0-cp311-abi3-manylinux_2_28_aarch64.whl (4.8 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ ARM64

lunaris-0.7.0-cp311-abi3-macosx_11_0_arm64.whl (4.6 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

lunaris-0.7.0-cp311-abi3-macosx_10_15_x86_64.whl (4.8 MB view details)

Uploaded CPython 3.11+macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: lunaris-0.7.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 5.1 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.7.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d6a5abb03306b5445d07c5c05e490447eb085aece1a55f0137ca0948972f7425
MD5 e0b5f92cbe9350cd1a96f23856ae2f56
BLAKE2b-256 f9ccfd994af6cf1ef1a4e1ee896e374ca4394bf8e8c34a4d0d60c698c635d81b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lunaris-0.7.0-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 166b37be8fcd0435e42718bb0304e317edfec2ad70e4956426563c70901714aa
MD5 fdbfe5be78274bdb8eb0accfd94fd7de
BLAKE2b-256 f52e72ce21b21bce1c3b837190e4b0988b76c4e47f89d997681775755d4c9faa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lunaris-0.7.0-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c2ec4b1eb01d508d61b94216768406b25caa2b7ad9b021522cd5d66d4038d897
MD5 93b0868930e713c95028da988ad65db6
BLAKE2b-256 6cbf4e26610e09dfb950e0c0997fb32dac860ac91024df89c849d31453e3a1dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lunaris-0.7.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 16cc7d5e973fd6a2cded8aea77ba6670623c73a9514ff5873433debe2fa54b48
MD5 77b91c1529588579d33b613ab4d84380
BLAKE2b-256 3ef7fd8eb436a668fec4d88a1e8f78f7de8cf3d05d561c3ecc2428d2f16a1f24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lunaris-0.7.0-cp311-abi3-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 a239ed571fcd99083ef1999f8d3649458f9f693a8cac8563bcdc31bb59838565
MD5 620d5b445202c244fa0b282332771ddb
BLAKE2b-256 46c12ec3b61dc39ad931e6e680956bbfc13b379d0653c71aae767c7252dbe760

See more details on using hashes here.

Release history Release notifications | RSS feed

0.8.0

5 files

0.7.1

5 files

This release

0.7.0 This release

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