Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ node_modules/
dist/
.env
.env.*
data/*.db
data/*.db-shm
data/*.db-wal
data/*
models/
*.tsbuildinfo
.claude/settings.local.json
*.draft.*.md
.claude/agent-memory/
docs/launch
docs/launchgcp-tts-key.json
gcp-tts-key.json
11 changes: 11 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@
- CLAUDE.md のドキュメント一覧に漏れがないか
- リンクが正しいパスを指しているか

### README同期ルール

**`README.md` と `README.ja.md` は常に同期させること。**

片方を変更したときは、必ずもう片方にも対応する変更を反映する:
- 新機能の説明を追加 → 両方に追加
- セットアップ手順を変更 → 両方に反映
- 構成やリンクを修正 → 両方に反映

どちらか片方だけ更新して放置しない。

### API変更時のルール

**`packages/server/src/routes/` 以下のファイルを変更するときは、必ず `docs/spec/openapi.yml` も確認・更新すること。**
Expand Down
32 changes: 32 additions & 0 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,38 @@ docker compose up

`http://localhost:5173` を開く — 最初のインタビューセッションを始めよう。

### オプション:音声対話モードを有効化

音声ベースのインタビューセッション(タイピングの代わりに話す)を使いたい場合は、Google Cloud Text-to-Speechをセットアップします:

1. **GCPプロジェクトを作成してAPIを有効化**
- [Google Cloud Console](https://console.cloud.google.com/) にアクセス
- 新しいプロジェクトを作成(または既存のものを使用)
- API ライブラリで **Cloud Text-to-Speech API** を有効化
- **無料枠**:月間100万文字 — 通常の使用には十分

2. **サービスアカウントを作成して認証情報をダウンロード**
- **IAMと管理 → サービスアカウント** に移動
- 以下のロールでサービスアカウントを作成:**Cloud Text-to-Speech Client**(開発用ならEditorでも可)
- JSONキーを生成してダウンロード

3. **キーファイルを配置してDockerを設定**
```bash
# キーをプロジェクトルートに配置
mv ~/Downloads/your-key-*.json ./gcp-tts-key.json

# .gitignoreに追加(デフォルトで含まれています)
echo "gcp-tts-key.json" >> .gitignore
```

4. **Dockerを再起動**
```bash
docker compose down
docker compose up
```

インタビューセッションで音声対話ボタン(🎧)が有効になります。GCP認証情報がない場合、ボタンは無効のままでテキストのみモードが使用されます。

---

## 仕組み
Expand Down
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,38 @@ docker compose up

Open `http://localhost:5173` — start your first interview session.

### Optional: Enable Voice Dialogue Mode

If you want to use voice-based interview sessions (speak instead of typing), set up Google Cloud Text-to-Speech:

1. **Create a GCP project and enable the API**
- Go to [Google Cloud Console](https://console.cloud.google.com/)
- Create a new project (or use an existing one)
- Enable **Cloud Text-to-Speech API** in API Library
- **Free tier**: 1 million characters/month — enough for typical usage

2. **Create a service account and download credentials**
- Go to **IAM & Admin → Service Accounts**
- Create a service account with role: **Cloud Text-to-Speech Client** (or Editor for dev)
- Generate a JSON key and download it

3. **Place the key file and configure Docker**
```bash
# Place the key in project root
mv ~/Downloads/your-key-*.json ./gcp-tts-key.json

# Add to .gitignore (already included by default)
echo "gcp-tts-key.json" >> .gitignore
```

4. **Restart Docker**
```bash
docker compose down
docker compose up
```

The voice dialogue button (🎧) will now be enabled in interview sessions. Without GCP credentials, the button remains disabled and text-only mode is used.

---

## How It Works
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ services:
- ./packages:/app/packages
- ./data:/app/data
- ./models:/app/models
- ./gcp-tts-key.json:/app/gcp-tts-key.json:ro
# node_modules はコンテナ内のものを使う(ホストと共有しない)
- /app/node_modules
- /app/packages/server/node_modules
Expand All @@ -21,6 +22,7 @@ services:
- NODE_ENV=development
- DB_PATH=/app/data/personal_context.db
- SIMULATE_DB_PATH=/app/data/simulate.db
- GOOGLE_APPLICATION_CREDENTIALS=/app/gcp-tts-key.json
# Set WATCH=true to enable hot-reload (may cause instability on macOS due to polling)
# - WATCH=true
# - CHOKIDAR_USEPOLLING=true
Expand Down
77 changes: 77 additions & 0 deletions docs/launch/PROMO_POSTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Launch Posts for International Platforms

Use these templates to launch your project on Hacker News and Reddit. They are written to highlight the core philosophy of "Personal Context Engine" and the pain point of LLM lock-in.

---

## 1. Hacker News (Show HN)

**Title:** Show HN: Personal Context Engine – Own your context across all LLMs

**Body / First Comment:**

Hi HN,

I built the Personal Context Engine because I was tired of rewriting my background every time I switched between ChatGPT, Claude, and Cursor. Every major platform now has a "memory" feature, but our context is trapped inside each one.

Worse, most LLMs don't truly *know* you even with memory. They store what you *tell* them, which is often a filtered, rationalized version of yourself. The gap between "what you say about yourself" (e.g., "value: freedom") and "how you actually behave" is where the real signal lives.

So I built a local-first engine that builds your context from the outside in:
1. **Passive Interview:** It acts as an interviewer, asking behavior-based questions (e.g., "Where did your time and money go this week?" or "What made your body feel light?").
2. **Vignette Extraction:** Instead of extracting generic labels, the local LLM extracts specific scenes (vignettes).
3. **Portable Markdown:** It exports your entire identity into plain Markdown files layered by depth (Core, Shape, State).

You can paste these Markdown files into any system prompt or use the included **MCP (Model Context Protocol) Server** to connect it directly to Claude Desktop, Cursor, or any supported AI tool.

No cloud lock-in, just plain text. I'd love to hear your thoughts on this approach to personal data portability and AI memory!

Repo: https://github.com/uchidayuma/personal_context
Live Demo: https://personal-context.onrender.com/ (No install required)

---

## 2. Reddit: r/LocalLLaMA

**Title:** I got tired of LLM memory lock-in, so I built a local engine that interviews you and exports your "Context" as Markdown (and an MCP Server)

**Body:**

Hey everyone,

I wanted to share an open-source project I’ve been working on called **Personal Context Engine**.

I realized that while ChatGPT and Claude have great memory features now, that memory isn't portable. You can't take your Claude context into Cursor.

Also, I strongly believe that how you *felt* reveals more truth than how you *thought*. Traditional AI memory just stores facts we declare about ourselves. This engine takes a different approach:
- It interviews you passively, asking about actions and physical sensations rather than abstract thoughts.
- It extracts "Vignettes" (specific behavioral scenes) instead of just bullet points. A single sentence like *"Turned down a promotion because the Monday all-hands felt wrong"* gives a local model way more signal than just *"values: freedom"*.
- **It's fully local-first.** It runs on Docker (Node.js/SQLite) and supports Ollama out of the box (as well as OpenAI/Anthropic via API).
- It exports everything as plain `.md` files.
- It includes an **MCP server**, so you can hook your context directly into Claude Desktop or Cursor seamlessly.

It's entirely open-source (MIT). I'd love for this community to try it out, especially the Ollama integration, and let me know if this approach to "Portable AI Memory" makes sense to you.

GitHub: https://github.com/uchidayuma/personal_context

---

## 3. Reddit: r/ClaudeAI & r/Cursor

**Title:** How I bring my exact personal context into Claude/Cursor without rewriting it every time (Open Source MCP Server)

**Body:**

Hi all,

If you use multiple AI tools (Claude Desktop, Cursor, etc.), you know the pain of having your "Project Knowledge" or "Memory" fragmented across platforms.

I built an open-source tool called **Personal Context Engine**. It’s a local app that occasionally interviews you to figure out what you are working on, what your core values are, and how you make decisions.

But the best part for this community: **It has a built-in MCP (Model Context Protocol) server.**

Once the engine learns about you, you can just add it to your `claude_desktop_config.json` or Cursor settings. The AI can now dynamically read your "Core" context (who you are) and your "State" context (what you are currently focusing on) directly from your local SQLite database, exported as clean Markdown.

It stops the AI from giving generic, "safe" answers because it actually knows your specific behavioral patterns and current goals.

Check it out if you're interested in owning your context:
https://github.com/uchidayuma/personal_context
71 changes: 71 additions & 0 deletions docs/launch/SUBSTACK_POST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Title: AIに「本当の自分」を理解させる方法。脱ベンダーロックインのコンテキストエンジンを作った話

こんにちは。今日は新しく公開したオープンソースソフトウェア、**「Personal Context Engine(自分コンテキスト)」**について、なぜこれを作ろうと思ったのか、その裏側にある思想をお話ししたいと思います。

リポジトリはこちらです:
[https://github.com/uchidayuma/personal_context](https://github.com/uchidayuma/personal_context)

---

## 終わらない「自己紹介」への疲弊

皆さんは今、いくつのAIツールを使っていますか?
ChatGPTでアイデアを練り、Claudeで文章を推敲し、Cursorでコードを書く。私自身、日常的に複数のLLM(大規模言語モデル)を行き来しています。

各プラットフォームは最近「Memory(メモリ)」や「Project(プロジェクト)」といった機能を充実させてきました。「私はこういう人間で、こういう前提で答えてほしい」と事前に登録しておく機能です。

しかし、ここに大きなストレスがありました。**コンテキストがプラットフォームごとに分断され、閉じ込められている**のです。

新しいAIサービスが出るたびに、あるいは別のツールに乗り換えるたびに、自分が何者で、何を大切にしているのかをイチから教え直さなければならない。AIがせっかく私の好みを学習しても、そのデータは特定の企業(OpenAIやAnthropicなど)のサーバーの中にロックインされてしまいます。

「自分自身のデータなのに、自分の手元にない。」

この気持ち悪さを解決するために、プラットフォームに依存しない、自分専用のコンテキスト・データベースを作ろうと思ったのが始まりです。

## 「どう考えたか」よりも「どう感じたか」を信じる

開発を進める中で、もう一つの大きな課題にぶつかりました。
それは、**「人間は、本当の自分を言語化するのが絶望的に下手である」**ということです。

AIに「あなたの価値観は何ですか?」と聞かれて「自由です」と答えたとします。
しかし、その言葉はすでに社会的な見栄や自己イメージによって綺麗にフィルタリングされた「編集済みの自分」です。AIはその一般的な「自由」という言葉を受け取り、誰にでも当てはまるような無難で退屈な回答を返してくるようになります。

だから、Personal Context Engineではアプローチを変えました。
システムは「あなたの価値観は?」とは絶対に聞きません。代わりにこう聞きます。

**「今週、一番お金と時間を使ったことは何ですか?」**
**「体がフッと軽くなった瞬間はいつですか?」**
**「うまくいったのに、なぜか心が消耗した出来事はありましたか?」**

「どう考えたか」ではなく、「どう行動したか」「体がどう反応したか(どう感じたか)」を聞き出すのです。合理的な説明は嘘をつきますが、体の反応や行動の事実は嘘をつきません。

## 「ヴィネット(情景)」という最強のプロンプト

AIのインタビューに答えていくと、システムはあなたの回答から**「ヴィネット(情景)」**を抽出します。

例えば「価値観:自由」という無機質なラベルの代わりに、以下のようなシーンを保存します。

> *「昇進を打診されたが断った。理由を聞かれて『月曜の全体会議がなんか違う気がした』と答えた。」*

このたった一文の「情景」は、箇条書きのプロフィールよりもはるかに饒舌に「あなたという人間」をLLMに伝えます。このシーンを読み込んだAIは、「この人は頭での損得勘定よりも、身体的な違和感を判断基準にする人だ」という文脈を深く理解し、回答の解像度が劇的に上がります。

## あなたのコンテキストを、あなたの手元に

システムはこれらのデータをすべて**プレーンなMarkdownファイル**としてエクスポートします。(CORE、SHAPE、STATEという3つの層に分けて出力されます)。

これをどう使うかはあなた次第です。
ChatGPTのカスタム指示にコピペしてもいいですし、付属の「MCP(Model Context Protocol)サーバー」を使えば、Claude DesktopやCursorから直接、ローカルのデータベースにアクセスさせることもできます。

クラウドロックインはありません。データはすべてあなたのローカル環境(SQLiteとMarkdown)に保存されます。明日、もし全く新しい最強のAIが登場しても、あなたはこのMarkdownファイルを渡すだけで、一瞬にして「本当のあなた」を引き継ぐことができます。

## おわりに

このツールは、単なるAIの利便性向上ツールではありません。
「SNSや社会の期待に塗れて見失いがちな『本当の自分』を、AIとの静かな対話を通して取り戻すためのツール」です。

もしこの思想に共感していただけたら、ぜひGitHubリポジトリを覗いてみてください。そして、スター(★)を押して応援していただけると、開発の大きな励みになります。

[https://github.com/uchidayuma/personal_context](https://github.com/uchidayuma/personal_context)
(※ブラウザ上で今すぐ試せるライブデモも用意しています)

最後まで読んでいただき、ありがとうございました。
Loading
Loading