{"id":49341604,"url":"https://github.com/sert-xx/unified-blueprint","last_synced_at":"2026-04-27T04:04:31.747Z","repository":{"id":338999391,"uuid":"1153513419","full_name":"sert-xx/unified-blueprint","owner":"sert-xx","description":"Documentation-as-Code middleware — structure Markdown docs into a Document Graph with semantic search for AI agents","archived":false,"fork":false,"pushed_at":"2026-03-26T00:36:25.000Z","size":2327,"stargazers_count":2,"open_issues_count":10,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-29T06:04:09.944Z","etag":null,"topics":["ai-agent","documentation","knowledge-graph","mcp","semantic-search"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sert-xx.png","metadata":{"files":{"readme":"README.ja.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-09T11:41:07.000Z","updated_at":"2026-03-18T04:32:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sert-xx/unified-blueprint","commit_stats":null,"previous_names":["sert-xx/unified-blueprint"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/sert-xx/unified-blueprint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sert-xx%2Funified-blueprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sert-xx%2Funified-blueprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sert-xx%2Funified-blueprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sert-xx%2Funified-blueprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sert-xx","download_url":"https://codeload.github.com/sert-xx/unified-blueprint/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sert-xx%2Funified-blueprint/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32321945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","documentation","knowledge-graph","mcp","semantic-search"],"created_at":"2026-04-27T04:04:30.086Z","updated_at":"2026-04-27T04:04:31.727Z","avatar_url":"https://github.com/sert-xx.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[English](./README.md)\n\n# UBP - Unified Blueprint\n\nDocumentation-as-Code ミドルウェア。Markdown ドキュメントを Document Graph として構造化し、セマンティック検索・グラフ探索・全文検索を AI エージェントに提供する。\n\n## 特徴\n\n- **3-way ハイブリッド検索** — ベクトル検索 + グラフ探索 + FTS5 全文検索を統合スコアリング\n- **Document Graph** — WikiLink (`[[target]]`) および通常Markdownリンク (`[text](./path.md)`) によるドキュメント間リンクをグラフ構造で管理\n- **ローカル埋め込み** — Xenova/multilingual-e5-large による日英バイリンガル対応 (外部API不要)\n- **MCP サーバー** — Claude Code / Claude Desktop / Cursor から直接利用可能\n- **リアルタイム同期** — ファイル変更を監視し差分更新\n- **鮮度検出** — `source_refs` によるドキュメントとソースコードの整合性チェック\n\n## 必要環境\n\n- Node.js \u003e= 18.0.0\n- C++ コンパイラツールチェーン (`better-sqlite3` ネイティブアドオンに必要)\n  - **macOS:** Xcode Command Line Tools (`xcode-select --install`)\n  - **Linux:** `build-essential` (`apt install build-essential`)\n  - **Windows:** Visual Studio Build Tools または `npm install -g windows-build-tools`\n\n## インストール\n\n```bash\nnpm install -g ubp\n```\n\n## クイックスタート\n\n### 1. プロジェクト初期化\n\n```bash\nubp init --docs-dir docs\n```\n\n`docs/` 配下の Markdown ファイルをパース、セクション分割、リンク解決、埋め込み生成を行い `.ubp/ubp.db` に格納する。\n\n### 2. 検索\n\n```bash\n# セマンティック検索 (ハイブリッド)\nubp search \"検索アルゴリズムの仕組み\"\n\n# 全文検索 (FTS5)\nubp search \"trigram\" --fulltext\n```\n\n### 3. MCP サーバー起動\n\n```bash\nubp serve --no-lock\n```\n\n## MCP 連携設定\n\n`ubp init` 実行時に設定スニペットが表示される。\n\n**Claude Code:**\n\n```bash\nclaude mcp add ubp -- node dist/main.js serve --no-lock\n```\n\n**Claude Desktop** (`~/.claude/claude_desktop_config.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"ubp\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"ubp\", \"serve\", \"--no-lock\"],\n      \"cwd\": \"/path/to/project\"\n    }\n  }\n}\n```\n\n## MCP ツール\n\n| ツール | 説明 |\n|---|---|\n| `ubp_search` | セマンティック検索 (3-way ハイブリッド) |\n| `ubp_get_page` | ドキュメント全文取得 |\n| `ubp_get_context` | ドキュメント + 関連ドキュメント一括取得 |\n| `ubp_fulltext_search` | キーワード全文検索 (FTS5) |\n| `ubp_list_pages` | ドキュメント一覧 |\n| `ubp_get_graph` | ドキュメント間リンクグラフ |\n\n## CLI コマンド\n\n| コマンド | 説明 |\n|---|---|\n| `ubp init` | プロジェクト初期化 (パース・埋め込み生成) |\n| `ubp serve` | Watcher + MCP サーバーを起動 |\n| `ubp search \u003cquery\u003e` | ハイブリッド検索 / 全文検索 |\n| `ubp get-page \u003cfilepath\u003e` | ドキュメント全文・リンク情報の取得 |\n| `ubp get-context \u003cfilepath\u003e` | ドキュメント + 関連ドキュメント一括取得 |\n| `ubp list-pages` | ドキュメント一覧 |\n| `ubp get-graph` | ドキュメント間リンクグラフ |\n| `ubp status` | DB 統計情報の表示 |\n| `ubp stale` | 鮮度の低いドキュメントを検出 |\n| `ubp reindex` | 全ドキュメントを再インデックス |\n| `ubp suggest-links` | リンク候補を提案 |\n| `ubp version` | バージョン表示 |\n\nグローバルオプション: `--cwd \u003cpath\u003e`, `--json`, `--verbose`, `--quiet`\n\n### MCP の代替としての CLI 利用\n\nMCP サーバーが利用できない環境では、`--json` フラグ付きの CLI コマンドで MCP ツールと同等の構造化データを取得できる。AI エージェントへの指示方法は [AGENTS.md](./AGENTS.md) を参照。\n\n## Markdown 記法\n\n### Frontmatter\n\n```yaml\n---\ntitle: ドキュメントタイトル\ntags: [設計, アーキテクチャ]\nsource_refs:\n  - src/core/engine.ts\n  - src/data/database-manager.ts\n---\n```\n\n### WikiLink\n\n```markdown\n詳細は [[architecture]] を参照。\n特定セクションへのリンク: [[database-schema#FTS5設定]]\nエイリアス付き: [[search-algorithm|検索の仕組み]]\n```\n\n### 通常Markdownリンク\n\n通常の Markdown リンクも `references` 型リンクとして自動的に取り込まれる。WikiLink を手動追記する必要なく、既存の Markdown リンクがそのままドキュメントグラフに反映される。\n\n```markdown\n詳細は [アーキテクチャ設計](./designs/architecture.md) を参照。\n```\n\n- 内部 `.md` ファイルへの相対リンクのみ対象（外部URL、アンカーのみ、非`.md`ファイルは無視）\n- 同じターゲットに WikiLink と Markdown リンクの両方がある場合、WikiLink が優先され重複排除される\n\n## 設定\n\n`.ubp/config.json` で設定をカスタマイズできる。\n\n```json\n{\n  \"docs_dir\": \"docs\",\n  \"source\": {\n    \"include\": [\"**/*.md\"],\n    \"exclude\": []\n  },\n  \"embedding\": {\n    \"model\": \"Xenova/multilingual-e5-large\",\n    \"dimensions\": 1024,\n    \"batch_size\": 32\n  },\n  \"search\": {\n    \"alpha\": 0.7,\n    \"default_limit\": 10,\n    \"max_depth\": 2\n  },\n  \"staleness\": {\n    \"threshold_days\": 7\n  }\n}\n```\n\n`search.alpha` は検索スコアの重み配分を制御する:\n\n```\nscore = α × vector + β × graph + γ × fts5\nβ = (1 - α) × 0.67,  γ = (1 - α) × 0.33\n```\n\n## アーキテクチャ\n\n```\nInterface Layer     CLI (commander.js) / MCP Server (stdio)\n        │\nCore Layer          UbpEngine ← Parser, Search, Graph, Staleness, Watcher\n        │\nData Layer          DatabaseManager, Repositories, VectorIndex, FTS5\n        │\nEmbedding Layer     LocalEmbeddingProvider (ONNX Runtime)\n```\n\n## 開発\n\n```bash\ngit clone https://github.com/sert-xx/unified-blueprint.git\ncd unified-blueprint\nnpm install\nnpm test              # テスト実行\nnpm run test:watch    # ウォッチモード\nnpm run typecheck     # 型チェック\nnpm run build         # ビルド\n```\n\n## コントリビュート\n\n[CONTRIBUTING.md](./CONTRIBUTING.md) を参照してください。\n\n## ライセンス\n\nMIT License - 詳細は [LICENSE](./LICENSE) を参照。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsert-xx%2Funified-blueprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsert-xx%2Funified-blueprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsert-xx%2Funified-blueprint/lists"}