Skip to content

Commit 8b9744b

Browse files
committed
Create mnemos-py crate with initial Python bindings and build artifacts
1 parent a763106 commit 8b9744b

11 files changed

Lines changed: 749 additions & 35 deletions

File tree

.github/workflows/rust.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,19 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v4
19-
- name: Build
19+
- name: Build Workspace
2020
run: cargo build --workspace --verbose
21-
- name: Run tests
21+
- name: Run Core Tests
2222
run: cargo test --workspace --verbose
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: '3.11'
27+
- name: Install Maturin
28+
run: pip install maturin
29+
- name: Test Python Bindings
30+
run: |
31+
cd crates/mnemos-py
32+
maturin develop --release
33+
python3 test_smoke.py
34+
python3 test_stress.py

Cargo.lock

Lines changed: 107 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[workspace]
2-
members = ["crates/mnemos-core"]
2+
members = [
3+
"crates/mnemos-core",
4+
"crates/mnemos-py",
5+
]
36
resolver = "2"

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,23 @@ Mnemos is designed specifically for that shape of problem.
4040

4141
## Quickstart
4242

43+
### Rust (Embedded Core)
4344
```bash
4445
git clone https://github.com/anaslimem/Mnemos.git
4546
cd Mnemos
4647
cargo run -p mnemos-core --bin manual_store
4748
```
4849

50+
### Python (Native Bindings)
51+
```python
52+
from mnemos import Mnemos
53+
54+
with Mnemos.open("agent.mem", dimension=128) as db:
55+
mid = db.remember_embedding([0.1] * 128)
56+
hits = db.ask_embedding([0.1] * 128, top_k=5)
57+
print(f"Top hit score: {hits[0].score:.3f}")
58+
```
59+
4960
This runs a local demo that inserts memories, creates edges, queries, and prints scored results.
5061

5162
## Project Layout
@@ -82,6 +93,11 @@ crates/
8293
startup_bench.rs # Startup time benchmark
8394
monkey_writer.rs # Crash-safety stress writer
8495
monkey_verify.rs # Recovery verification
96+
mnemos-py/
97+
src/
98+
lib.rs # PyO3 Native bindings
99+
test_smoke.py # Python SDK smoke tests
100+
test_stress.py # Python SDK stress tests
85101
```
86102

87103
## Architecture Overview
@@ -236,13 +252,14 @@ Mnemos is usable today for:
236252
- single-node agent memory storage/retrieval,
237253
- deterministic recovery and replay,
238254
- embedded use via the `Mnemos` facade API,
239-
- checkpoint + WAL truncation for fast startup (< 100ms).
255+
- checkpoint + WAL truncation for fast startup (< 100ms),
256+
- **native Python integration** via PyO3 bindings (`mnemos-py`).
240257

241258
Areas under active development (see [Roadmap](ROADMAP.md)):
242259

243-
- PyO3 native Python bindings (`pip install mnemos`),
244260
- multi-agent namespace model,
245-
- deterministic replay export/import.
261+
- deterministic replay export/import,
262+
- built-in chunking/embedding pipeline.
246263

247264
## Documentation
248265

0 commit comments

Comments
 (0)