Skip to main content

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.

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 Distribution

If you're not sure about the file name format, learn more about wheel file names.

nodus_native_memory_engine-0.1.1-cp311-cp311-win_amd64.whl (131.1 kB view details)

Uploaded CPython 3.11Windows x86-64

File details

Details for the file nodus_native_memory_engine-0.1.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for nodus_native_memory_engine-0.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 cd1a921c6230bef2f2ef1358184a7513c97cd29869f91cc4987557fb53faffe3
MD5 8e8834f6e46a0aa8578291c73a07d2d4
BLAKE2b-256 66e476bf3926a372e2f73ff29a2a72ae17622b12432d9440c9db51fd378c8bf5

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 file

0.1.0

1 file

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