ai-chat-memory
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ai-chat-memorywhat did I say last time about API design?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ai-chat-memory
AIとの会話で自分が打った言葉を、どのAIからも引ける「自分専用の記憶」にする。
Codex や Claude Code に毎日打っている言葉には、自分の目的・判断基準・好み・やめたことが一番濃く残っています。 でもそれは各アプリのログに散らばったままで、次のAIには引き継がれません。
ai-chat-memory はそのログから 自分の発言だけ を取り出し、3つの層に整理して、MCP でどのAIからも読めるようにします。
L2 テーマ索引 テーマごとの「現在地・方針・変遷・未解決」 ← AIはここから読む
↑
L1 会話の要約 会話1本ごとの「目的・決めたこと・未解決」
↑
L0 自分の発言 打った言葉そのもの(全文検索できる) ← 根拠はここで確かめる依存ライブラリなし(Python 3.10+ と SQLite だけ)
全部ローカル。要約は手元の Ollama のモデルで作る。外には何も送らない
読み取り専用の MCP サーバー付き。Claude Code / Codex / Claude Desktop などから使える
なぜ作ったか
2か月で「自分専用AI」のための仕組みを25個作り、ほとんど使わずに終わりました。 残ったのは「手間ゼロで勝手に溜まるもの」だけでした。記録を書く仕組みは続かない。でもAIとは毎日話している。 なら、その会話そのものを記憶にすればいい、というのがこのツールです。
Related MCP server: Rapport MCP Server
使い方
pipx install git+https://github.com/jibun-opt-log/ai-chat-memory
aimemory import # Codex / Claude Code のログから自分の発言を取り込む(何度実行しても重複しない)
aimemory distill # 会話の要約とテーマ索引を作る(Ollama が必要)
aimemory stats
aimemory search "画像生成" # 自分で引く要約のモデルは --model(既定 qwen3.5:9b)、Ollama の場所は --ollama で変えられます。
データは ~/.aimemory/memory.sqlite(--db か AIMEMORY_DB で変更可)。
AIから使う(MCP)
# Claude Code
claude mcp add --scope user ai-chat-memory -- aimemory mcp# Codex (~/.codex/config.toml)
[mcp_servers.ai-chat-memory]
command = "aimemory"
args = ["mcp"]ツールは list_topics → get_topic → list_episodes → search_messages / get_session の順に、上の層から下りていく作りです。
AIへの指示ファイル(CLAUDE.md / AGENTS.md)に「自分の過去の判断が関係する質問では ai-chat-memory を上の層から引く」と一行書いておくと効きます。
自動で回す(macOS)
1時間ごとに aimemory import、毎晩 aimemory distill を launchd や cron で回せば、あとは普段どおりAIと話すだけで溜まっていきます。
何を取り込み、何を捨てるか
取り込む | 捨てる |
自分が手で打ったメッセージ | AIの返答、ツールの出力 |
サブエージェント・承認レビュー・ | |
アプリが差し込む文脈( | |
「ok」などの短い相づち、複数の会話で同じ文面(テンプレートやbotの指示) |
APIキーやトークンらしい文字列は
[redacted]に置き換えます(パターン照合なので完全ではありません)。自分のスクリプトが
claude -pなどで投げる指示は、--skip-prefix "その文の書き出し"で除外できます。スクリプト側でclaude -p --no-session-persistenceを使えば、そもそもログに残りません。
注意
要約はモデルが作るので、読み違えます。 事実として扱う前に L0 の原文を確かめてください(MCP の説明にもそう書いてあります)。
MCP でつないだAIがクラウドのモデルなら、引いた部分はそのモデルに渡ります。元々そのAIに打った内容ですが、どのAIにつなぐかは自分で選んでください。
対応しているログは Codex(
~/.codex/sessions)と Claude Code(~/.claude/projects)です。形式が変わると読めなくなることがあります。
English (short)
Turns the messages you typed to Codex and Claude Code into a local, three-layer memory — raw messages → per-conversation summaries → per-theme index — and serves it read-only over MCP so any AI can read you top-down. Stdlib only, summaries by a local Ollama model, nothing leaves your machine.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Personal knowledge graph as an AI memory layer over MCP - read, save, and link your memories.
Cross-AI personal memory. Save once in ChatGPT, recall in Claude, Mistral, Grok, or any MCP client.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Persistent personal memory for AI assistants — save, search, and recall across every MCP client.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides persistent, local-first AI memory across sessions via MCP tools for storing, searching, and retrieving context from past interactions.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to query local conversation transcripts and relationship data via a local MCP server, allowing retrieval of past conversations and facts about people.1AGPL 3.0
- AlicenseNot gradedqualityBmaintenanceEnables AI tools to query a user's private, locally stored memories (notes, documents) with source citations, using the MCP protocol.12 npmMIT
- AlicenseNot gradedqualityBmaintenanceExposes a private social memory archive to AI assistants via MCP, enabling read-only queries about the user's posts, people, and preferences with tools like search, whoami, and timeline.MIT