@楽曲作りまくりおじさん 楽曲作りまくりおじさん authored 6 days ago
.github Add MCP server with llama.cpp integration and docs 8 days ago
.vscode chore: migrate to Tauri/Rust backend with SeaORM and add unit/integration tests 7 days ago
document chore: move src-tauri to src/backend for better logical structure 6 days ago
scripts feat: integrate llama-server sidecar with Gemma 3 300M support 7 days ago
src style: tidy project root and simplify onboarding commands 6 days ago
src-tauri fix: align all embedding dimensions to 384 for Gemma 3 300M consistency 6 days ago
test docs: update README onboarding guide and fix script tests 6 days ago
.env.example style: tidy project root and simplify onboarding commands 6 days ago
.gitignore style: tidy project root and simplify onboarding commands 6 days ago
README.md docs: tone down README and more factual descriptions 6 days ago
analyze_nesting.js feat: add rust support to nesting/line scripts and fix app.exe startup dll path 7 days ago
bun.lock chore: migrate to Tauri/Rust backend with SeaORM and add unit/integration tests 7 days ago
count_lines.js feat: add rust support to nesting/line scripts and fix app.exe startup dll path 7 days ago
generate-icon.js Add MCP server with llama.cpp integration and docs 8 days ago
jsconfig.json Add MCP server with llama.cpp integration and docs 8 days ago
launch.cmd chore: migrate to Tauri/Rust backend with SeaORM and add unit/integration tests 7 days ago
mcp.json.sample Add MCP server with llama.cpp integration and docs 8 days ago
package-lock.json Add MCP server with llama.cpp integration and docs 8 days ago
package.json style: tidy project root and simplify onboarding commands 6 days ago
README.md

🦀 SQLite Vector MCP Server (Tauri 2 Edition)

SQLite と Rust で構築された、ローカル向けベクトル検索サーバー

Tauri 2
Rust
Gemma 3

📝 イントロダクション

Model Context Protocol (MCP) に準拠した、ローカル実行用のベクトル検索サーバーです。以前の設計から Tauri v2 および Rust をベースにした構成に整理しました。

Gemma 3 300M Embedding モデルや llama-server をサイドカー(外部プロセス)として利用することで、外部ネットワークに依存せず、ローカル環境のみでテキストのベクトル化と検索を行うことができます。


✨ 主な機能

1. 常駐型バックエンド

Rust で実装されており、システムトレイに常駐して MCP プロトコルのリクエストに応答します。

2. SQLite によるベクトル検索

sqlite-vec 拡張を利用しており、SQLite 上で効率的なベクトル検索を行うことができます。

3. サイドカープロセスの管理

llama-server を外部プロセスとして管理し、アプリケーションの起動に合わせて自動的に Embedding エンジンを準備します。

4. データベース管理

SeaORM を利用し、メタデータや更新日時の管理を自動化しています。

5. ロギング

動作ログを適切に記録し、一定のサイズに達すると自動でローテーションを行います。


📁 ディレクトリ構成

プロジェクトの役割に応じて、以下のようにディレクトリを整理しています。

.
├── bin/          # 外部バイナリ (llama-server等)
├── data/         # データベースファイル (vector.db)
├── document/     # 仕様・設計ドキュメント
├── journals/     # 開発記録
├── logs/         # 開発用ログ
├── resources/    # アイコン等のアセット
├── scripts/      # 各種ユーティリティ
├── src/
│   ├── backend/  # Rust / Tauri バックエンド
│   └── frontend/ # Webview 用 UI
├── target/       # ビルド成果物
└── test/         # テストコード

🏗️ システム構造

graph TD
    subgraph "Frontend"
        UI["UI (JS)"]
    end
    
    subgraph "Backend (Rust)"
        Axum["MCP Server"]
        SeaORM["DB Access"]
        Sidecar["Sidecar Manager"]
    end
    
    subgraph "External"
        LS["llama-server"]
        DB["SQLite"]
    end
    
    UI <--> Axum
    Axum <--> SeaORM
    SeaORM <--> DB
    Sidecar --> LS

🚀 クイックスタート

1. セットアップ

依存関係のインストールとバイナリのダウンロードを行います。

bun install
bun setup

bun setup の実行内容:

  • bin/: llama-server と依存 DLL をダウンロード
  • models/: ベクトル生成用モデルをダウンロード

2. 実行

bun dev

または、launch.cmd を実行しても起動できます。


🛠️ MCP ツール

ツール名 用途
add_item_text 文書の追加とベクトル化
search_text 文書の類似検索
add_item ベクトル指定での追加
search_vector ベクトル検索
llm_generate テキスト生成

📘 詳細情報

詳細は document/ 配下のファイルを参照してください。


📜 ライセンス

ISC License.