diff --git a/README.md b/README.md index d2e7761..1c26ce2 100644 --- a/README.md +++ b/README.md @@ -1,73 +1,114 @@ -# React + TypeScript + Vite -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. +# TelosDB -Currently, two official plugins are available: +ローカル完結型セマンティック検索DB & MCPサーバー -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh +--- -## React Compiler +## 概要 -The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). +TelosDBは、Tauri 2 + Rust + Vanilla JS/HTMLで構成された、SQLite Vector拡張を活用するローカル特化型セマンティック検索基盤です。サイドカー(llama-server)による埋め込み生成、AxumベースのMCP APIサーバー、最小構成のUIを備え、外部API不要・高速・安全な知識検索/提供を実現します。 -## Expanding the ESLint configuration +--- -If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: +## 特徴 -```js -export default defineConfig([ - globalIgnores(['dist']), - { - files: ['**/*.{ts,tsx}'], - extends: [ - // Other configs... +- **Tauri 2 + Rust**: デスクトップアプリ基盤。プロセス/リソース管理もRustで一元化。 +- **Vanilla JS/HTML UI**: React等のフレームワーク非依存。最小・高速・シンプル。 +- **サイドカー自動起動/監視**: llama-server(llama.cppベース)を自動管理。 +- **Axum MCP API**: Model Context Protocol準拠のREST/SSEサーバー。外部AIエージェント連携も容易。 +- **SQLite Vector**: sqlite-vec拡張DLLによる高速ベクトル検索。 +- **ESLint/Prettier整備**: コード品質・自動整形対応。 +- **journal記録**: journals/に進捗・設計・トラブルシュートを日次記録。 - // Remove tseslint.configs.recommended and replace with this - tseslint.configs.recommendedTypeChecked, - // Alternatively, use this for stricter rules - tseslint.configs.strictTypeChecked, - // Optionally, add this for stylistic rules - tseslint.configs.stylisticTypeChecked, +--- - // Other configs... - ], - languageOptions: { - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - // other options... - }, - }, -]) +## セットアップ + +### 1. Rust/Bunインストール +- [Rust公式](https://rustup.rs/) でRustを導入 +- [Bun公式](https://bun.sh/) でBunを導入 + +### 2. 依存インストール +```bash +bun install ``` -You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: +### 3. サイドカー/モデル準備 +- scripts/launch-llama-server.bat でllama-server起動(またはTauri起動時に自動) +- Gemma-3-300M.gguf等のモデルファイルをexeと同じディレクトリに配置 -```js -// eslint.config.js -import reactX from 'eslint-plugin-react-x' -import reactDom from 'eslint-plugin-react-dom' - -export default defineConfig([ - globalIgnores(['dist']), - { - files: ['**/*.{ts,tsx}'], - extends: [ - // Other configs... - // Enable lint rules for React - reactX.configs['recommended-typescript'], - // Enable lint rules for React DOM - reactDom.configs.recommended, - ], - languageOptions: { - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - // other options... - }, - }, -]) +### 4. 開発/ビルド +```bash +# 開発モード +tauri dev +# ビルド +tauri build ``` + +--- + +## 主要機能 + +| 機能 | 概要 | +|:-------------|:------------------------------------------------| +| 文章登録 | 文章+メタデータを自動ベクトル化しDB保存 | +| セマンティック検索 | 自然言語で類似文書を高速検索 | +| MCP API | 外部エージェント向けJSON-RPC/SSEインターフェース | +| サイドカー管理 | llama-server自動起動・死活監視・終了シグナル | +| UI | 状態・件数・API仕様(mcp.json)の可視化/コピー | + +--- + +## アーキテクチャ + +```mermaid +graph TD + UI[Vanilla UI] + Tauri[Tauri Core] + Axum[Axum MCP Server] + Sidecar[llama-server] + DB[(SQLite+vec0)] + Model[Gemma-3 GGUF] + UI -->|IPC| Tauri + Tauri <--> Axum + Tauri <--> DB + Axum <--> DB + Tauri --> Sidecar + Sidecar --> Model +``` + +--- + +## API仕様(抜粋) + +- `/llama_status` : サイドカー状態取得(running/stopped/error) +- `/messages` : MCP JSON-RPCエンドポイント +- `/sse` : SSEストリーム +- 詳細: [document/openapi.yaml](document/openapi.yaml), [document/mcp.json](document/mcp.json) + +--- + +## サイドカー(llama-server)管理 + +- Tauri起動時に自動でllama-server.exeをspawn +- Gemma-3-300M.gguf等のモデルを引数で指定 +- DLL依存解決・CWD制御・標準出力監視 +- /health監視で死活判定、終了時はkill +- scripts/launch-llama-server.bat でも手動起動可 + +--- + +## journal・開発ガイド + +- journals/ : 日次進捗・設計・トラブル記録 +- document/ : システム仕様・設計・API・開発ガイド + - [01_system_overview.md](document/01_system_overview.md) + - [02_architecture_design.md](document/02_architecture_design.md) + - [06_development_guide.md](document/06_development_guide.md) + +--- + +## ライセンス + +MIT