Releases: chouswei/MemNet
v0.2.10
v0.2.9
v0.2.8
v0.2.7
Summary
- Optional memnet-llm[mcp] extra with memnet-mcp stdio MCP tools (goldfish loop: query_warm, add, update, session_open, read_get, housekeep_stats, serve_status)
- memnet serve TCP protocol: optional stdin field for add/update over LAN
- session current --session for MCP and remote clients
- CLI stdin ingest fix for StringIO (serve/MCP path)
Install
pip install memnet-llm==0.2.7
pip install memnet-llm[mcp]==0.2.7v0.2.6 — novel-writer doc refresh and IO token estimates
Added
- scripts/estimate_novel_io_tokens.py — recompute wire-format token estimates for novel-writer MemNet IO examples.
Changed
v0.2.5 — PyPI package rename to memnet-llm
Added
- PyPI distribution as memnet-llm (pip install memnet-llm); CLI entry point remains memnet.
- LICENSE (MIT) and [project.urls] in package metadata.
Changed
- Removed duplicate wheel force-include for bundled examples (included via package layout).
v0.2.4 — edge index and session modified_at
Summary
- Edge index —
memStoremaintainssrc/distadjacency maps;neighbors,find_path, andquery warmno longer scan all EDG rows. - Session
modified_at— ISO UTC timestamp on add/update/delete/prune; exposed insession list,session current, andhousekeep stats(@STAT: modified|…); persisted in snapshots.
Test plan
-
pytest— 46 tests passing -
python scripts/benchmark_efficiency.py
v0.2.3 — read list --where field filters
Summary
read list --where field=value— filter rows by field value (exact match; repeat for AND).*and?wildcards supported (e.g.--where name=*Tiexin*).- Efficiency benchmarks and regression tests for field filtering.
- New application note:
application-notes/llm-sysml-v2-modeling.md(SysML v2 modeling with the 6-step pipeline).
Test plan
-
pytest— 39 tests passing -
python scripts/benchmark_efficiency.py
v0.2.2 — EDG wiring, granular background, token efficiency
Added / emphasised
-
EDG as explicit wiring for selective context (application-notes/llm-novel-writer.md and LLM-GUIDE.md)
- New prominent section in the novel-writer note: "EDG rows — the explicit wiring for selective context".
- Explains the fixed built-in tag, the @edg: src|relation|dist|... form, how query warm --anchor + --depth traverses only the connected reference rows, LAW01 (edge_recycle) hiding transient links, and the same add/update + id-discipline rules that apply to nodes.
- Updated LLM-GUIDE "Relations (EDG)" section with the wiring role and a pointer to the long-form example.
-
Background as many small pieces, referred only when needed
- Header and opening of the application note now lead with the principle: LORE, RULE, CHR, PLT, USR etc. are deliberately stored as many small independent rows (one focused fact, one rule, one character facet, one preference, ...), not monolithic bibles or external files.
- A piece of background enters the LLM context for a turn only when the current anchor reaches it — either by a direct query warm --anchor or (the common case) via an EDG link from the live focus (scene, choice, ...). Unrelated background stays out of the warm slice.
- New dedicated section "Background is many small pieces, referred only when needed" with concrete pointers to the seed, Turn 3 (direct anchor on a single RULE for a canon change), and the wiring in the worked turns.
- All persistent/transient legends, seed description, pipeline step 1, quick-start comments, and snapshot text updated for consistency.
- LLM-GUIDE reading-strategy section now opens with the "many small rows, not monolithic blobs" statement.
-
Token efficiency examination of the pattern
- Added concrete analysis of the novel-writer application (and by extension any long-running MemNet use):
- Fixed per-turn overhead: the 4 LAW rows (~420 chars / ~100–110 tokens) are always prepended by context_pack. This is the non-negotiable price of the id discipline, edge-recycle rules, and endpoint validation guarantees.
- Bootstrap cost (full initial seed) is paid once: ~20–25 wire lines, dominated by the opening scene prose; low thousands of characters.
- Steady-state warm slices are small and deterministic: depth 1–2 + explicit EDG wiring + max-rows 20–30 + LAW01 + active-only filtering after settlement keep the injected context to the live focus + only the few reference fragments it actually needs.
- Dominant variable cost is the current creative work (the live SCN/CHOICE text fields). Once settled with delete_on_settle, that prose disappears from subsequent query warm unless still directly reachable.
- Cheap background edits: Turn 3 style (direct small anchors on a single RULE or LORE row, depth 1) avoid pulling current scene text at all.
- Granularity is key: because reference material is many tiny rows rather than one giant bible, even a depth-2 warm rarely pulls more than a handful of LORE/RULE/CHR fragments.
- Orchestrator contract (the 6-step pipeline) ensures only step 1+2 output is ever injected; no chat history, no re-sending settled material, no "paste the whole project".
- Contrasted with common alternatives (monolithic bibles in every prompt, full accumulated history, unstructured RAG without ids or settlement).
- The style rules in the example (concise scenes, scene economy) are both creative constraints and token hygiene.
- Added concrete analysis of the novel-writer application (and by extension any long-running MemNet use):
These changes make the long-form worked example a clearer demonstration of how MemNet keeps per-turn token cost bounded and predictable while still giving the agent reliable, on-demand access to any background or configuration piece when the current state actually needs it.
This is a repository / documentation release. The Python package remains at version 0.2.0 (no library code changed).
See the updated example: https://github.com/chouswei/MemNet/blob/master/application-notes/llm-novel-writer.md
v0.2.1 — LLM Novel Writer application note
Added
-
Application note: LLM Novel Writer (�pplication-notes/llm-novel-writer.md)
- Single self-contained document example showing how to use MemNet for long-form interactive novel writing with user steering.
- All data lives in MemNet: background (LORE), configurations & style rules (RULE), character bibles & backstories (CHR), high-level plot (PLT), user preferences (USR), and current story state (SCN, CHOICE) are first-class rows. No external lore files.
- Follows the explicit 6-step pipeline on every turn (exact wording):
- Read the data if it needs (selective query warm --anchor + direct background reads)
- Generate context (warm slice with LAW rows always prepended + connected persistent reference rows)
- User prompt/selection (orchestrator surfaces choices; human input recorded as data rows)
- Analyse change to the data (LLM reasons over the injected context, citing row ids and facts from persistent rows)
- Update the data (�dd for new entities, update for changes/settlements; transient work settled with
ecycle=delete_on_settle; persistent reference rows updated only on real canon changes) - Loop (return to step 1; settled transient rows disappear from warm unless still reachable)
- Includes:
- Schema definition (persistent reference tags + transient story tags + EDG relations), with note that fixed EDG + LAW are always present.
- Complete initial seed batch (world bible, style/config rules, character bibles, plot outline, user prefs, opening scene) with correct
ecycle values — ready to paste via heredoc + memnet add --stdin. - 3 compact, focused worked turns, each presented strictly as the 6 numbered steps (exact query warm commands, resulting warm output containing prepended @law: rows, user selections turned into data, analysis that names row ids and quotes background/config facts, precise memnet add/update lines, and loop confirmation).
- Mermaid diagram of the 6-step loop + persistent-vs-transient legend/table.
- Snapshot usage (session save / session load) for the entire novel project state.
- Pipeline-aware pitfalls (skipping reads, inventing facts, id reuse mistakes, forgetting settlements, mutating background without reading the row, etc.).
- Quick-start copy-paste commands (extract schema to temp map, session open --map-file, set MEMNET_SESSION, add the seed, first warm, then step through the pipeline).
-
Documentation:
- README.md: new "Application notes" section linking to the example.
- LLM-GUIDE.md: one-line pointer to the novel-writer 6-step pipeline as a long-running creative workflow where background/config lives in the graph.
This is a repository / documentation release. The Python package (version and published distribution) remains at 0.2.0; no library code changed.
See the full example: https://github.com/chouswei/MemNet/blob/master/application-notes/llm-novel-writer.md