Logo MyChatArchive

MyChatArchive

Cộng đồng
1ch1n

Local-first AI memory archive. Import ChatGPT, Claude, and Grok exports, generate semantic embeddings, and search via MCP server. Zero cloud, zero cost.

Nhà phát hành1ch1n
Kho mãmychatarchive
Ngôn ngữPython
Bản fork
16
Sao
66
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    MyChatArchive cung cấp các chức năng MCP cho các ứng dụng khách AI và tác nhân AI tương thích.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Mẫu cấu hình có thể sao chép ngay

    Dùng các đoạn cấu hình mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Mức độ quan tâm của cộng đồng đến kho mã

    66 sao và 16 bản fork từ kho mã được liên kết.


Import your chat exports from ChatGPT, Claude, Grok, Claude Code, and Cursor. Generate vector embeddings locally with sentence-transformers. Expose everything via an MCP server that any AI tool can query.

Open core: The local pipeline (import, embed, summarize, search, MCP server) is free and AGPL-licensed. Cloud sync and hosted MCP are on the roadmap at mychatarchive.com.


Why MyChatArchive

Your archive, searchable. Drop your ChatGPT, Claude, or Grok exports into the import folder, or let MyChatArchive auto-discover Claude Code and Cursor sessions from your machine. Full transcripts, local embeddings, MCP server. No cloud required.

LosslessFull message transcripts, not extracted summaries. You can always search the original.
Local-firstSingle SQLite file. Embeddings run on your machine. Core needs no API keys.
Developer-nativeAuto-discovers Claude Code sessions and Cursor conversations from your local machine on day one.
MCP serverClaude Desktop, Cursor, Claude Code, and any MCP client can search your archive.

Quick Start

bash
git clone https://github.com/1ch1n/mychatarchive.git
cd mychatarchive
pip install .

# 1. Set up (creates drop folder, configures auto-discovery)
mychatarchive init

# 2. Import everything in one command
#    Auto-discovers Claude Code + Cursor, scans your drop folder
mychatarchive sync

# 3. (Optional) Generate thread summaries for richer context retrieval
#    Needs an API key: set OPENROUTER_API_KEY or ANTHROPIC_API_KEY
mychatarchive summarize

# 4. Generate local embeddings
mychatarchive embed

# 5. Start the MCP server
mychatarchive serve

Then connect from Claude Desktop or Cursor: run mychatarchive mcp-config and add the output to your client config. That's it.


What You Get

Once the MCP server is running, any connected AI tool can call:

ToolWhat it does
search_brainSemantic search by meaning across all conversations
search_recentRecent conversations and captured thoughts by time range
get_contextFull context bundle for a topic: related threads, LLM summaries, thoughts
capture_thoughtSave a thought or note with auto-embedding for future retrieval
get_profileSnapshot of your recent focus areas, thread summaries, and thoughts
get_current_datetimeCurrent UTC datetime, injected into every tool response

All search tools support filtering by platform, time range (hours_back, since), and thread group. Sort by relevance or recency.

Example: Ask Claude "What did I decide about the database architecture last month?" and it searches your actual conversation history semantically.


Installation

From source (recommended for now)

bash
git clone https://github.com/1ch1n/mychatarchive.git
cd mychatarchive
pip install .

Development install

bash
pip install -e ".[dev]"

Requirements

  • Python 3.10+
  • ~500MB disk for the embedding model (downloaded once, runs locally)
  • No API keys needed for: sync, embed, search, serve
  • summarize uses an LLM API for thread summaries (optional but recommended for get_profile)

The Pipeline

Full workflow:

bash
mychatarchive sync           # import from all sources
mychatarchive summarize      # LLM thread summaries (optional, needs API key)
mychatarchive embed          # generate vector embeddings locally
mychatarchive serve          # start MCP server

Shortcut:

bash
mychatarchive sync --embed   # sync + embed in one shot
mychatarchive serve

The pipeline is incremental. Re-run sync any time -- SHA1 dedup means it's always safe. New messages get embedded on the next embed run without --force.


Sync

bash
mychatarchive sync           # import from all sources
mychatarchive sync --embed   # sync + generate embeddings in one shot

sync imports in three layers:

  1. Auto-discovery -- Claude Code sessions (~/.claude/projects/) and Cursor conversations from local databases. Enabled by default, toggleable in init.
  2. Drop folder -- anything in ~/.mychatarchive/imports/. Drop your ChatGPT, Claude, or Grok export JSON here; format is auto-detected. Subdirectories scanned recursively.
  3. Named sources -- custom paths or NAS shares you've configured with mychatarchive sources add.

