What it does它做什麼
Structured recall, not a note dump.
有結構的回想,不是一堆筆記。
Writes always go to the current workspace's SQLite file. Oracle and OpenAI are optional and only come into play when reading.
寫入一律進目前工作區的 SQLite 檔。Oracle 與 OpenAI 都是選配,只在讀取時派上用場。
01
Four record types
四種紀錄類型
Decisions keep what, why, and how. Resolved issues keep what and how. Open questions carry a priority from 1 to 3. Everything else is a knowledge item with a title, content, and tags.
決策記下做什麼、為什麼、怎麼做;已解決的問題記下問題與解法;待解問題有 1 到 3 的優先度;其餘都是有標題、內容與標籤的知識項目。
memory_record_*02
One call to store
一個呼叫就能存
memory_store picks the type from English keywords such as decided, fixed, or a question mark, and splits a decision's what | why | how on the pipes.
memory_store 依英文關鍵字判斷類型,例如 decided、fixed 或半形的 ?,再用 | 把決策拆成做什麼、為什麼、怎麼做。
memory_store03
Salience instead of deletion
用重要度取代刪除
A read or a local search hit multiplies salience by 1.05, memory_reinforce by 1.2, capped at 2.0. The decay job multiplies anything untouched for 30 days by 0.95 and never deletes a row.
每次讀取或本地搜尋命中,重要度乘以 1.05;memory_reinforce 乘以 1.2,上限 2.0。衰減排程把 30 天沒被碰過的紀錄乘以 0.95,但從不刪除資料。
python -m mcp_memory --decay04
Search with fallbacks
逐層退回的搜尋
With Oracle and an OpenAI key, memory_search runs cosine vector search. With Oracle alone, a text match ranked by salience. With neither, a text match across every mapped workspace.
有 Oracle 加 OpenAI 金鑰時,memory_search 做 cosine 向量搜尋;只有 Oracle 時,改用依重要度排序的文字比對;兩者都沒有,就比對所有已對應的工作區。
memory_search05
CJK-aware session check
CJK 感知的 session 檢查
memory_compact weighs session.md at 1.5 tokens per CJK, kana, or Hangul character, 2.0 per emoji, 0.25 otherwise, and flags it past 3,000 tokens or 100 lines. The agent does the trimming.
memory_compact 估算 session.md 時,CJK、日文假名與韓文每字算 1.5 token,emoji 算 2.0,其他算 0.25,超過 3,000 token 或 100 行就提醒壓縮,實際整理交給 agent。
memory_compact06
Audit and report queries
稽核與報告查詢
Four read-only tools search an Oracle AUDIT_LOG by keyword, date, sender, or H/M/L importance, count it, and read DAILY_REPORTS and ACTIVITY_LOG. Something else has to fill those tables.
四個唯讀工具可以依關鍵字、日期、寄件者或 H/M/L 重要性搜尋 Oracle 的 AUDIT_LOG、做統計,也能讀 DAILY_REPORTS 與 ACTIVITY_LOG。這些表要由別的程式寫入。
memory_audit_search