nodus-native-memory-engine
Status: v0.1.0 — published on PyPI.
Rust-accelerated memory scoring, similarity, and traversal for Nodus agents.
Provides native implementations of the hot-path operations from nodus-memory:
cosine similarity, weight scoring, causal chain traversal, and combined ranking.
Installation
pip install nodus-native-memory-engine
After installation, nodus-memory automatically detects and uses the native engine.
Operations
| Function | Description |
|---|---|
cosine_similarity(a, b) |
Single-pair cosine similarity |
batch_cosine_similarity(query, matrix) |
One query vs many embeddings |
compute_weight(impact, usage, success, fail) |
Memory node ranking weight |
batch_compute_weights(nodes) |
Batch weight computation |
argsort_by_weight(nodes) |
Sort indices by weight descending |
traverse_chain(id_to_parent, start, depth) |
Causal chain walk + cycle detection |
would_create_cycle(id_to_parent, child, parent) |
Cycle pre-check |
rank_by_similarity(query, embeddings, ...) |
Top-k by cosine similarity |
rank_blended(nodes, query, sim_weight, top_k) |
Combined weight + similarity ranking |
is_native() |
True if Rust extension is loaded |
All functions have pure-Python fallbacks — the package works even without the compiled extension.
Status
v0.1.0 — published on PyPI.
Pure Python fallback
The native Rust extension is optional. When not installed (or when the Rust
build fails), all operations fall back to pure Python implementations
automatically. Use is_native() to check which path is active:
from nodus_native_memory_engine import is_native
print(is_native()) # True = Rust extension, False = pure Python
The fallback has the same API but is slower on large batches.
Auto-detection by nodus-memory
Once installed, nodus-memory automatically detects and uses the native engine
for hot-path operations. No configuration needed.
Build requirements (Rust extension)
- Rust 1.93.1+
- maturin 1.12.6+
- Python 3.11+
# Install with Rust extension (development)
VIRTUAL_ENV="C:/dev/Coding Language/.venv" maturin develop --release
# Install wheel only (pure Python fallback, no Rust needed)
pip install nodus-native-memory-engine
Development
# Build and install Rust extension for development
maturin develop --release
# Run tests (works with or without Rust extension)
pytest tests/ -q
License
MIT — see LICENSE.
Metadata
Release files for nodus-native-memory-engine 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nodus_native_memory_engine-0.1.1-cp311-cp311-win_amd64.whl | CPython 3.11 | CPython 3.11 | Windows x86-64 | Details |
Release files / nodus_native_memory_engine-0.1.1-cp311-cp311-win_amd64.whl
| Download URL | nodus_native_memory_engine-0.1.1-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 131.1 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
cd1a921c6230bef2f2ef1358184a7513c97cd29869f91cc4987557fb53faffe3
|
|
BLAKE2b-256 checksum How to use checksums |
66e476bf3926a372e2f73ff29a2a72ae17622b12432d9440c9db51fd378c8bf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|