
Memory Kernel
io.github.Artem362由 GitHub 帳號 Artem362 發布v0.3.2更新於 Oct 24, 2026
Local-first memory for AI agents: SQLite FTS5, deterministic recall, no vector DB, no cloud.
發布方自己的服務:Memory.fit
概覽
為 AI 代理設計的本地優先記憶層,以 SQLite 儲存決策、事實與筆記,並依預算召回精簡的上下文包。
- 可以做什麼
- 儲存與匯入記憶:儲存一筆精確記憶,或把原始筆記與逐字稿拆成結構化記錄並推斷類型、標題與標籤,支援試跑預覽與去重合併。搜尋與召回:依關鍵字尋找相關記憶,為提示詞建立受字元預算限制的上下文包,或在工作階段開始時取得小型熱記憶包。瀏覽與檢視:列出最近記憶並查看儲存統計。軟封存:把過時記憶從召回中隱藏,同時保留以便從命令列還原。
- 適用情境
- 適合希望助理在本機跨工作階段保留可檢視的持久記憶、且不想依賴託管服務或向量資料庫的情境,也適合只把少量相關記錄放入提示詞而非全部傾倒。
- 執行需求
- 以本地程序透過 stdio 執行,從 PyPI 安裝(套件名稱 amormorri-memory-kernel,需 mcp 附加項),以 memory-kernel-mcp 指令或 serve-mcp 子指令啟動。需要本地 SQLite 資料庫檔案,由環境變數 MEMORY_KERNEL_DB 或 --db 參數指定,預設位於工作目錄下的 .memory-kernel/memory.db。不需帳號或 API 金鑰。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Memory Kernel,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Memory Kernel
Memory Kernel is a small local memory layer for AI agents.
It helps you save useful things such as decisions, constraints, tasks, facts, and notes in a local SQLite database, then pull back only the few memories that matter for the current task.
Published package name on PyPI: amormorri-memory-kernel
CLI command after install: memory-kernel
Practical guide in Ukrainian: docs/OPERATING_GUIDE_UK.md
Release notes: CHANGELOG.md
Contents
- What It Does
- Start In 5 Minutes
- Typical Workflow
- Which Command To Use
- Use With An LLM (MCP)
- How It Works
- Why It Stays Lightweight
- Who It Is For
- Project Status
- Native Accelerator
- Feedback
What It Does
In plain English, Memory Kernel does 4 things:
- Stores memory locally on your machine.
- Keeps memory structured enough to stay useful.
- Finds relevant records without a heavy vector stack.
- Builds a small context pack instead of dumping everything into the prompt.
This project is not trying to create a magical black-box memory. It is trying to create a memory layer you can inspect, control, export, and trust.
Start In 5 Minutes
If you just want to try it, do this:
What happened there:
initcreated a local database.remembersaved one clear memory.searchfetched it back.exportcreated a backup file you can move or restore later.
If you are using the repository instead of PyPI:
Typical Workflow
Most people will use it like this:
- Save one precise memory with
remember. - Feed raw notes or transcripts with
ingest. - Before an agent run, fetch only what matters with
search,context, orwake-up. - Inspect, fix, or remove single records with
show,update, ordelete. - Periodically export the database for backup.
- Restore it elsewhere with
import.
Which Command To Use
remember
Use remember when you already know exactly what should be saved.
Good examples:
- a decision
- a rule
- a user preference
- a project constraint
ingest
Use ingest when you have raw text and want the system to split it into structured memories.
Good examples:
- meeting notes
- a transcript
- a rough planning document
- an agent session log
Add --dry-run to preview the segments and inferred kinds/titles/tags without writing to the database. Useful before committing a long file.
Add --interactive for a guided flow that prompts for scope, source, tags, and the text itself, then shows a preview and asks for confirmation before saving. Helpful for first-time users or for ad-hoc captures from the terminal without remembering the flag names.
search
Use search when you want a few relevant exact memories for a query.
context
Use context when you want a compact pack for an agent prompt.
wake-up
Use wake-up when you want a small "hot memory" pack before a task starts.
stats
Use stats when you want to see database size and whether the native accelerator is active.
--since adds recent-activity counts (created and updated since the cutoff) plus a per-kind breakdown for the window. Accepts either a relative form like 7d or an ISO date.
list
Use list to browse recent memories (most recently updated first) with optional filters.
Default limit is 20. The output shows id, kind/scope, title, and the timestamps so you can pipe ids into show/update/delete.
show
Use show when you have a memory id (printed by search, remember --json, or export) and want the full record.
update
Use update to fix specific fields on an existing memory without re-importing the whole database.
Only the fields you pass change. Pass --tags with no values to clear tags. Pass --kind, --importance, or --certainty to revise validation-bound fields.
delete
Use delete to drop a memory you saved by mistake or that no longer applies.
The command exits non-zero if the id does not exist, so wrap it in shell logic if you script around it.
forget / restore
delete removes a memory permanently. When you only want it out of recall but kept for safety, use forget — a soft-archive. Archived memories disappear from search, context, wake-up, and list, but the data stays and restore brings it back.
Re-saving the same memory with remember/ingest also resurrects it automatically.
revise
When a new memory replaces an old one, record the relationship with revise: the old memory is marked superseded (hidden from recall, kept for history with a pointer to its replacement).
This keeps memory self-curating: stale decisions fade out of recall as newer ones take their place, instead of piling up as contradictory noise.
decay
decay applies a forgetting curve: it auto-archives memories that are old, rarely recalled, and low-value, so the store and your recall stay lean over time. Each memory has a retention score built from its importance, how often it has been recalled (reinforcement), and how long since it was last seen (time decay).
Only note and fact memories are eligible — decision, constraint, task, and preference are never decayed. Archiving is the soft, recoverable kind, so restore and list --include-archived still reach faded memories. This is the heart of the project's thesis: spend the budget on what matters, let trivia fade.
completion
Use completion to print a shell completion script for memory-kernel. The script is generated dynamically from the current parser, so it stays in sync as commands are added.
After installing, memory-kernel <Tab><Tab> shows all subcommands; memory-kernel remember --<Tab> lists flags for that command; memory-kernel remember --kind <Tab> cycles through valid kind values.
verify
Use verify to check that the database is internally consistent: schema version is current, derived columns (stems_text, fingerprint) match the source content, and the FTS5 index row count matches the memories table.
Without --repair, exit code is 0 when healthy and 1 when issues are found. With --repair, mismatches are recomputed in-place and the FTS index is rebuilt if its row count drifted; exit code is 0 if everything was fixed.
Useful after restoring from a manual backup, after editing the database with raw SQL, or as a periodic sanity check in CI.
export
Use export for backup, migration, or inspection.
import
Use import to restore a previous export.
import is idempotent for the same exported records because it upserts by memory id.
Use With An LLM (MCP)
Memory Kernel ships an MCP server so an LLM can save and recall memories itself during a session. It works with Claude Desktop, Claude Code, Cursor, and any other MCP client, over stdio.
Install with the MCP extra:
Run it directly to check it starts:
Then register it with your client. For Claude Desktop (claude_desktop_config.json):
For Claude Code / Cursor (.mcp.json in the project root):
The server exposes seven tools:
memory_forget is exposed because it is reversible — an agent can let a stale memory fade, and a human can restore it from the CLI. Truly destructive edits (delete, update, revise) are deliberately not exposed over MCP: an agent can add, recall, and soft-forget, but only you can permanently rewrite or remove.
Tools take flat parameters, so the model sees scope, kind, title, … directly. Verify the whole protocol round-trip any time with python scripts/mcp_smoke.py, and see docs/REAL_AI_TEST.md for a hand-test script to run on a real model.
How It Works
The core idea is simple:
- Store exact text locally.
- Search cheaply with
SQLiteandFTS5. - Rank results deterministically instead of fuzzily.
- Return a small context pack with a hard character budget.
That is how Memory Kernel reduces both blur and overhead.
Data Flow
Component Diagram
Memory Record Schema
Leaner Context Packs
When building a context or wake-up pack, Memory Kernel skips a memory whose content closely overlaps one already included (token-overlap above a threshold). Under the same character budget, the pack then carries more distinct facts and less repetition — directly lowering the redundant context handed to the model. Tune or disable per call with dedup_threshold (1.0 disables).
Ukrainian Inflection Bridging
Search bridges Ukrainian morphology in two layers:
- Suffix stemming on the query expands each term to a short stem (
вирішили→виріш*). This findsвирішили,вирішення,вирішує,вирішена— anything sharing the same prefix. - Deep stemming of stored content (suffix + prefix stripping) lives in a separate
stems_textcolumn inside the FTS5 index. The query also matches against deep stems exactly (stems_text:ріш). This bridges across different prefixes, so a search forрішенняalso findsвирішилиandневирішене— they all collapse to the sameрішstem.
Stored title/summary/content/tags stay exact, so fingerprints, deduplication, ranking, and export all remain deterministic. Only the FTS5 index gains a derived stems_text column.
Disable with:
Disabling only affects the query side. stems_text keeps being populated on writes so toggling the env back on does not require a rebuild.
Why It Stays Lightweight
Memory Kernel stays small on purpose:
SQLite+FTS5instead of a mandatory vector database- deterministic ranking instead of fuzzy always-on retrieval
- duplicate-aware updates instead of endless memory growth
- hard context budgets instead of large prompt dumps
- optional
Rustacceleration only where it actually helps
For embedded Python usage, MemoryStore keeps a long-lived SQLite connection for throughput. Prefer with MemoryStore(...) as store: or call store.close() when you are done.
Who It Is For
This is a good fit when you want:
- local-first memory on your own machine
- clear records you can inspect
- small, predictable retrieval
- easy export and restore
This is a weaker fit when you want:
- a fully hosted managed platform
- zero local setup
- fully automatic cleanup of messy notes with no review
Project Status
Current stage: working alpha.
Already working:
- package layout
- CLI
- tests
- export and import
- optional Rust accelerator
- Python fallback without Rust
Still in progress:
- prebuilt wheels for major platforms
- a simpler guided ingest flow
- even lighter onboarding for non-technical users
Native Accelerator
The Python implementation is the stable default.
If you want lower overhead on ingest and heuristic hot paths, build the optional Rust module:
After that, memory-kernel stats will show whether accelerator: rust is active.
You can benchmark the current hot paths with:
Experimental native ranking is available for profiling:
License
Apache License 2.0 (see LICENSE and NOTICE). Versions up to and including 0.3.1 were released under the Unlicense and remain available under those terms; all later versions are Apache-2.0. Contributions require a DCO sign-off — see CONTRIBUTING.md.
Feedback
Issue tracker: https://github.com/Artem362/memory-kernel/issues
Issue template chooser: https://github.com/Artem362/memory-kernel/issues/new/choose
There is also a first-run feedback template in:
.github/ISSUE_TEMPLATE/first-run-feedback.yml
The most useful early report includes:
- where you installed from
- your OS and Python version
- the exact command you ran
- what you expected
- what actually happened
來源:README.md,提交 68887b7
工具
0版本歷史
1- v0.3.2最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
其他 Memory 整合

Memory.fit
fit.memory官方發布者
託管式 Memory.fit 伺服器,讓 AI 讀取你的訓練、睡眠、恢復與飲食資料,並寫回每週計畫、每日目標和飲食計畫。
pg.ddx.io: the PostgreSQL community's memory
io.ddx.pg官方發布者
pg.ddx.io: the PostgreSQL community's memory 的託管 MCP 服務,由 pg.ddx.io 發布;無需登入;Streamable HTTP;29 個工具。
var.gg Naming Memory
gg.var官方發布者
遠端 MCP 伺服器,可依領域概念推薦並檢索韓、日、中、越、英多語言的程式識別字名稱,並提供 ERD 結構查詢。

Counterparts
ai.counterparts
為 Claude Code 與 Claude Desktop 提供的本地優先長期記憶:助理自行寫下關於你與專案的筆記,並在之後的對話中回想起來。

LAHZE - Persian AI Memory Platform
由 GitHub 帳號 pedramgholizadeh 發布
以波斯語為先的地理記憶平臺:發現地點,起草併發布僅限波斯語的記憶。AI 翻譯