Aletheia

io.github.firatmio由 GitHub 帳號 firatmio 發布v0.1.1更新於 Oct 31, 2026

Project memory for coding agents whose memories carry code evidence, re-checked on every recall.

發布方自己的服務:4words

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

Aletheia 為編碼助理提供帶有程式碼證據的專案記憶,每次召回都會對照檔案重新驗證,過期的事實會被隱藏。

可以做什麼
  • 在探索程式碼庫前召回專案記憶,每行標示為已驗證、已移動或無錨點,並指向目前的檔案行號
  • 一次或多次呼叫儲存帶有證據錨點(symbol、contains、exists、file)的持久事實
  • 依 id 讀取單一記憶及其各錨點狀態
  • 重新驗證全部記憶或某個 id 的錨點,仍成立則重新封存,已變更則以新記憶取代
適用情境
適合在中大型程式碼庫中工作的編碼助理,它們會在每次工作階段之間反覆重讀相同檔案,且需要不會悄悄過期的記憶。對於助理一兩次呼叫就能讀完的小型套件,效益有限。
執行需求
以本機 stdio 程序執行,可透過全域安裝 npm 套件(Node 18+)或 npx 啟動,也可使用 Go 二進位檔。專案需先由初始化指令建立 .aletheia 目錄,並以目錄參數或 ALETHEIA_DIR 變數指向它。不需帳號、API 金鑰或網路存取。
安裝前請注意
remember 工具會將記憶檔案寫入專案的 .aletheia 目錄;選用的掛鉤會讀取本機上的提示詞與工作階段紀錄,並在 .aletheia 中保留提示詞的縮短副本。記憶被視為資料而非指令,但它们是可編輯、可提交的純 Markdown 檔案,分享前應先審閱。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Aletheia,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[aletheia]

Memory your coding agent can verify.

Every memory carries evidence from your code. Aletheia re-checks it on every recall,
points your agent at the exact lines, and keeps stale facts out of its context.

[Release] [npm] [MCP Registry: io.github.firatmio/aletheia] [License: Apache-2.0] [Go 1.24+] [Zero dependencies]

[Aletheia MCP server on Glama] [M8ven Score]

Quick start · How it works · Results · Reference

[A memory is saved with evidence and recalled as [ok] with its line. The file is moved and recall shows it as [moved] at its new place. The value is changed and recall hides the memory; verify says why: MaxDiscount changed.]

The problem

Coding agents forget everything between sessions, so they re-read the same files every time. Memory tools fix the forgetting, but they rank memories by similarity, and an outdated memory looks just as relevant as the fact that replaced it. The agent then builds on something that stopped being true weeks ago. A confidently wrong memory is worse than no memory.

How it works

[On every prompt Aletheia adds verified memories and a code map with line pointers; the agent reads the exact lines; when it stops, Aletheia records which files the task changed.]

  • Memories carry evidence. Each memory is a claim plus anchors: a function that must still exist, a line that must still match, a file that must still be there.
  • Evidence is checked on every recall. The checks are mechanical: no model calls, no embeddings, no network. A memory whose evidence broke is hidden from the agent, and a one-line note says so.
  • Moved code is followed. When a Go declaration moves unchanged to another file, its memory comes back as [moved] with the new place instead of going stale.
  • Recall points at lines. A pointer such as builtin_test.go:263 is computed from the files right now, so the agent opens the right lines instead of searching for them.
  • Maps write themselves. When the agent stops, Aletheia reads the session transcript and records which files the task changed. The next task of the same kind starts there, and the agent spends no turns writing it down.
  • Nothing is deleted. Replaced memories are superseded and long-stale ones archived by aletheia lethe (Lethe, the river of forgetting).

Quick start

1. Install it in whichever way suits you. Every option gives you the same single binary:

bash
npm install -g @firatmio/aletheia                             # Node 18+, any OSgo install github.com/firatmio/aletheia/cmd/aletheia@latest   # Go 1.24+scoop bucket add firatmio https://github.com/firatmio/scoop-bucket; scoop install aletheia   # Windowsbrew install --cask firatmio/tap/aletheia                     # macOS, Linux

Prebuilt archives for Linux, macOS and Windows are on the releases page.

2. Connect your agent.

Claude Code, with the plugin (recommended). It brings the MCP server and both hooks. /aletheia:setup then initializes the project:

