project-decision-rag
README.md
# Project decision RAG MCP server
Chromaでプロジェクト固有の意思決定ルールを意味検索し、MCPツールとしてLLMに提供するサンプルです。
## セットアップ
`mise`でNode.js・Python・Python仮想環境を管理します。ChromaサーバはPythonパッケージとしてインストールします。
```sh
mise trust
mise install
mise run install
```
`mise trust` は、プロジェクトの `mise.toml` を信頼するための初回のみ必要な操作です。詳しくは [mise.tomlの信頼](https://zenn.dev/inventit/articles/mise-tool-version-management#mise.toml-%E3%81%AE%E4%BF%A1%E9%A0%BC) を参照してください。
Python 3.12.0の配布バイナリにはGitHub Artifact Attestationがないため、`mise.toml`ではPythonに限ってこの検証を無効化しています。また、仮想環境にはpipをseedし、`mise run install`でもpipを復旧してから依存関係をインストールします。
Chromaサーバを別のターミナルで起動し、ルールを登録します。
```sh
mise run start-chroma
mise run ingest
```
MCPクライアントからは、次のコマンドをstdioサーバとして登録します。
```sh
mise run start-mcp
```
デフォルトでは `127.0.0.1:8000` の `project-decision-rules-multilingual-v1` コレクションを使用します。日本語検索に対応した `Xenova/paraphrase-multilingual-MiniLM-L12-v2` をEmbeddingモデルとして使用します。変更する場合は `CHROMA_HOST`、`CHROMA_PORT`、`CHROMA_SSL`、`CHROMA_COLLECTION`、`CHROMA_EMBEDDING_MODEL` を設定してください。
Embeddingモデルを変更した場合は、登録時と検索時で同じモデルを使う必要があります。既存のコレクションとベクトルが混ざらないよう、別の`CHROMA_COLLECTION`を指定するか、対象コレクションへ`mise run ingest`を実行してください。
## ツール
`find_project_decisions(query)` に質問や状況を渡すと、Chromaで関連ルールを検索し、検索結果のIDから正式なルールを読み込んで返します。
正式なルールは [`src/rules.ts`](src/rules.ts)、検索インデックスへの投入は [`src/ingest-rules.ts`](src/ingest-rules.ts) で管理します。
```sh
mise run build
```
TDQS
A3.6/5.0
Scored across 1 tool
Disambiguation5/5
With only one tool, there is no possibility of confusion or misselection. The tool has a unique, clearly defined purpose.
Naming Consistency5/5
The single tool name 'find_project_decisions' follows a clear verb_noun pattern and is internally consistent.
Tool Count2/5
A single tool feels too thin for a server named 'project-decision-rag'. Even a focused RAG server would typically include additional tools for managing or indexing decisions.
Completeness2/5
The server only provides search/retrieval of project decisions. There is no way to add, update, or delete decisions, which are significant gaps for a decision management workflow.
Maintenance
ActivityStale
ResponsivenessNo issues