PyO3 extension exposing the MagGraph Rust core to Python agents.
From the repository root:
pip install maturin pytest pytest-asyncio
maturin develop --manifest-path maggraph/Cargo.toml --features python-ext -m pythonOr from this directory:
cd python
maturin develop --features python
pytestimport maggraph
config = maggraph.load_config("examples/basic/maggraph.toml")
index = config.open_index()
print(index.list_nodes())
node = index.read_node("welcome")
result = index.traverse("welcome", depth=2, order="bfs")
print(result.to_markdown(index))See examples/python_agent.py for sync and asyncio usage.
Async methods (read_node_async, traverse_async) use pyo3-async-runtimes with Python's asyncio loop. Blocking Rust work runs on a Tokio thread pool so the event loop stays responsive.
See planning/PYTHON.md for API details and CI wheel builds.