All three deduplicate into the same archive via SHA1 hashing.

Note: Auto-discovery covers Claude Code (the terminal agent) and Cursor. Claude web, mobile, and desktop app conversations require a manual export from Anthropic's settings -- drop the file in your imports folder and run sync.


Summarize

Generate LLM thread summaries for richer context retrieval and the get_profile MCP tool.

bash
mychatarchive summarize                              # default model via OpenRouter
mychatarchive summarize --model gpt-4o-mini          # specify model
mychatarchive summarize --key sk-...                 # pass API key inline
mychatarchive summarize --limit 50                   # process first 50 threads (for testing)

Summaries are stored in SQLite, embedded into their own vector index, and surfaced by get_context and get_profile. Without summaries, get_profile falls back to recent message chunks.

API key: Set OPENROUTER_API_KEY (default) or ANTHROPIC_API_KEY, or pass --key inline.


Thread Groups

Organize threads into named groups for scoped search and context retrieval. Useful when your archive mixes personal conversations, coding work, and project threads -- you can scope search to exactly what's relevant.

bash
# Create groups
mychatarchive groups create jarvis --description "Daily personal chats"
mychatarchive groups create coding --description "Dev work and technical threads"

# Browse threads to find IDs
mychatarchive groups show jarvis

# Add threads
mychatarchive groups add jarvis <thread_id> <thread_id>

# Scope search to a group
mychatarchive search "what did I decide" --group jarvis

# In MCP tools: search_brain(query="...", group="jarvis")

The group filter works on search_brain, get_context, get_profile, and the search CLI.


Sensitivity Levels

Years of chat history contain things an agent should not surface on any random turn -- sensitive work, personal matters, private notes. Classify threads into three levels and the archive enforces them in the data access layer:

LevelBehavior
publicDefault. Returned by every search and MCP tool.
privateReturned only when a caller explicitly opts in (include_private on MCP tools, --include-private on the CLI).
sealedNever returned by the MCP server, under any circumstances. CLI-only, and only with an explicit --include-sealed flag.
bash
# See where you stand
mychatarchive classify --list

# Classify one thread (applies immediately)
mychatarchive classify --thread <id> --level private

# Bulk-classify by keyword -- previews first, applies only with --confirm
mychatarchive classify --query "project-x" --level sealed
mychatarchive classify --query "project-x" --level sealed --confirm

# Bulk-classify old threads (last message before a date)
mychatarchive classify --before 2022-01-01 --level private --confirm

# Search honors levels
mychatarchive search "query"                    # public only
mychatarchive search "query" --include-private
mychatarchive search "query" --include-sealed   # prints a warning

Details worth knowing:

  • Enforcement lives in the data access layer, not in tool handlers. A retrieval call that doesn't name a scope fails closed to public -- including third-party integrations that use mychatarchive.db directly.
  • Bulk classification is thread-scoped: one matching message classifies the whole conversation, which is how sensitivity works in practice.
  • mychatarchive summarize (the one command that sends content to an external LLM API) summarizes public threads only by default; --include-private opts in, and sealed threads never leave the machine.
  • Re-running sync on a classified thread is safe: newly imported messages inherit the thread's level before anything can read them.
  • Existing archives migrate automatically on first use -- every row defaults to public, and a verified backup (*.pre-v3-*.backup.sqlite) is written next to the database before the schema changes.
  • Sealed content is hidden, not encrypted: the text still exists in the SQLite file, its FTS index, and its vectors. Protect the file itself with filesystem permissions. Encryption at rest is a possible future addition.

Search from the CLI

bash
mychatarchive search "database architecture decisions"
mychatarchive search "python error handling" --mode keyword
mychatarchive search "auth flow" --platform claude_code --group coding
mychatarchive search "what did I build" --hours 168 --sort time
mychatarchive search "api design" --since 2026-01-01

Default mode is semantic (vector search). Supports: --mode keyword for FTS, --platform for source filter, --hours / --since for time filter, --sort time for newest-first, --group for group filter.


Export

bash
mychatarchive export archive.json           # full structured export
mychatarchive export archive.csv            # spreadsheet-friendly
mychatarchive export archive.db             # full SQLite copy with embeddings
mychatarchive export chatgpt.json --platform chatgpt
mychatarchive export everything.json --include-thoughts

