Operator: Andrew. Written 2026-10-27 02:55 Sydney. Supersedes nothing; follows MEMSTORE_CLONE_CHECKPOINT_2026-10-26_1.md.
The operator closed the memstore chapter and opened The AI Influence Project. Memstore (facts layer) is finished for now. Everything below "Influence" is new work. Start the next conversation from this file.
/root/memstore (operator's standard): memstore.db, memtok.db, scripts, state.| Zip | Content |
|---|---|
| v1.0.6 | memstore.py 1.1.1 (MEMDIR default /root/memstore, MEMSTORE_DB, prints database path); qwen_propose.py 1.1.1 |
| v1.0.7 | qwen_memproxy.py 1.2.0, tool filtering (--drop-tools) |
| v1.0.8 | qwen_memproxy.py 1.2.1, per-profile defaults: 4B drops runtime tools, 0.5B drops all |
| v1.0.9 | qwen_memproxy.py 1.3.0, remember: in chat saves a fact through memstore.py add |
Go-between: 8090 → 4B (8080), 8091 → 0.5B (8081). It injects memory, filters tools, handles remember:. Order in forward: filter tools, remember:, inject.
Findings worth keeping:
get_info, which returns the browser OS, not from the model.system) confirmed good; 0.5B default user.Known open items in the memstore chapter (not blocking):
$(get_datetime) as text instead of calling the tool. Option not built: a system-message line telling it to call the tool.qwen_propose.py has never been run on real chats.--drop-tools; remember: rewriting "my" to "the operator's"; QwenStop.sh/PID file for ordered stop; removing stray /bin/memstore.db; the --limit 20 default.Purpose: a second LLM-side store (the operator's "LLM2 token database") that influences LLM1's next-token probabilities using logit_bias, with saliency read from n_probs.
n_probs list (top20.json: for the prompt "The best thing to do on a rainy weekend is", id 311 " to" at logprob -1.21, 728 " go", 32671 " ______" …) are "the tokens we will be INFLUENCING". The operator confirmed this. n_probs is output-side saliency and sits on the same axis logit_bias acts on. Attention weights are not exposed by the server.fact_id; sync removes memtoks whose fact is forgotten, superseded or rejected. CORRECTION entries are always-on and bypass scoring.llama-server --embeddings; memtoks hold text + LLM1 token IDs + vector, so the embedding model need not share LLM1's vocabulary.bias aims at the next token of a phrase: start of phrase → gap to the leading candidate × --strength (0.5); mid-phrase (tokens already emitted) → full gap; target outside the top 20 → gap measured to the 20th candidate + margin 2.0; capped at --max-bias 5.0; shared tokens take the maximum. Output [[id,bias]] for /completion or {"id":bias} for chat requests.retrieve --record.memtok.py v1.0.0 (2026-10-27) is written and tested but NOT packaged or delivered.
Location: scratchpad/b110/memtok.py (the build folder b110 is a copy of b109 plus memtok.py). Not yet done:
MEMTOK_MANUAL.md (with version history),Memstore_Clone_v1.1.0.zip with the legacy-zipper line on the release card ("Not needed" for non-SMF zips),Commands: seed, add, prepare, retrieve (auto sync; --record, --top, --min-sim 0.25, --json, --no-sync), bias, hit, list, stats, sync, evict --max N (only fact_id IS NULL and value < 3.0; --dry-run), forget, queries, forget-query.
Tables in memtok.db: memtoks(id, text UNIQUE, token_ids JSON, vec JSON, hits, value, fact_id, origin, created, last_seen); queries(id, text UNIQUE, vec, hits, created, last_seen); query_memtoks(query_id, memtok_id, score).
Note: timestamps are stored in UTC. Weight = value × (1 + ln(hits)); score = max(cosine,0) × weight.
Tests run (stand-in embedding/tokenizer servers, scratch tmt.py, not shipped): seed skips corrections; prepare fills vectors and token IDs; --record stores a query and a repeat raises its count to 2; forget-query removes its links; rejecting a fact in memstore removes its memtok on sync; unreadable memstore refuses to delete anything; memstore.db hash unchanged by memtok commands; bias output. Tested on a newer Python than the Clone's 3.6 — run it on the Clone's Python 3.6 first (it only uses stdlib features that exist in 3.6; utcnow is fine there).
Unrequested decisions made and listed to the operator for the query store: separate queries and query_memtoks tables; storing only with --record; text cap 2000 characters; queries never touched by sync/evict. Still to list before delivery (from the original spec): log-damped count multiplier, --min-sim 0.25, eviction exemptions, one memtok per fact on seed, leading-space tokenisation, phrase-level default.
/completion with n_probs: 20 on both and compare ids 311, 728, 32671.logit_bias is per request, not per token. Decide how the go-between feeds it (one pre-computed table at request start vs. step-by-step generation with re-biasing as phrases begin).n_probs.--pooling mean).hit after use; what counts as use).Claude: [Month DD, YYYY, HH:MM:SS AM/PM] (casual mode), actual Sydney time from code run immediately before each reply.pkill/kill on services — ordered shutdowns only. Never rename his scripts.@version/@date; manual version-history entry; version shown once at start; zip with dotted never-reused version; xmllint --noout on XML; list unrequested changes BEFORE making them; end with a release card (include "legacy zipper used")._N suffix and are never reused (next for 2026-10-27 is _3); he prefers short conversations and a fresh chat per chapter.memtok.py delivery: manual, listed decisions, Memstore_Clone_v1.1.0.zip (or a new Influence project zip name if the operator prefers), release card.memtok.py seed, then prepare with an embedding server, then retrieve --record.