Chatvault

io.github.CloudCorpRecords由 GitHub 账号 CloudCorpRecords 发布v0.1.0更新于 Nov 7, 2026

Search and read your local AI chat-history corpus: full-text search, transcripts, inventory.

概览

AI 生成的概览

搜索并读取本地 AI 聊天记录 JSON 语料库,让助手在不外传历史的前提下查找、重开和盘点过往对话。

可以做什么
  • 按全文搜索对话,支持平台、标题、日期与匹配模式筛选,返回排序后的片段
  • 按 id 读取完整对话记录,或取出某条消息中保留的图片
  • 按时间顺序或最近更新列出对话,并分页浏览含 id、平台、标题与指纹的紧凑清单
  • 报告语料库状态:最近一次收到数据的时间与对话数量
  • 新增或更新对话,并记录一条长期记忆事实(默认停用,待审阅后启用)
适用场景
适合把导出的 AI 聊天记录以 JSON 形式保存在本机、并希望助手检索这些记录、重开早前讨论或在回答前确认已有历史的场景。它是本地索引,而非连接在线聊天服务的接口。
运行要求
通过 npx 或 Docker 以 stdio 在本机运行。可选环境变量 CHATVAULT_CORPUS_DIR 指定语料库目录(默认 ~/.chatvault/corpus);可选 CHATVAULT_READ_ONLY=1 关闭两个写入工具。无需账号、API 密钥或网络访问。
安装前请注意
语料库包含私密聊天记录,助手可读取其中的对话与保存的图片。有两个工具会写入语料库:save_conversation 新增或更新对话,save_memory 向 memories.json 追加事实;若只想只读使用,请设置 CHATVAULT_READ_ONLY=1。保存的记忆默认停用,需你审阅后启用。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Chatvault,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

chatvault

Your past AI chats are already on your disk. chatvault lets an MCP client search them, reopen them, and take stock of them — without any of that history leaving the machine. There is no account, no upload and no network call: the server reads a folder of JSON files that you control.

Configuration

  • CHATVAULT_CORPUS_DIR (optional) — where the corpus lives. Defaults to ~/.chatvault/corpus.
  • CHATVAULT_READ_ONLY (optional) — set to 1 to make the two write tools (save_conversation, save_memory) refuse with an error naming the mode. Reads keep working.

Corpus layout

One JSON file per conversation, plus memories.json:

json
{  "id": "abc",  "platform": "claude",  "title": "Planning a trip",  "updatedAt": "2026-10-01T12:00:00.000Z",  "messages": [    { "role": "user", "text": "Where should we go?" },    { "role": "assistant", "text": "Some ideas..." }  ]}

A message may also carry formattedText and images ({mime, dataBase64} entries holding retained image bytes). A conversation may carry a localTitle. An empty or missing corpus directory is fine: searches and lists simply come back empty.

Every conversation has a content fingerprint, fp2: followed by a SHA-256 hex digest. The digest covers the title, the local title when set, and every message in order — its index, role, text, formatted text when present, and each image's mime and retained bytes. Timestamps and derived fields are left out, so re-saving the same content keeps the same fingerprint while a rename or an edited message changes it. The exact serialisation (canonical JSON with sorted keys) is a labelled reconstruction.

Tools

  • search_conversations — tokenised full-text search over titles and message text. Required: query. Optional: platform (exact match), title (substring), date_from and date_to (against updatedAt), and match_mode — any (default), all, or phrase. Results are ranked by match count, then recency, and carry snippets.
  • get_conversation_image — the stored image for a message. Required: conversation_id, message_index, image_index. Returns the mime type and base64 bytes; a missing image is an honest error.
  • get_conversation — the full transcript for id, with a contentFingerprint field.
  • list_conversations — conversations by updatedAt. Optional order (newest_first default, or oldest_first) and limit.
  • list_recent — most recently updated conversations with title, a short summary (an excerpt of the first user message — a reconstruction), and platform. Optional limit.
  • conversation_inventory — a snapshot-paged inventory of compact {id, platform, title, fingerprint} items. Call with no arguments to start a scan, then pass each page's nextCursor back as cursor. Pages hold at most 100 items; limit can make them smaller. At most eight snapshots are held, and an unknown or expired cursor is an error asking you to start a new scan.
  • corpus_status — {lastReceivedAt, count} for the corpus; lastReceivedAt is null when the corpus is empty.
  • save_conversation — add or update a conversation. Required: platform, title, messages. When id is omitted one is assigned (chatvault:<n>). Returns {id, fingerprint}.
  • save_memory — store a durable fact from text. The record is appended to memories.json turned off (enabled: false) until you review and enable it, and the stored record is returned.

Search and list results also carry a corpus block — {lastReceivedAt, count} — so a caller can tell how fresh and how large the corpus behind an answer is.

CLI

bash
npx @reneturcios/chatvault corpus_status '{}'npx @reneturcios/chatvault search_conversations '{"query":"trip"}'npx @reneturcios/chatvault --version

Output is the tool's result text. Exit codes: 0 on success, 1 on an error result, 2 on a usage error.

MCP server

bash
npx -y @reneturcios/chatvault mcp

MCP client config:

json
{  "mcpServers": {    "chatvault": {      "command": "npx",      "args": ["-y", "@reneturcios/chatvault", "mcp"],      "env": {        "CHATVAULT_CORPUS_DIR": "/path/to/corpus"      }    }  }}

Docker

bash
docker run -i -v /path/to/corpus:/corpus -e CHATVAULT_CORPUS_DIR=/corpus ghcr.io/cloudcorprecords/chatvaultdocker run --rm ghcr.io/cloudcorprecords/chatvault --version

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # tsx --test test/*.test.ts (temp corpus dirs, no network)npm run dev     # run the CLI from source

License

MIT — Copyright (c) 2026 Rene Turcios

来源:README.md,提交 e985e46

工具

9

search_conversations

Full-text search across every past conversation. Returns ranked matches with highlighted snippets. Supports platform, title, date_from/date_to filters and a match_mode (any / all / phrase).

输入参数query必填titledate_toplatformdate_frommatch_mode

get_conversation_image

Read a retained local raster image using the message and image index returned by get_conversation. No private provider URL fetching or OCR.

输入参数image_index必填message_index必填conversation_id必填

get_conversation

Fetch the full transcript of one conversation by its id (the id field from search results). The response carries contentFingerprint, the current fingerprint of the returned transcript.

输入参数id必填

list_conversations

List conversations by chronology, including oldest-first for questions about the user's earliest chat.

输入参数limitorder

list_recent

List the most recently updated conversations with title, summary, and platform.

输入参数limit

conversation_inventory

Paginated, read-only inventory of every conversation as compact metadata: id, platform, title, and a versioned content fingerprint. Call with no arguments to start a scan, then pass each page's nextCursor back as cursor until a page comes back without one. Pages hold up to 100 items.

输入参数limitcursor

corpus_status

Report when the corpus last received data and how many conversations it holds.

无需输入参数。

save_conversation

Add or update a conversation in the corpus, so MCP is also an ingestion route.

输入参数idtitle必填messages必填platform必填

save_memory

Record a durable fact (a decision, preference, or correction) worth carrying into later chats. Stored turned off until the user reviews and enables it.

输入参数text必填

版本历史

1
  1. v0.1.0最新Nov 4, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分