Connecting to AI Tools

Claude Desktop

bash
mychatarchive mcp-config --client claude-desktop

Add the output to your config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Cursor

bash
mychatarchive mcp-config --client cursor

Add the output to your Cursor MCP settings.

Remote access via SSE

For mobile or multi-device access, run the server on a NAS or always-on machine:

bash
mychatarchive serve --transport sse --port 8420

Connect via Tailscale or WireGuard from any device. Works with Claude mobile and any MCP client that supports remote servers.


Check Archive Stats

bash
mychatarchive info
MyChatArchive - ~/.mychatarchive/archive.db
----------------------------------------
  Messages:    47,832
  Threads:     1,204
  Summaries:   1,204
  Embedded:    51,388 chunks
  Thoughts:    12
  Groups:      3
  Platforms:
    chatgpt: 38,541
    anthropic: 8,291
    grok: 1,000

How It Works

Auto-discovery (Claude Code, Cursor)  --+
Drop folder (ChatGPT, Claude, Grok)   --+--> Parse + SHA1 dedup --> SQLite (FTS5)
Named sources (NAS, custom paths)     --+              |
                                                       v
                                           sentence-transformers (local)
                                                       |
                                                       v
                                           sqlite-vec (cosine KNN)
                                                       |
                                                       v
                                           MCP server (stdio / SSE)
                                                       |
                                          Claude Desktop / Cursor /
                                          Claude Code / Claude Mobile

Stack

ComponentTechnology
StorageSQLite + FTS5 (full-text) + sqlite-vec (vectors)
Embeddingssentence-transformers all-MiniLM-L6-v2 (384 dim, local)
SummarizationAny OpenAI-compatible API (OpenRouter default, Anthropic fallback)
InterfaceMCP server (stdio + SSE transport)
DeduplicationSHA1-based stable message IDs
CLIPython argparse + rich

Data stays local

  • Embeddings run locally. No OpenAI, no cloud.
  • Database is a single SQLite file at ~/.mychatarchive/archive.db.
  • MCP server runs over stdio by default (local pipe, no network).
  • summarize is the only step that makes outbound API calls. It's optional.

CLI Reference

CommandDescription
mychatarchive initInteractive setup (drop folder, auto-discovery, backends)
mychatarchive syncImport from all sources (auto + drop folder + named)
mychatarchive sync --embedSync + generate embeddings in one shot
mychatarchive import <file|dir>Import a single file or directory
mychatarchive import --from <name>Import from a named source
mychatarchive sources add <name> <path>Add a named import source
mychatarchive sources listShow all sources (auto + drop + named)
mychatarchive sources remove <name>Remove a source
mychatarchive sources rename <old> <new>Rename a source
mychatarchive summarizeGenerate LLM thread summaries (needs API key)
mychatarchive groups listList all thread groups
mychatarchive groups create <name>Create a thread group
mychatarchive groups add <group> <ids...>Add threads to a group
mychatarchive groups show <name>Show threads in a group
mychatarchive groups delete <name>Delete a group (threads are not deleted)
mychatarchive classify --listShow sensitivity counts per level
mychatarchive classify --thread <id> --level <l>Classify a thread (public/private/sealed)
mychatarchive classify --query <text> --level <l> --confirmBulk-classify threads by keyword
mychatarchive classify --before <date> --level <l> --confirmBulk-classify threads by age
mychatarchive embedGenerate vector embeddings
mychatarchive export <output>Export to JSON, CSV, or SQLite copy
mychatarchive serveStart MCP server
mychatarchive search <query>Search from the terminal
mychatarchive infoShow archive statistics
mychatarchive mcp-configPrint MCP client configuration

All commands accept --db /path/to/archive.db to override the default database location.


Project Structure

mychatarchive/
+-- src/mychatarchive/
|   +-- cli.py              # Unified CLI
|   +-- config.py           # Paths, constants, config management
|   +-- db.py               # Data access layer (delegates to backends)
|   +-- embeddings.py       # Local embedding pipeline
|   +-- chunker.py          # Message chunking for embeddings
|   +-- ingest.py           # Import engine with SHA1 dedup
|   +-- summarizer.py       # LLM thread summarization pipeline
|   +-- parsers/
|   |   +-- chatgpt.py      # ChatGPT conversations.json
|   |   +-- anthropic.py    # Claude export format
|   |   +-- grok.py         # Grok/X.AI export format
|   |   +-- claude_code.py  # Claude Code JSONL sessions
|   |   +-- cursor.py       # Cursor IDE SQLite databases
|   +-- backends/           # Pluggable storage, embeddings, transport
|   +-- mcp/
|       +-- server.py       # MCP server (6 tools)
+-- tests/
+-- pyproject.toml
+-- ROADMAP.md