text
/plugin marketplace add firatmio/aletheia/plugin install aletheia@aletheia/aletheia:setup

Claude Code, without the plugin. Set up the project and add the two hooks yourself. Recall then happens on every prompt and costs the agent nothing:

bash
cd your-projectaletheia init --agents --claude-hooks   # .aletheia/, usage notes in CLAUDE.md and AGENTS.md, hooks in .claude/settings.jsonaletheia hook --dry-run                 # what an agent would get (add a prompt to try one); changes nothing

Run --claude-hooks yourself. Agents are usually not allowed to change their own hooks, and that is by design. Don't add these hooks if the plugin is installed: it brings the same two. init notices the plugin and says so. To edit the file by hand instead, use this:

json
{  "hooks": {    "UserPromptSubmit": [{ "hooks": [{ "type": "command", "command": "aletheia hook" }] }],    "Stop": [{ "hooks": [{ "type": "command", "command": "aletheia hook" }] }]  }}

Any other agent. Cursor, VS Code, Claude Desktop and Codex connect over MCP; agents without MCP use the CLI. See Other agents below. An MCP client configured with npx needs no install at all: {"command": "npx", "args": ["-y", "@firatmio/aletheia", "serve"]}.

An agent can also do the setup itself from the agent guide. It hands the hook step to you as that single command.

