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.

Release files for mahabodi 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mahabodi 0.1.0
File Size Uploaded
mahabodi-0.1.0.tar.gz 2.4 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for mahabodi 0.1.0
File Interpreter ABI Platform
mahabodi-0.1.0-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details
mahabodi-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 7.0 MB

Release files / mahabodi-0.1.0.tar.gz

Download URL mahabodi-0.1.0.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
bbb4a62c5278e5540c665ebef7d5a44cf64beb257cb4478ced29963643ff7a6b
BLAKE2b-256 checksum
How to use checksums
f4fced346aa7fae76ae9d9e7376697d7103031663bcf4394cafba08db93a0f81
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.0-cp39-abi3-manylinux_2_28_x86_64.whl

Download URL mahabodi-0.1.0-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
71f421c40638ee484a614791d738bde653672e514aa3db8c158e503cc7ebf1ca
BLAKE2b-256 checksum
How to use checksums
510ec713d29bdaa42d235a82c913032c44083bcb5bda14a66db62a2773fd2f51
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.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL mahabodi-0.1.0-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
d83e6d94f3d868ad937f1584a38873f2caa953960a968ebd6323d644e523c299
BLAKE2b-256 checksum
How to use checksums
ecf03c6ad57b026711eaf9e638d4851c0ac48830b123eb134955a4b98284fbce
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.0 This release

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