Adding a New Parser

Create src/mychatarchive/parsers/yourplatform.py:

python
from typing import Iterator

def parse(input_path: str) -> Iterator[dict]:
    """Yield normalized messages."""
    yield {
        "thread_id": "unique-thread-id",
        "thread_title": "Conversation Title",
        "role": "user",
        "content": "Message text",
        "created_at": 1700000000.0,
    }

Register it in src/mychatarchive/parsers/__init__.py.


Default Data Location

~/.mychatarchive/
+-- archive.db          # SQLite database (messages + vectors + thoughts)
+-- config.json         # Backend + source configuration
+-- imports/            # Drop folder for export files

Override with --db /path/to/your.db on any command, or set a custom drop folder path in init.


Roadmap

  • Multi-platform import (ChatGPT, Claude, Grok, Claude Code, Cursor)
  • Local vector embeddings (sentence-transformers, no API)
  • MCP server: search_brain, search_recent, get_context, capture_thought, get_profile, get_current_datetime
  • Thread summaries via any OpenAI-compatible API (mychatarchive summarize)
  • Thread groups with group-scoped search (mychatarchive groups)
  • Platform, time, and group filters on search and all MCP tools
  • Pluggable backend architecture (storage, embeddings, transport)
  • Export (JSON, CSV, SQLite copy)
  • SSE transport for remote MCP access
  • One-command sync with auto-discovery + drop folder + named sources
  • Sensitivity levels: public / private / sealed with fail-closed retrieval (mychatarchive classify)
  • Additional parsers (Gemini, Perplexity, Copilot)
  • Grouping UI (browse threads and assign to groups without knowing thread IDs)
  • Analysis engine (deep prompts against your full archive)
  • Auto-sync (no manual exports needed)
  • PyPI publish
  • Web dashboard + hosted option at mychatarchive.com
  • Docker image for one-command self-hosting

See ROADMAP.md for the full phased plan.


Open Core

Tier
Import, embed, summarize, groups, MCP server (stdio)Free / local (AGPL-3.0)
SSE transport with auth, cloud sync, hosted MCP, teamsPlanned at mychatarchive.com

The principle: anything that runs on your machine is free. Anything that requires infrastructure is paid.

Licensing: Local and self-hosted use is free under AGPL-3.0. Commercial use or offering MyChatArchive as a hosted service requires a commercial license. Contact channing@mychatarchive.com for commercial licensing.


License

AGPL-3.0 -- see LICENSE.


Cài đặt

TypingMind
Yêu cầu:

Node.js 18+

{
  "mcpServers": {
    "1ch1n-mychatarchive": {
      "command": "uvx",
      "args": [
        "mychatarchive"
      ]
    }
  }
}

Dùng MCP MyChatArchive với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối MyChatArchive, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Thiết lập trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Thiết lập trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh thiết lập trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Để tiến trình tiếp tục chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Để tiến trình tiếp tục chạy trong cửa sổ Terminal khi bạn dùng các công cụ MCP.
3

Thêm MyChatArchive làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của MyChatArchive.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "1ch1n-mychatarchive": {
      "command": "npx",
      "args": [
        "-y",
        "mychatarchive"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của MyChatArchive, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của MyChatArchive.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện trên TypingMind dùng các công cụ MCP đã bật với mô hình AI đã chọn
Bạn có thể dùng MyChatArchive giúp tôi làm việc này không?
MyChatArchive
Được. Tôi đọc rồi.
Đây là kết quả tôi tìm được bằng MyChatArchive.

Câu hỏi thường gặp

Máy chủ MCP MyChatArchive dùng để làm gì?

MyChatArchive là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP MyChatArchive với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng MyChatArchive với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP MyChatArchive với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối MyChatArchive, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP MyChatArchive với TypingMind?

MyChatArchive hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP MyChatArchive cung cấp những công cụ nào trong TypingMind?

MyChatArchive cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP MyChatArchive không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu MyChatArchive yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