Skip to main content

MahaBodi (Python)

MahaBodi is a System-1 engine for AI agents, written in Rust. It combines a fastmemory-style topology memory (ingest, a density guard, a query cascade that always returns an answer or a handoff, and hybrid retrieval) with fast typed decisions from Laya models, run through ONNX Runtime.

pip install mahabodi            # memory only
pip install "mahabodi[laya]"    # also installs onnxruntime, for Laya decisions
from mahabodi import Bodi

b = Bodi()
b.ingest(open("kb.md").read(), source="kb")
r = b.query("refund policy")        # r["matched"], r["handoff"], r["stage"], r["hits"]

# Decisions need a Laya model exported to ONNX (see "Models" below)
b.load_laya("models/laya-v2")
b.decide("I was charged twice", {"refund": {"type": "noul", "instructions": "Asks for a refund?"}})

# Learn from labelled cases without retraining (needs the MiniLM embedder export)
b.load_embedder("models/minilm")
b.learn(states, questions, labels)

Every method returns plain dicts and lists; errors raise ValueError.

Models

MahaBodi does not ship model weights. To export Laya's checkpoint and the MiniLM embedder to ONNX, use research/export_onnx.py and research/export_embedder.py in the repository. ONNX Runtime is found through ORT_DYLIB_PATH, or automatically from the onnxruntime package installed in the same Python.

Results

Every claim is measured against Laya on the same machine for each comparison, with seeded samples and exact McNemar tests, and losses are reported as losses. On zero-shot Laya benchmarks MahaBodi wins on many-option and multilingual intent and ties elsewhere (same maths). It loses to a Laya head fine-tuned on SST-5 and to a fully fine-tuned Laya on emotion. See BENCHMARKS.md for all results and caveats.

Status: alpha (0.x). MIT license. Third-party notices are in the repository.

Metadata

Release files for mahabodi 0.1.2

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 mahabodi 0.1.2
File Interpreter ABI Platform
mahabodi-0.1.2-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details
mahabodi-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 4.7 MB

Release files / mahabodi-0.1.2-cp39-abi3-manylinux_2_28_x86_64.whl

Download URL mahabodi-0.1.2-cp39-abi3-manylinux_2_28_x86_64.whl
Size 2.3 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
3762527f6dc2230f807b6650f406521a7d9b954d4d6df6574728821b420a32de
BLAKE2b-256 checksum
How to use checksums
76dcde44a9812f78a203ad1e0de83248086ba817b11767fd5c74195caff3af22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / mahabodi-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl

Download URL mahabodi-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl
Size 2.4 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
3a36c5af176562dbf073985d9d4a7b89fc3950d70cdb0a1eb4f6ce2e5a3b4301
BLAKE2b-256 checksum
How to use checksums
2a00688ccd640bd4a7a2c0897a7e0300c47a871c5962a69a53b520ac1e402dc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.0

3 release 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