Skip to main content

Lunaris — agent memory engine (Python bindings, PyO3 0.26).

Project description

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

Pick a preset or bring your own ONNX model. 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():
    cfg = EmbedderConfig.fastembed(cache_dir="/var/cache/lunaris/fastembed")
    handle = await lunaris.open(
        "moon://127.0.0.1:6380",
        embedder=cfg,
        reranker=RerankerConfig.noop(),   # disable cross-encoder rerank
    )
    # ... ingest / recall as usual

asyncio.run(main())

See docs/sdk/embedder-config.md for the full customization guide — preset fastembed, preset Ollama, BYO ONNX bytes, and BYO ONNX path — 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.

Project details


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

Uploaded CPython 3.11+Windows x86-64

lunaris-0.3.0-cp311-abi3-manylinux_2_28_x86_64.whl (38.9 MB view details)

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

lunaris-0.3.0-cp311-abi3-manylinux_2_28_aarch64.whl (34.9 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ ARM64

lunaris-0.3.0-cp311-abi3-macosx_11_0_arm64.whl (9.4 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

lunaris-0.3.0-cp311-abi3-macosx_10_12_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for lunaris-0.3.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7c801348a2a8ec5c8fc0ba00cbb89fd2bd0f66653969dde40ad35874698a881c
MD5 d07bcbe7cba9c0cffb2f22a5a1dbfb5b
BLAKE2b-256 78516ebcd49e6af19a91f1abf31263d1ae19622cefbf9258da97cfd26b4bfd0e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lunaris-0.3.0-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bcabc82388856c8aa4b9f802c9b2a1a504788e87d4bf8048747ca15aefa3a883
MD5 4b7e14732a90e444831bd157138b56fc
BLAKE2b-256 7718f230d8f4b13aace78a8c19797a04d25fad5bd3268998974e03cad0b22cc1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lunaris-0.3.0-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 14de60beceab105f55f3373f5033e7bbb37419ae52a5a3356b2c03ac5bb0cd8c
MD5 f002c4b9ea28036ce1ec44cf3f4af994
BLAKE2b-256 461613d49075cac9112998357cc4763cadf29bd1ad057ac3811316b10da35177

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lunaris-0.3.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ed21daf790ca93496b88f7a3d0a4415ea9ce76514ce8842986a48449555c07f9
MD5 050711a90647983beb773b94d04dec5a
BLAKE2b-256 a2afcb61273eca82c5cf960ceb8516fedbd31c2acedd5b0644ebaafc966e3a0e

See more details on using hashes here.

File details

Details for the file lunaris-0.3.0-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for lunaris-0.3.0-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3d48d2755059d5f79f2347ff5310b83c8d75de663e016949160269f37c4cc5e7
MD5 9527d990c0ade964d4ed73e88600a285
BLAKE2b-256 5d4d18f99af92dee64f5b911713f9bd716e37d2edbf6321a38f2600b300028bf

See more details on using hashes here.

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