
RAWThink
io.github.ygtalp由 GitHub 帳號 ygtalp 發布v2.0.1更新於 Oct 27, 2026
Persistent memory for AI thinking partnerships: hybrid search and a temporal knowledge graph.
概覽
本機 MCP 伺服器,為助理提供持久記憶:跨工作階段的混合檢索,以及帶時間軸的知識圖譜。
- 可以做什麼
- 檢索與讀取:在所有工作階段與筆記中做語意與關鍵字混合檢索、取得工作階段概覽、讀取完整工作階段內容、重建索引。
- 讀取知識圖譜:依領域與類型篩選的有界節點搜尋、開啟指定實體及其關聯、分頁瀏覽整張圖譜。
- 寫入圖譜:以原子方式記錄實體、關聯與觀察,記錄決策與被否決的替代方案,修訂或作廢觀察,以及個別建立實體、關聯與觀察。
- 刪除圖譜資料,僅在 full 工具設定檔下提供。
- 將速記存成 qnote,並把工作階段、交接文件與筆記以 markdown 匯出到本機 vault。
- 適用情境
- 適合希望助理在多個工作階段之間延續脈絡的情境:回想先前的決策、追蹤看法如何演變、保留被放棄的替代方案。較適合在同一台機器上長期進行的思考或專案工作,而非一次性提問。
- 執行需求
- 以 Python 3.10+ 本機套件執行(uvx 或 pip)。需要一個 vault 目錄(RAWTHINK_VAULT),Qdrant 可透過 Docker(QDRANT_URL)或嵌入式模式(QDRANT_PATH)執行,並需要搭載 bge-m3 嵌入模型的 Ollama(OLLAMA_URL、OLLAMA_MODEL)。選用設定包括 MEMORY_FILE_PATH、RAWTHINK_BM25_STATE、RAWTHINK_TOOL_PROFILE 與 RAWTHINK_LOG_LEVEL。未宣告任何驗證機制。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 RAWThink,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
RAWThink
Persistent memory for AI thinking partnerships. A knowledge graph you can argue with, search that spans every session you have ever had, and a record of not just what you decided but what you rejected.
MCP server for Claude Code. Python, local, no cloud.
The problem
Every conversation with an AI starts from nothing. You explain the same context, re-derive the same conclusions, and rediscover decisions you already made — and the reasoning that produced them is gone the moment the window scrolls.
Chat history does not fix this. History is a transcript; what you need is structure: which ideas connect, which beliefs you have since abandoned, which alternatives you considered and dropped, and why.
RAWThink keeps that structure in three layers, in files you own.
What it does
Hybrid semantic search across every session and note — BGE-M3 dense embeddings and BM25 sparse vectors, fused with RRF. Ask "what did I think about free will?" and get the passages, not a keyword match.
A temporal knowledge graph where observations carry dates and status. Beliefs can be marked invalidated and linked to what replaced them, so the archive remembers not only what you think but what you used to think.
Session lifecycle — a close command that exports the conversation, extracts entities into the graph, and writes a handoff the next session loads automatically.
Activation decay — unused knowledge fades on a ~23-day half-life, accessed knowledge stays warm. Old material is still there; it just stops crowding out what you are working on now.
Quick start
Prerequisites
- Python 3.10+
- Docker for Qdrant — or set
QDRANT_PATHfor embedded mode - Ollama with
bge-m3:ollama pull bge-m3
Install
rawthink-install writes the vault structure, CLAUDE.md,
THINKING_DIRECTIVES.md, SETUP.md, docker-compose.yml and the /rtclose
command. Use rawthink-install --vault ~/my-vault for a different location.
Register with Claude Code
Check the install
Nine checks with a fix line for each failure: vault, graph schema, BM25 state format, Qdrant, index coverage, vector dimension, Ollama, MCP registration.
The index coverage check is the one worth knowing about. Indexing can stop partway and leave a collection that looks healthy — it exists, it has points, queries return results. They are results from part of the vault, and nothing else tells you that.
Upgrading from 0.x
1.5.0 changed the graph schema and 2.0.0 changes the sparse index. Migrate the graph before writing anything:
That is a dry run — it prints what would change and writes nothing. Read the
report, then re-run with --apply. A timestamped backup is taken first.
Then re-encode the search index, because BM25 term IDs changed:
A plain reindex skips unchanged chunks and will leave the old encoding in
place. rawthink-doctor tells you if this is still pending.
See CHANGELOG.md for what changed and why.
Your first session
Close with /rtclose. It exports the conversation, extracts what is worth
keeping into the graph, and leaves a handoff for next time — which the next
session loads on its own.
The schema, and why it looks like this
This is the part worth understanding, because it is what keeps the graph queryable over years rather than months.
Role and subject are separate fields
entityType answers what role does this node play. Closed list of ten:
domain answers what subject is it about: software, music, history,
philosophy, health, writing, neuro, finance, personal, galaxy.
Keeping these apart is not tidiness. When one field carries both, the type list
grows by one entry per subject — a real vault reached 46 types this way, with
saglik-bulgusu, teknik-karar and bug-pattern sitting next to karar. At
that point nothing can be filtered, because no two entries agree on what a type
means.
Unknown relation types are rejected, not warned about
Canonical vocabulary: supports, contradicts, evolved_into, depends_on,
exemplifies, part_of, caused_by, enables, supersedes, related_to,
investigates, informs, uses.
Close synonyms fold automatically — connected_to → related_to, aspect_of →
part_of. Anything else raises.
An earlier version accepted unknown types with a warning. Nothing acted on the warning and 56 one-off types accumulated. A warning that lets the write through is a decision to allow it, written in the voice of disapproval.
Epistemic status defaults to unknown
assertion, hypothesis, speculation — or unknown when unstated.
unknown is deliberate. If a session did not establish something, recording it
as an assertion promotes a claim nobody made. The migration follows the same
rule: 144 entities with no epistemic field became unknown, not assertion.
Revise, do not delete
The old observation is marked invalidated, dated, and linked to what replaced it. Delete tools exist but sit outside the default agent-facing profiles: an archive that forgets its own reversals cannot answer the question it was kept for.
Decisions record what was rejected
record_decision stores decided, because, and rejected as separately
queryable observations. The rejected alternatives are the part worth keeping —
what was chosen stays readable in the code forever, what was considered and
dropped exists nowhere else. That is the question that gets asked six months
later.
MCP tools
Tool definitions sit in the context window from the first token of a session, so the surface is a standing cost rather than a per-call one. Profiles load only what a given step needs.
A tool outside the active profile stays an ordinary function — reachable from the CLI and from tests. It simply is not in front of an agent that will not call it.
Search
Graph — reading
Graph — writing
record() validates the whole batch before writing any of it. A half-valid
batch writes nothing — a graph left in a state nobody asked for is worse than a
rejected write. Relations may only point at entities that already exist or are
created in the same call.
Every tool carries MCP annotations (readOnlyHint, destructiveHint,
idempotentHint), so a host can tell deletion apart from search.
Architecture
Everything runs locally. The vault is plain markdown with YAML frontmatter — open it in Obsidian to browse visually, no plugins needed.
Why JSONL for the graph
Human-readable, git-diffable, no dependency. You can open it, read it, and see a meaningful diff when it changes — which matters for something meant to hold your reasoning.
The tradeoff is load time: the whole file is parsed per read. Fine at a few hundred entities, slower as it grows. Past tens of thousands, SQLite is the obvious next step.
Session lifecycle
/rtclose exports the conversation to clean markdown, extracts entities and
relations through record(), writes a project-scoped handoff, and updates
MEMORY.md.
The lifecycle commands currently require Claude Code. The search and graph tools work with any MCP client.
Configuration
Vocabularies — ENTITY_TYPES, DOMAINS, RELATION_TYPES, RELATION_ALIASES —
live in rawthink_mcp/config.py. Adding a domain is a one-line change.
Customization
CLAUDE.md — the thinking companion's role, tone and modes.
THINKING_DIRECTIVES.md — discipline for the partnership. Every rule was
written after failing at it. Add your own; the only bad version of that file is
one followed without understanding why each rule exists.
Both are copied into your vault by rawthink-install. If you edit the repo
copies, run python scripts/check_templates.py — the installer embeds them, and
two copies of one document drift silently.
Known limitations
Stated plainly, because a README that lists only strengths is not much use.
Ollama being unavailable degrades to sparse-only. The embedding cache helps repeated queries; it is not a fallback. Retrieval quality drops noticeably.
Graceful shutdown is POSIX-only. Signal handlers release the Qdrant
directory lock and the graph file lock on SIGINT/SIGTERM. Windows has no real
SIGTERM — a terminating client calls TerminateProcess and no handler runs — so
a hard stop there can leave a lock behind. Ctrl-C still unwinds, and
rawthink-doctor reports the stale lock.
Load time grows with the graph. The whole JSONL is parsed on the first read after a change. Subsequent reads reuse a cache keyed on (mtime, size).
Search quality has not been benchmarked at scale. The retrieval numbers
that used to be here were never re-measured, so they were removed rather than
carried forward. tests/search_quality.py runs against a synthetic vault and
reports MRR/nDCG; point RAWTHINK_EVAL_GT at your own evaluation set for a
number that means something for your data.
Roadmap
Next — graph visualisation, MCP-native session lifecycle so the close command is not Claude Code specific, support for more MCP clients, and a retrieval benchmark that runs on data anyone can regenerate.
Contributing
Issues and pull requests welcome.
If you change the schema, change config.py, the migration in migrate.py, and
the session-close instructions together. They are three views of one contract,
and they drift apart quietly when they are not edited as a set.
docs/postmortem-bm25-term-drift.md is the clearest example — a defect that
looked fine from every angle until someone evaluated the two retrievers
separately.
License
MIT
來源:README.md,提交 57615a9
工具
0版本歷史
1- v2.0.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分