Memories live in .aletheia/memories/*.md as plain Markdown. Commit them and your team, and every agent, shares one memory that verifies itself on each machine.

Upgrading: npm update -g @firatmio/aletheia, scoop update aletheia or brew upgrade --cask aletheia. With Go, run the same go install again. Update the plugin with claude plugin update aletheia@aletheia.

  • Which version runs: the hooks use the new binary right away. The MCP server keeps the old one until the agent restarts.
  • With go install on Windows, a running agent keeps aletheia.exe open through the MCP server, so the install fails with "file in use". Quit the agent first, or move the old binary aside, which Windows allows for a running exe.

This works on every upgrade. It removes old copies that are no longer in use, and the random name never collides with one that is still running:

powershell
$bin = "$(go env GOPATH)\bin"Remove-Item "$bin\aletheia-old*.exe" -ErrorAction SilentlyContinueRename-Item "$bin\aletheia.exe" "aletheia-old-$(Get-Random).exe"go install github.com/firatmio/aletheia/cmd/aletheia@latest

Results

We measured with headless Claude Code (Opus 5.5) on real repositories. Each task ran with and without Aletheia, and the same hidden acceptance tests judged success.

RepositoryTasksCostAlsoTasks passed
gohugoio/hugo, a large site generator (233k lines of Go)14 tasks of five kinds, one run each−15%: −22% on seven tasks of one kind, −7% on a mixinput tokens −27%, turns −21%14/14, same as without
expr-lang/expr, a mid-size expression language7 tasks, two runs−9% in both runscode read before the first edit −48%14/14, same as without
go-chi/chi, a small, tidy router7 small tasks, two runs+5% and −5%: break-even14/14, same as without

Aletheia pays off where finding the right place is expensive, in mid-size and larger codebases, and most when the same kind of change comes back. Expect the mixed figure for everyday work. On a small package that an agent reads in one or two calls there is little to save. The method, the raw numbers and what did not work are in docs/dogfood-4.2.md.

Reference

Anchors
AnchorHolds whileExample
symbol:PATH::NAMEthe file still declares that function, method (Type.Method), type, var or constsymbol:store.go::Store.Get
contains:PATH::REGEXthe file still matches the regular expressioncontains:go.mod::^go 1\.23$
exists:PATHthe path still existsexists:src/auth
file:PATHthe file's content is unchanged (hash sealed when saved)file:go.mod
  • Use symbol for claims about one declaration and contains for one thing in a file. Use file only when any change should trigger a re-check.
  • Recall shows where symbol and contains evidence is right now, e.g. (store.go:15-21). Go declarations get their full range from go/parser. In other languages a symbol anchor finds the declaring line by its keyword (function, class, def, fn and the like); it is not sealed, so it cannot follow a move.
  • Moved code. A Go symbol anchor is sealed with a fingerprint of the declaration (symbol:store.go::Store.Get@3f9a…). The fingerprint ignores comments and layout.
    • Edits in place: they never stale the anchor. If the declaration is still in its file, the fingerprint is not even consulted.
    • A moved declaration: if the declaration leaves its file, Aletheia searches the project for it. When exactly one declaration with that name has the same fingerprint, the memory comes back as [moved: old.go → new.go] with the new lines, and verify <id> --reseal records the new path.
    • Anything less certain stays stale and hidden: the code changed on the way, several copies match, or the claim names the old file.
    • contains anchors in Go code: when one matches inside a single declaration, remember adds a sealed symbol anchor for that declaration. The contains anchor then moves with it, but only if its pattern still matches inside that declaration at the new place.
  • In a contains pattern, a run of spaces matches any run of spaces or tabs, so reformatting does not stale it.
  • Files named in a claim get an exists: anchor automatically.
  • Leave paths to the anchors: say what the code does ("Tokens are issued by IssueToken"), not where it is. A claim that names its symbol's file stays stale when the code moves, and remember says so when you save one.
  • remember warns when a contains anchor only matches comments, since a comment can stay while the code changes.
  • A memory without anchors comes back as [?], ranked below verified facts, and expires after 90 days unless re-confirmed.

When a memory goes stale, re-check the claim, then:

bash
aletheia verify 3f9a1c --reseal                                   # still true: refresh the evidencealetheia remember "…new claim…" --anchor … --supersedes 3f9a1c   # changed: replace it

--reseal refuses when a contains, exists or symbol anchor no longer holds, so a false claim cannot be quietly blessed.

Code map

aletheia map "<topic>" lists the files most relevant to a topic, each with its key declarations and their current lines:

optimizer/fold.go: fold.Visit 15-311, fold 10-13, toFloat 329-335builtin/builtin.go: Builtins 35-1081, Index 18

Files are ranked first, as in Aider's repo map, by how well their path and declaration names match the topic. Hidden, dependency and generated files are skipped. For a question about building, testing or shipping, and for the overview without a topic, the map starts with the build files: build and CI: go.mod, Makefile, scripts/, .github/workflows/ci.yml. The hook sends a map with the first prompt of a session, sized to the project: none under 25 source files, then 300 or 600 tokens (--map-budget N overrides it).

Other agents: Claude Desktop, VS Code, Cursor, Codex, Aider

Aletheia speaks MCP over stdio with four tools (recall, remember, get, verify) and works as a plain CLI, so any agent that can run a shell command can use it.

json
{  "mcpServers": {    "aletheia": { "command": "aletheia", "args": ["serve", "--dir", "/absolute/path/to/your-project"] }  }}

Without a global install, use "command": "npx", "args": ["-y", "@firatmio/aletheia", "serve", "--dir", "…"]. The server finds .aletheia/ from --dir, or from the directory the client starts it in. In a project without one, the tools answer with how to set it up rather than failing, and start working as soon as aletheia init has run.

  • VS Code (.vscode/mcp.json): use "servers" instead of "mcpServers", and ${workspaceFolder} as the directory.
  • Claude Code: use the plugin from the quick start. It adds the hooks too, and they matter more than the tools, because Claude Code loads MCP tool descriptions on demand.
  • Agents without MCP (Aider, custom agents): aletheia init --agents writes a short block to AGENTS.md that teaches the agent to call the CLI. Codex reads AGENTS.md too, so it gets the same notes alongside the MCP tools. Add --json to any read command for machine-readable output.
A memory file
markdown
---id: "3f9a1c"claim: "Auth tokens are issued by IssueToken, HS256 with a 15 minute expiry"confidence: 0.8status: "active"source: "claude-code"created: "2026-10-21T09:12:44Z"updated: "2026-10-21T09:12:44Z"tags:  - "auth"anchors:  - "symbol:src/auth/jwt.go::IssueToken@7370a7fe3669256c"  - "contains:src/auth/jwt.go::jwt\\.SigningMethodHS256"---Refresh tokens are handled separately, by RefreshToken.

The @7370a7fe3669256c suffix is the sealed fingerprint that lets the memory follow IssueToken if it moves.

Edit memories by hand, review them in pull requests, grep them. They are just files.

CLI
text
aletheia init [dir] [--agents] [--claude-hooks]aletheia remember <claim> [--anchor SPEC]... [--body TEXT|-] [--tag T]... [--ttl 30d]                  [--confidence 0.8] [--supersedes ID]... [--source NAME] [--force]aletheia remember - [--source NAME] [--force]            # several at once: one JSON object per line on stdinaletheia recall [query] [--budget N] [--limit N] [--full] [--stale] [--tag T] [--session ID] [--json]aletheia get <id> [--json]aletheia verify [id] [--reseal] [--ttl 30d] [--json]   # exits 1 if anything is stale (CI-friendly)aletheia map [topic] [--budget 600]aletheia hook [--budget N] [--map-budget N] [--dry-run [prompt]]   # Claude Code hook; every command takes --helpaletheia lethe [--days 30] [--apply] [--json]            # archive superseded and long-stale memoriesaletheia stats [--json]aletheia serve [--dir DIR]                               # MCP server on stdioaletheia version

Every command takes --help, and --dir DIR (or ALETHEIA_DIR) to point at a project from elsewhere.

remember exits with code 3 when the claim duplicates or closely matches an existing memory, and names it so the agent can --supersedes it instead.

remember - saves several memories in one call. Each stdin line is a JSON object with the MCP tool's keys, and each memory is saved on its own:

bash
aletheia remember - <<'EOF'{"claim": "Builtins are registered in builtin/registry.go", "anchors": ["symbol:builtin/registry.go::Builtins"]}{"claim": "go.mod targets Go 1.18", "anchors": ["contains:go.mod::^go 1\\.18$"], "tags": ["toolchain"]}EOF

It prints one result per line, in order. It exits 0 when all are saved, 3 when the only failures are conflicts, and 1 otherwise. A regex whose \\ became \ on the way through the shell (1\.18) is still accepted. The MCP remember tool takes the same objects as memories.

Safety
  • Never executes anything. Anchors only read files; there is no "run this command to verify" anchor.
  • Stays inside the project. Anchor paths are relative and cannot escape the root, including through symlinks.
  • Memories are data, not instructions. The MCP server tells agents so, and the CLAUDE.md / AGENTS.md block repeats it.
  • No network, no telemetry, no dependencies. A single static binary using only the Go standard library. The one program it starts is git check-ignore, during init, to see whether CLAUDE.md is ignored.
  • Privacy: Aletheia collects nothing. The hooks read the prompt and the session transcript on your machine, and the map memories keep a shortened copy of the prompt in .aletheia/. See the privacy policy.

Roadmap

  • Evidence-anchored memories, checked on every recall
  • Recall hook, live line pointers, code map, task maps from the Stop hook
  • Benchmark harness with paired runs on real repositories
  • Moved Go code followed by fingerprint ([moved])
  • Prebuilt binaries, npm, Homebrew and Scoop; a Claude Code plugin; listed in the MCP Registry
  • Sealed symbol anchors, and [moved], beyond Go: TypeScript/JavaScript and Python first
  • aletheia doctor: find anchors that keep going stale and suggest sturdier ones
  • Longer benchmarks with more repositories and repeated kinds of change
  • Global, cross-project memory for personal preferences

What changed in each release is in CHANGELOG.md.

Contributing

Issues and pull requests are welcome. See CONTRIBUTING.md and the code of conduct. If Aletheia misled your agent, the "An agent was misled" issue form is the most useful report you can send. Report security problems privately, as SECURITY.md describes.

License

Apache-2.0 © Fırat Tuna Arslan

ἀ-λήθεια: truth, literally "un-forgetting"

來源:README.md,提交 b7e2be6

工具

4

recall

Search project memory before exploring the codebase. Each line: id [ok|?] claim. [ok]=verified against the files now, [?]=unanchored hint, (file:12-40)=where it is now: read those lines. Stale memories are hidden (stale=true shows them).

輸入參數tagfullquerystalebudgetsession

remember

Save a durable fact with evidence; several in one call: memories=[{claim,anchors,...}]. anchors: symbol:store.go::Store.Get (a declaration), contains:go.mod::go 1\.23 (regex on the line that proves the claim, not a comment or name), exists:src/auth, file:go.mod (content hash; any edit stales it, avoid on busy files). Anchors must hold now. Absence claims ("no auth"): no anchors, ttl 30d. supersedes: ids of outdated memories to replace. Never store secrets.

輸入參數ttlbodytagsclaimforceanchorsmemoriesconfidencesupersedes

get

Full memory by id with per-anchor status.

輸入參數id必填

verify

Re-check anchors: all memories, or one id. After confirming a stale memory still holds, call with id and reseal=true. If it no longer holds, use remember with supersedes.

輸入參數idttlreseal

版本歷史

1
  1. v0.1.1最新Oct 24, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Aletheia 整合