mnemo-engine 0.6.0__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/PKG-INFO +15 -9
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/README.md +14 -8
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/Cargo.lock +2 -2
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/Cargo.toml +20 -6
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/README.md +48 -11
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/benches/cache.rs +1 -1
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/benches/corpus.rs +1 -1
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/benches/embed_overhead.rs +1 -1
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/benches/open.rs +1 -1
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/benches/recall.rs +1 -1
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/benches/write.rs +1 -1
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/examples/ann_defaults_v0_6_0.rs +1 -1
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/examples/ann_diagnose.rs +1 -1
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/examples/ann_recall_grid.rs +1 -1
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/examples/ann_recall_grid_v2.rs +1 -1
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/examples/file_size_breakdown.rs +1 -1
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/examples/quickstart.rs +1 -1
- mnemo_engine-0.7.0/mnemo/examples/ranking_v2.rs +483 -0
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/examples/session.rs +2 -2
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/src/bin/mnemo.rs +119 -45
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/src/lib.rs +2 -2
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/src/mcp.rs +27 -4
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/src/memory.rs +60 -13
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/src/session.rs +1 -1
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/src/store.rs +11 -5
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/tests/cli_smoke.rs +297 -7
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/tests/dur1_torn_header.rs +7 -7
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/tests/fix1_correctness_sweep.rs +3 -1
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/tests/integration.rs +22 -22
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/tests/proptest_store.rs +7 -7
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/tests/sec1_nonce_uniqueness.rs +2 -2
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo-python/Cargo.lock +2 -2
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo-python/Cargo.toml +8 -3
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo-python/README.md +14 -8
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo-python/src/lib.rs +30 -2
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo-python/test_mnemo.py +85 -1
- mnemo_engine-0.7.0/pyproject.toml +45 -0
- mnemo_engine-0.7.0/python/mnemo_engine/__init__.py +23 -0
- mnemo_engine-0.6.0/pyproject.toml +0 -32
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/.gitignore +0 -0
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/deny.toml +0 -0
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/examples/embedder_server.py +0 -0
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/src/cache.rs +0 -0
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/src/crypto.rs +0 -0
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/src/embed.rs +0 -0
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/src/embed_cmd.rs +0 -0
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/src/error.rs +0 -0
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/src/format.rs +0 -0
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/src/index.rs +0 -0
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/src/pager.rs +0 -0
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/src/result_cache.rs +0 -0
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/src/wal.rs +0 -0
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo/tests/proptest_store.proptest-regressions +0 -0
- {mnemo_engine-0.6.0 → mnemo_engine-0.7.0}/mnemo-python/.gitignore +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mnemo-engine
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: 3
|
|
6
6
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
@@ -24,10 +24,16 @@ sibling `mnemo/` crate — the storage engine, AES-256-GCM encryption, the
|
|
|
24
24
|
write-ahead log, the IVF+PQ index, snapshots, and the agent-memory model all
|
|
25
25
|
run as compiled Rust; Python only sees a small, ergonomic surface.
|
|
26
26
|
|
|
27
|
-
> Distribution name on PyPI: `mnemo-engine` (both `mnemo` and
|
|
28
|
-
> were already taken by unrelated projects). The import
|
|
29
|
-
>
|
|
30
|
-
>
|
|
27
|
+
> Distribution name on PyPI: `mnemo-engine` (both `mnemo` and
|
|
28
|
+
> `mnemo-db` were already taken by unrelated projects). The import
|
|
29
|
+
> name is **`mnemo_engine`** starting in v0.7.0, so the full setup is
|
|
30
|
+
> `pip install mnemo-engine` then `import mnemo_engine`. The
|
|
31
|
+
> pre-v0.7.0 `import mnemo` keeps working for the v0.7.x series via a
|
|
32
|
+
> pure-Python shim that emits one `DeprecationWarning` on import; the
|
|
33
|
+
> shim is removed in v0.8.0. Code that wants to keep its call sites
|
|
34
|
+
> unchanged can `import mnemo_engine as mnemo` — same objects, no
|
|
35
|
+
> warning. See the "Breaking: import name" section in the CHANGELOG
|
|
36
|
+
> for the full migration.
|
|
31
37
|
|
|
32
38
|
## For AI agents
|
|
33
39
|
|
|
@@ -35,7 +41,7 @@ An agent that's been handed a `.mnemo` file and its passphrase can become
|
|
|
35
41
|
productive in two calls — no external documentation required:
|
|
36
42
|
|
|
37
43
|
```python
|
|
38
|
-
import mnemo, os
|
|
44
|
+
import mnemo_engine as mnemo, os
|
|
39
45
|
|
|
40
46
|
db = mnemo.open("agent.mnemo", os.environ["MNEMO_PASSPHRASE"])
|
|
41
47
|
|
|
@@ -95,7 +101,7 @@ single wheel works on CPython 3.8 and newer.
|
|
|
95
101
|
## Usage
|
|
96
102
|
|
|
97
103
|
```python
|
|
98
|
-
import mnemo
|
|
104
|
+
import mnemo_engine as mnemo
|
|
99
105
|
|
|
100
106
|
# Open an existing database, or create one (dimensions required to create).
|
|
101
107
|
db = mnemo.open("agent.mnemo", "passphrase", dimensions=4)
|
|
@@ -221,7 +227,7 @@ switches to semantic mode; otherwise it's an exact-key cache.
|
|
|
221
227
|
"""@db.cached — pure-Python helper on top of mnemo.Mnemo's cache API.
|
|
222
228
|
|
|
223
229
|
Usage:
|
|
224
|
-
import mnemo, json, os
|
|
230
|
+
import mnemo_engine as mnemo, json, os
|
|
225
231
|
from mnemo_cached import cached
|
|
226
232
|
|
|
227
233
|
db = mnemo.open("agent.mnemo", os.environ["MNEMO_PASSPHRASE"])
|
|
@@ -402,7 +408,7 @@ pass vectors by hand. Register once at open time; every subsequent
|
|
|
402
408
|
the handle uses it.
|
|
403
409
|
|
|
404
410
|
```python
|
|
405
|
-
import mnemo
|
|
411
|
+
import mnemo_engine as mnemo
|
|
406
412
|
from sentence_transformers import SentenceTransformer
|
|
407
413
|
|
|
408
414
|
model = SentenceTransformer("all-MiniLM-L6-v2") # 384-dim, normalized
|
|
@@ -10,10 +10,16 @@ sibling `mnemo/` crate — the storage engine, AES-256-GCM encryption, the
|
|
|
10
10
|
write-ahead log, the IVF+PQ index, snapshots, and the agent-memory model all
|
|
11
11
|
run as compiled Rust; Python only sees a small, ergonomic surface.
|
|
12
12
|
|
|
13
|
-
> Distribution name on PyPI: `mnemo-engine` (both `mnemo` and
|
|
14
|
-
> were already taken by unrelated projects). The import
|
|
15
|
-
>
|
|
16
|
-
>
|
|
13
|
+
> Distribution name on PyPI: `mnemo-engine` (both `mnemo` and
|
|
14
|
+
> `mnemo-db` were already taken by unrelated projects). The import
|
|
15
|
+
> name is **`mnemo_engine`** starting in v0.7.0, so the full setup is
|
|
16
|
+
> `pip install mnemo-engine` then `import mnemo_engine`. The
|
|
17
|
+
> pre-v0.7.0 `import mnemo` keeps working for the v0.7.x series via a
|
|
18
|
+
> pure-Python shim that emits one `DeprecationWarning` on import; the
|
|
19
|
+
> shim is removed in v0.8.0. Code that wants to keep its call sites
|
|
20
|
+
> unchanged can `import mnemo_engine as mnemo` — same objects, no
|
|
21
|
+
> warning. See the "Breaking: import name" section in the CHANGELOG
|
|
22
|
+
> for the full migration.
|
|
17
23
|
|
|
18
24
|
## For AI agents
|
|
19
25
|
|
|
@@ -21,7 +27,7 @@ An agent that's been handed a `.mnemo` file and its passphrase can become
|
|
|
21
27
|
productive in two calls — no external documentation required:
|
|
22
28
|
|
|
23
29
|
```python
|
|
24
|
-
import mnemo, os
|
|
30
|
+
import mnemo_engine as mnemo, os
|
|
25
31
|
|
|
26
32
|
db = mnemo.open("agent.mnemo", os.environ["MNEMO_PASSPHRASE"])
|
|
27
33
|
|
|
@@ -81,7 +87,7 @@ single wheel works on CPython 3.8 and newer.
|
|
|
81
87
|
## Usage
|
|
82
88
|
|
|
83
89
|
```python
|
|
84
|
-
import mnemo
|
|
90
|
+
import mnemo_engine as mnemo
|
|
85
91
|
|
|
86
92
|
# Open an existing database, or create one (dimensions required to create).
|
|
87
93
|
db = mnemo.open("agent.mnemo", "passphrase", dimensions=4)
|
|
@@ -207,7 +213,7 @@ switches to semantic mode; otherwise it's an exact-key cache.
|
|
|
207
213
|
"""@db.cached — pure-Python helper on top of mnemo.Mnemo's cache API.
|
|
208
214
|
|
|
209
215
|
Usage:
|
|
210
|
-
import mnemo, json, os
|
|
216
|
+
import mnemo_engine as mnemo, json, os
|
|
211
217
|
from mnemo_cached import cached
|
|
212
218
|
|
|
213
219
|
db = mnemo.open("agent.mnemo", os.environ["MNEMO_PASSPHRASE"])
|
|
@@ -388,7 +394,7 @@ pass vectors by hand. Register once at open time; every subsequent
|
|
|
388
394
|
the handle uses it.
|
|
389
395
|
|
|
390
396
|
```python
|
|
391
|
-
import mnemo
|
|
397
|
+
import mnemo_engine as mnemo
|
|
392
398
|
from sentence_transformers import SentenceTransformer
|
|
393
399
|
|
|
394
400
|
model = SentenceTransformer("all-MiniLM-L6-v2") # 384-dim, normalized
|
|
@@ -610,7 +610,7 @@ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
|
610
610
|
|
|
611
611
|
[[package]]
|
|
612
612
|
name = "mnemo-engine"
|
|
613
|
-
version = "0.
|
|
613
|
+
version = "0.7.0"
|
|
614
614
|
dependencies = [
|
|
615
615
|
"aes-gcm",
|
|
616
616
|
"argon2",
|
|
@@ -634,7 +634,7 @@ dependencies = [
|
|
|
634
634
|
|
|
635
635
|
[[package]]
|
|
636
636
|
name = "mnemo-node"
|
|
637
|
-
version = "0.
|
|
637
|
+
version = "0.7.0"
|
|
638
638
|
dependencies = [
|
|
639
639
|
"mnemo-engine",
|
|
640
640
|
"napi",
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
# Distribution name on crates.io is `mnemo-engine`. The bare `mnemo` name
|
|
3
3
|
# is held by an unrelated crate, and `mnemo-db` is held by a different
|
|
4
4
|
# (MCP-native, DuckDB-backed) agent-memory project — see the v0.3.2 entry
|
|
5
|
-
# in CHANGELOG.md for the full rationale. The library
|
|
6
|
-
#
|
|
7
|
-
#
|
|
5
|
+
# in CHANGELOG.md for the full rationale. The library name becomes
|
|
6
|
+
# `mnemo_engine` (Cargo's default from the package name) starting in
|
|
7
|
+
# v0.7.0 per PR NAME-1; consumers write `use mnemo_engine::...`, or
|
|
8
|
+
# keep `use mnemo::...` via a dependency rename:
|
|
9
|
+
# mnemo = { package = "mnemo-engine", version = "0.7" }
|
|
10
|
+
# The CLI binary name stays `mnemo`, so users still invoke `mnemo` on
|
|
11
|
+
# the command line after `cargo install mnemo-engine`.
|
|
8
12
|
name = "mnemo-engine"
|
|
9
|
-
version = "0.
|
|
13
|
+
version = "0.7.0"
|
|
10
14
|
edition = "2021"
|
|
11
15
|
rust-version = "1.75"
|
|
12
16
|
# `benches/corpus.rs` is a shared helper module pulled into real benches
|
|
@@ -38,10 +42,20 @@ categories = ["database", "cryptography", "command-line-utilities"]
|
|
|
38
42
|
members = ["bindings/node"]
|
|
39
43
|
default-members = ["."]
|
|
40
44
|
|
|
45
|
+
# NAME-1 (2026-11-05 Planner DECISION): the library/import name is now
|
|
46
|
+
# `mnemo_engine` — Cargo's default from the `mnemo-engine` package name
|
|
47
|
+
# (dashes become underscores). The pre-NAME-1 `[lib] name = "mnemo"`
|
|
48
|
+
# override is gone because it collided with crates.io's standalone
|
|
49
|
+
# `mnemo` crate (a terminal knowledge vault) and with PyPI's
|
|
50
|
+
# `mnemo-db` / `mnemo` top-level `mnemo/` modules. The distribution
|
|
51
|
+
# name (`mnemo-engine` on both PyPI and crates.io) is unchanged.
|
|
52
|
+
# Downstream crates write `use mnemo_engine::X`, or keep `use mnemo::X`
|
|
53
|
+
# via a Cargo dep rename: `mnemo = { package = "mnemo-engine" }`.
|
|
41
54
|
[lib]
|
|
42
|
-
name = "mnemo"
|
|
43
55
|
path = "src/lib.rs"
|
|
44
56
|
|
|
57
|
+
# The CLI binary name stays `mnemo` — the executable users type at the
|
|
58
|
+
# shell is unchanged.
|
|
45
59
|
[[bin]]
|
|
46
60
|
name = "mnemo"
|
|
47
61
|
path = "src/bin/mnemo.rs"
|
|
@@ -129,7 +143,7 @@ required-features = ["benches"]
|
|
|
129
143
|
|
|
130
144
|
[features]
|
|
131
145
|
# When enabled, exposes crash-injection hooks used by the Phase 1.3
|
|
132
|
-
# proptest under `
|
|
146
|
+
# proptest under `mnemo_engine::__failpoints::*`. Always enabled during
|
|
133
147
|
# `cargo test` via `#[cfg(test)]`; the feature is here so an external
|
|
134
148
|
# fault-injection consumer (or a future integration test in a sibling
|
|
135
149
|
# crate) can opt into the same hooks without touching this crate's
|
|
@@ -145,7 +145,7 @@ memoizing LLM tool-call outputs, prompt→completion pairs, expensive HTTP
|
|
|
145
145
|
responses — anything reconstructible on cache miss:
|
|
146
146
|
|
|
147
147
|
```rust
|
|
148
|
-
use
|
|
148
|
+
use mnemo_engine::{Mnemo, CachePutOpts};
|
|
149
149
|
|
|
150
150
|
let mut db = Mnemo::open("agent.mnemo", "correct horse battery")?;
|
|
151
151
|
|
|
@@ -206,7 +206,7 @@ miss. Semantic caching bridges the gap by keying on an embedding
|
|
|
206
206
|
vector and returning the closest hit above a similarity threshold:
|
|
207
207
|
|
|
208
208
|
```rust
|
|
209
|
-
use
|
|
209
|
+
use mnemo_engine::{Mnemo, SemanticCachePutOpts, DEFAULT_SEMANTIC_THRESHOLD};
|
|
210
210
|
|
|
211
211
|
let mut db = Mnemo::open("agent.mnemo", "pw")?;
|
|
212
212
|
|
|
@@ -265,8 +265,20 @@ the memory of an agent is as portable and as private as a SQLite database.
|
|
|
265
265
|
This repository implements a real, compiling, tested **core**. See
|
|
266
266
|
[Scope](#scope-what-is-and-isnt-here) for what is deliberately left as roadmap.
|
|
267
267
|
|
|
268
|
-
> The product is **Memory Nemo (MNemo)**. The crate
|
|
269
|
-
>
|
|
268
|
+
> The product is **Memory Nemo (MNemo)**. The crate and Python package are
|
|
269
|
+
> distributed as `mnemo-engine` (both `mnemo` and `mnemo-db` were already
|
|
270
|
+
> taken by unrelated projects — see the "Breaking: import name" section in
|
|
271
|
+
> CHANGELOG.md for the full rationale). **Starting in v0.7.0, the Rust
|
|
272
|
+
> library name and Python import name are `mnemo_engine`:**
|
|
273
|
+
> `use mnemo_engine::...` and `import mnemo_engine` (or `import
|
|
274
|
+
> mnemo_engine as mnemo` if you want call sites unchanged). Rust code
|
|
275
|
+
> that wants to keep writing `use mnemo::...` can rename the dependency
|
|
276
|
+
> locally via `mnemo = { package = "mnemo-engine", version = "0.7" }` —
|
|
277
|
+
> that stays supported indefinitely because it's a Cargo-side alias.
|
|
278
|
+
> Python has no `import mnemo` shim: the old top-level `mnemo` module
|
|
279
|
+
> would still clash with `mnemo-db` and PyPI `mnemo`, which is exactly
|
|
280
|
+
> what the rename exists to end. The CLI command (`mnemo`) and the
|
|
281
|
+
> `.mnemo` file extension are unchanged.
|
|
270
282
|
|
|
271
283
|
---
|
|
272
284
|
|
|
@@ -434,16 +446,41 @@ list over a slab of indices, so it stays within the crate's
|
|
|
434
446
|
|
|
435
447
|
### Recall
|
|
436
448
|
|
|
437
|
-
`recall` scores each candidate with
|
|
449
|
+
`recall` scores each candidate with the v0.7.0 scoring-v2 formula:
|
|
438
450
|
|
|
439
451
|
```
|
|
440
|
-
score =
|
|
452
|
+
score = similarity
|
|
453
|
+
+ max(similarity, 0)
|
|
454
|
+
· ( β · recency
|
|
455
|
+
+ γ · (importance − 0.5)
|
|
456
|
+
+ δ · tanh(access_count / 5) )
|
|
457
|
+
|
|
458
|
+
recency = exp( -ln(2) · age_secs / half_life_secs )
|
|
459
|
+
age_secs = now - memory.created_at # not accessed_at
|
|
441
460
|
```
|
|
442
461
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
462
|
+
Four deliberate shape changes from the pre-v0.7.0 additive formula
|
|
463
|
+
(`α·sim + β·recency + γ·importance + δ·ln(1 + uses)`):
|
|
464
|
+
|
|
465
|
+
- **Similarity-gated bonuses.** Recency / importance / usage are
|
|
466
|
+
multiplied by `max(similarity, 0)`, so a stale-but-off-topic memory
|
|
467
|
+
can't ride recency past a semantically-on-point one.
|
|
468
|
+
- **Importance centered at 0.5.** A default-importance memory
|
|
469
|
+
contributes zero importance bonus; importance only pushes a score
|
|
470
|
+
up or down from that reference point.
|
|
471
|
+
- **Saturating usage.** `tanh(access_count / 5)` caps the feedback
|
|
472
|
+
bonus so a heavily-returned memory stops accumulating weight past
|
|
473
|
+
~5 uses.
|
|
474
|
+
- **Recency from `created_at`.** A `recall()` no longer bumps its own
|
|
475
|
+
results' recency on later queries.
|
|
476
|
+
|
|
477
|
+
`recency` still decays exponentially (default 7-day half-life).
|
|
478
|
+
`recall` also filters by memory type and by agent scope (an agent
|
|
479
|
+
sees its own memories plus any marked `Shared`), and skips
|
|
480
|
+
TTL-expired entries. Weights and the similarity metric (cosine /
|
|
481
|
+
dot / L2) are per-request. The raw `RecallResult.score` sits on
|
|
482
|
+
a different scale than pre-v0.7.0 — callers comparing raw scores
|
|
483
|
+
to a fixed threshold should re-pick the threshold.
|
|
447
484
|
|
|
448
485
|
### Sessions
|
|
449
486
|
|
|
@@ -601,7 +638,7 @@ existing files open on v0.5.2 unchanged.
|
|
|
601
638
|
## Quick start (library)
|
|
602
639
|
|
|
603
640
|
```rust
|
|
604
|
-
use
|
|
641
|
+
use mnemo_engine::{Mnemo, MnemoConfig, Memory, MemoryType, RecallRequest};
|
|
605
642
|
|
|
606
643
|
fn main() -> mnemo::Result<()> {
|
|
607
644
|
let cfg = MnemoConfig { dimensions: 3, ..Default::default() };
|
|
@@ -30,7 +30,7 @@ use std::hint::black_box;
|
|
|
30
30
|
use std::time::Duration;
|
|
31
31
|
|
|
32
32
|
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
|
|
33
|
-
use
|
|
33
|
+
use mnemo_engine::{CacheFlushPolicy, CachePutOpts, Mnemo, SemanticCachePutOpts};
|
|
34
34
|
use tempfile::TempDir;
|
|
35
35
|
|
|
36
36
|
#[path = "corpus.rs"]
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
use std::fs;
|
|
22
22
|
use std::path::{Path, PathBuf};
|
|
23
23
|
|
|
24
|
-
use
|
|
24
|
+
use mnemo_engine::{IndexConfig, KdfParams, Memory, MemoryType, Mnemo, MnemoConfig};
|
|
25
25
|
|
|
26
26
|
/// Passphrase used by every bench-created file. Not a secret; the files
|
|
27
27
|
/// are throwaway and live in `target/`.
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
use std::hint::black_box;
|
|
28
28
|
|
|
29
29
|
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
|
|
30
|
-
use
|
|
30
|
+
use mnemo_engine::{Embedder, EmbedderIdentity, Memory, MemoryType, Mnemo, Result};
|
|
31
31
|
use tempfile::TempDir;
|
|
32
32
|
|
|
33
33
|
#[path = "corpus.rs"]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
//!
|
|
3
3
|
//! Run with: `cargo run --example quickstart`
|
|
4
4
|
|
|
5
|
-
use
|
|
5
|
+
use mnemo_engine::{Memory, MemoryType, Mnemo, MnemoConfig, RecallRequest, Result};
|
|
6
6
|
|
|
7
7
|
fn main() -> Result<()> {
|
|
8
8
|
// Use a temporary path so the example is self-cleaning.
|