{"id":51287541,"url":"https://github.com/tomohiro-owada/gmem","last_synced_at":"2026-06-30T07:02:34.952Z","repository":{"id":366706185,"uuid":"1276364206","full_name":"tomohiro-owada/gmem","owner":"tomohiro-owada","description":"Git-backed long-term memory for AI agents, served through MCP and a JSON-first CLI.","archived":false,"fork":false,"pushed_at":"2026-06-23T01:40:53.000Z","size":115,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-23T02:20:03.299Z","etag":null,"topics":["ai","ai-agents","cli","embeddings","git","go","mcp","onnx","sqlite"],"latest_commit_sha":null,"homepage":"https://github.com/tomohiro-owada/gmem/releases/latest","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomohiro-owada.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"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-06-21T22:18:35.000Z","updated_at":"2026-06-23T01:40:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tomohiro-owada/gmem","commit_stats":null,"previous_names":["tomohiro-owada/gmem"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tomohiro-owada/gmem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomohiro-owada%2Fgmem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomohiro-owada%2Fgmem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomohiro-owada%2Fgmem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomohiro-owada%2Fgmem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomohiro-owada","download_url":"https://codeload.github.com/tomohiro-owada/gmem/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomohiro-owada%2Fgmem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34955986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"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","ai-agents","cli","embeddings","git","go","mcp","onnx","sqlite"],"created_at":"2026-06-30T07:02:34.416Z","updated_at":"2026-06-30T07:02:34.943Z","avatar_url":"https://github.com/tomohiro-owada.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-mcp-memory\n\nGit-backed long-term memory for AI agents, served through MCP and a JSON-first CLI.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/assets/header.svg\" alt=\"git-mcp-memory header illustration\" width=\"100%\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/tomohiro-owada/gmem/actions/workflows/ci.yml\"\u003e\u003cimg alt=\"CI\" src=\"https://img.shields.io/github/actions/workflow/status/tomohiro-owada/gmem/ci.yml?branch=main\u0026style=flat-square\u0026label=ci\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/tomohiro-owada/gmem/releases/latest\"\u003e\u003cimg alt=\"Release\" src=\"https://img.shields.io/github/v/release/tomohiro-owada/gmem?style=flat-square\"\u003e\u003c/a\u003e\n  \u003cimg alt=\"Go\" src=\"https://img.shields.io/badge/go-1.24%2B-00ADD8?style=flat-square\u0026logo=go\u0026logoColor=white\"\u003e\n  \u003cimg alt=\"MCP\" src=\"https://img.shields.io/badge/MCP-stdio-0f766e?style=flat-square\"\u003e\n  \u003cimg alt=\"Embeddings\" src=\"https://img.shields.io/badge/embeddings-local%20ONNX-2563eb?style=flat-square\"\u003e\n  \u003cimg alt=\"Storage\" src=\"https://img.shields.io/badge/source%20of%20truth-Git%20Markdown-f97316?style=flat-square\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\n  ·\n  \u003ca href=\"#mcp-usage\"\u003eMCP Usage\u003c/a\u003e\n  ·\n  \u003ca href=\"#cli-usage\"\u003eCLI Usage\u003c/a\u003e\n  ·\n  \u003ca href=\"docs/design.md\"\u003eDesign Notes\u003c/a\u003e\n  ·\n  \u003ca href=\"#日本語\"\u003e日本語\u003c/a\u003e\n\u003c/p\u003e\n\n`git-mcp-memory` stores the source of truth as Markdown files in a Git repository, while using SQLite and local embeddings as a rebuildable search index. It is designed for local AI-agent workflows where memory should be readable by humans, reviewable with Git history, and searchable by meaning.\n\nEnglish | [日本語](#日本語)\n\n## Features\n\n- **Git as the source of truth**: every memory is an append-only Markdown file committed to a normal Git repository.\n- **SQLite as a cache**: the local index can be deleted and rebuilt from Markdown.\n- **Local vector search**: embeddings run in-process through ONNX Runtime.\n- **No Ollama or embedding API server required**: model files are downloaded on first use and cached locally.\n- **MCP over stdio**: works as a local MCP server for AI clients.\n- **JSON-first CLI**: the same operations are available from the command line.\n- **Project-aware search**: memories are grouped by project derived from the workspace path.\n- **Cross-project search**: search all stored memories when needed.\n- **Safety gate**: common secrets and personal information are rejected before saving.\n- **Failure-aware Git behavior**: local commits are preserved when push fails, and `retry-push` can recover later.\n\n## Status\n\nThis repository is usable but still young. The workflow is optimized for local personal use, but it is designed to tolerate multiple users or multiple machines sharing the same memory repository:\n\n- one main branch in the memory repository\n- append-only memory files\n- `git pull --rebase` before writes and retry-push recovery after push failures\n- local SQLite index\n- local ONNX embedding model\n- MCP stdio transport\n\nSee [docs/design.md](docs/design.md) for the design notes and tradeoffs.\n\n## Architecture\n\n![git-mcp-memory architecture diagram](docs/assets/architecture.svg)\n\n```text\nAI client / CLI\n  |\n  | save_memory / search_memory\n  v\ngit-mcp-memory\n  |\n  | Git pull / commit / push\n  | Markdown source files\n  | SQLite index\n  | ONNX embeddings\n  v\nMemory Git repository\n```\n\nMemory repository layout:\n\n```text\nmemory-repo/\n└── projects/\n    └── my-project-a1b2c3d4/\n        └── decision-title_20260622_101530_a1b2c3.md\n```\n\nEach memory file uses Markdown with YAML front matter:\n\n```markdown\n---\ntype: Memory\ntitle: \"Decision title\"\ndescription: \"Short description\"\nresource: null\ntags: []\ntimestamp: 2026-06-22T10:15:30Z\nproject_id: \"my-project-a1b2c3d4\"\nsource: \"mcp\"\n---\n\nMarkdown body...\n```\n\n## Requirements\n\n- Go 1.24+\n- Git\n- Access to a Git remote repository for memory storage\n- SSH or HTTPS authentication already configured for that remote\n- Network access on first use to download:\n  - `intfloat/multilingual-e5-small` from Hugging Face\n  - ONNX Runtime from the Microsoft GitHub release\n\nThe embedding provider is currently fixed to:\n\n- provider: `builtin_onnx`\n- model: `intfloat/multilingual-e5-small`\n- dimension: 384\n\n## Installation\n\nDownload a prebuilt archive from the latest GitHub Release.\n\nmacOS arm64:\n\n```bash\ncurl -L -O https://github.com/tomohiro-owada/gmem/releases/latest/download/git-mcp-memory-darwin-arm64.tar.gz\ntar -xzf git-mcp-memory-darwin-arm64.tar.gz\nmkdir -p ~/.local/bin\nmv git-mcp-memory-darwin-arm64 ~/.local/bin/git-mcp-memory\nchmod +x ~/.local/bin/git-mcp-memory\n```\n\nLinux amd64:\n\n```bash\ncurl -L -O https://github.com/tomohiro-owada/gmem/releases/latest/download/git-mcp-memory-linux-amd64.tar.gz\ntar -xzf git-mcp-memory-linux-amd64.tar.gz\nmkdir -p ~/.local/bin\nmv git-mcp-memory-linux-amd64 ~/.local/bin/git-mcp-memory\nchmod +x ~/.local/bin/git-mcp-memory\n```\n\nVerify the install:\n\n```bash\ngit-mcp-memory schema --output json\n```\n\nRelease artifacts include a `.tar.gz` archive and a `.sha256` checksum file. Source builds are still supported:\n\n```bash\ngo build -ldflags '-s -w' -o ~/.local/bin/git-mcp-memory ./cmd/git-mcp-memory\n```\n\n## Configuration\n\nCreate a JSON config file at the default location for your OS.\n\nDefault config path:\n\n- macOS: `~/Library/Application Support/git-mcp-memory/config.json`\n- Windows: `%LOCALAPPDATA%\\git-mcp-memory\\config.json`\n- Linux: `${XDG_CONFIG_HOME:-~/.config}/git-mcp-memory/config.json`\n\nExample:\n\n```json\n{\n  \"git_dir\": \"/Users/alice/Library/Application Support/git-mcp-memory/repo\",\n  \"remote_url\": \"git@github.com:alice/my-memory-repo.git\",\n  \"index_path\": \"/Users/alice/Library/Application Support/git-mcp-memory/index.sqlite\",\n  \"embedding_provider\": \"builtin_onnx\",\n  \"embedding_model\": \"multilingual-e5-small\",\n  \"embedding_model_repo\": \"intfloat/multilingual-e5-small\",\n  \"embedding_model_revision\": \"main\",\n  \"embedding_query_prefix\": \"query: \",\n  \"embedding_document_prefix\": \"passage: \",\n  \"limits\": {\n    \"max_title_bytes\": 512,\n    \"max_content_bytes\": 65536,\n    \"hard_max_content_bytes\": 1048576\n  },\n  \"security_policy\": {\n    \"reject_personal_information\": true,\n    \"reject_organization_names\": true,\n    \"reject_customer_names\": true\n  }\n}\n```\n\nNotes:\n\n- `remote_url` must point to an existing Git repository.\n- Repository creation and SSH key management are intentionally outside this tool.\n- If `git_dir` does not exist, the tool clones `remote_url`.\n- SQLite is not committed to Git. It is a local cache.\n\n## MCP Usage\n\nRun the MCP server:\n\n```bash\ngit-mcp-memory mcp\n```\n\nExample Codex-style MCP configuration:\n\n```toml\n[mcp_servers.gmem]\ncommand = \"/Users/alice/.local/bin/git-mcp-memory\"\nargs = [\"mcp\"]\nstartup_timeout_sec = 120\n```\n\nAvailable tools:\n\n### `save_memory`\n\nInput:\n\n```json\n{\n  \"current_workspace_path\": \"/path/to/project\",\n  \"title\": \"Decision title\",\n  \"content\": \"Markdown body\",\n  \"dry_run\": false\n}\n```\n\nBehavior:\n\n1. Derives `project_id` from the workspace folder and Git remote/path hash.\n2. Rejects unsafe content.\n3. Generates a local embedding.\n4. Pulls the memory repo with rebase.\n5. Writes a new Markdown file.\n6. Commits and pushes.\n7. Updates the SQLite index after a successful push.\n\n### `search_memory`\n\nInput:\n\n```json\n{\n  \"query\": \"What did we decide about local embeddings?\",\n  \"current_workspace_path\": \"/path/to/project\",\n  \"limit\": 5,\n  \"fields\": [\"title\", \"path\", \"content\"],\n  \"snippet_chars\": 300\n}\n```\n\nUse `\"all\": true` instead of `current_workspace_path` for cross-project search.\n\n### `retry_push`\n\nRetries pushing local commits that were preserved after a push failure.\n\n```json\n{\n  \"dry_run\": true\n}\n```\n\n## CLI Usage\n\nThe CLI is designed for AI agents first. JSON output is the default.\n\nShow schema:\n\n```bash\ngit-mcp-memory schema --output json\n```\n\nCheck status:\n\n```bash\ngit-mcp-memory status --output json\n```\n\nOn a fresh machine, `assets_ready` is usually `false` until the first embedding model setup completes. The first `save`, `search`, or `sync` command downloads the ONNX model, tokenizer, and ONNX Runtime into the local application data directory, so it can take longer than normal. Agents can check these fields before a real operation:\n\n```json\n{\n  \"assets_ready\": false,\n  \"embedding_model_ready\": false,\n  \"tokenizer_ready\": false,\n  \"onnx_runtime_ready\": false\n}\n```\n\nAfter the files are cached, the same fields become `true` and later operations do not download them again.\n\nSave a memory:\n\n```bash\ngit-mcp-memory save \\\n  --workspace /path/to/project \\\n  --title \"Decision title\" \\\n  --content \"Markdown body\" \\\n  --output json\n```\n\nDry run:\n\n```bash\ngit-mcp-memory save \\\n  --workspace /path/to/project \\\n  --title \"Dry run\" \\\n  --content \"Validate and embed only.\" \\\n  --dry-run \\\n  --output json\n```\n\nSearch within the current project:\n\n```bash\ngit-mcp-memory search \"local embeddings\" \\\n  --workspace /path/to/project \\\n  --limit 5 \\\n  --output json\n```\n\nSearch all projects:\n\n```bash\ngit-mcp-memory search \"incident summary\" --all --limit 10 --output json\n```\n\nReturn one JSON object per result:\n\n```bash\ngit-mcp-memory search \"push failure\" --all --output ndjson\n```\n\nRebuild/synchronize local state:\n\n```bash\ngit-mcp-memory sync --output json\n```\n\nRetry failed pushes:\n\n```bash\ngit-mcp-memory retry-push --output json\n```\n\n## Agent Skill\n\nThis repository includes a Codex-style agent skill for CLI operation:\n\n```text\nagents/skills/git-mcp-memory-cli/\n```\n\nUse it when an agent needs to call `git-mcp-memory` through the CLI rather than through MCP tools. The skill covers JSON-first command usage, dry-run saves, project and cross-project search, status checks, and push-failure recovery.\n\n## Safety Model\n\n`save_memory` and `save` run a server-side security gate before writing anything.\n\nAlways rejected:\n\n- private keys\n- AWS access keys\n- GitHub tokens\n- OpenAI keys\n- Slack tokens\n- bearer tokens\n- env-style secret assignments such as `TOKEN=...`\n- invalid UTF-8\n- unsafe control characters\n\nRejected by default, configurable by policy:\n\n- email addresses\n- phone numbers\n- organization/customer labels detected by the built-in rules\n\nRejected values are not echoed back in responses. Responses include categories and fields, not the matched secret text.\n\n## Git Failure Behavior\n\nThe tool optimizes for preserving memory without hiding synchronization problems.\n\n- Save first creates a local Git commit.\n- Push is attempted immediately.\n- If push fails, the local commit remains.\n- The response contains `pushed: false` and a structured `push_failed` warning.\n- Search continues using local repository state when possible and returns a warning.\n- `retry-push` can be used after the network or credentials are fixed.\n\nExample warning:\n\n```json\n{\n  \"code\": \"sync_failed_local_results\",\n  \"message\": \"retry push failed; search results are based on local repository state\",\n  \"details\": {\n    \"recommended_action\": \"retry_push\",\n    \"unpushed_commit_count\": 1\n  }\n}\n```\n\n## Development\n\nRun tests:\n\n```bash\ngo test ./...\n```\n\nBuild:\n\n```bash\ngo build -o ./bin/git-mcp-memory ./cmd/git-mcp-memory\n```\n\nRun a local smoke test:\n\n```bash\ngit-mcp-memory save \\\n  --workspace \"$PWD\" \\\n  --title \"Smoke test\" \\\n  --content \"This is a local smoke test.\" \\\n  --dry-run \\\n  --output json\n```\n\n## Release\n\nCI runs on pushes and pull requests to `main`.\n\nReleases are created by pushing a `v*` tag:\n\n```bash\ngit tag vX.Y.Z\ngit push origin vX.Y.Z\n```\n\nThe release workflow builds native artifacts on GitHub-hosted Linux and macOS runners, uploads checksums, and publishes a GitHub Release.\n\n## 日本語\n\nEnglish は [こちら](#git-mcp-memory)。\n\n### git-mcp-memory\n\n![git-mcp-memory ヘッダー挿絵](docs/assets/header.svg)\n\nAI agent の長期記憶を Git 管理された Markdown として保存し、MCP と JSON-first な CLI から読み書きするためのローカルツールです。\n\n`git-mcp-memory` は、記憶の正本を Git リポジトリ内の Markdown に置き、SQLite とローカル embedding を再生成可能な検索インデックスとして使います。人間が読めること、Git の履歴で追えること、意味検索できることを同時に満たす設計です。\n\n## 特徴\n\n- **正本は Git**: 記憶は append-only な Markdown ファイルとして commit されます。\n- **SQLite は cache**: 壊れたり削除したりしても Markdown から再構築できます。\n- **ローカル vector search**: ONNX Runtime でプロセス内推論します。\n- **Ollama や外部 embedding API server は不要**: 初回利用時にモデルをダウンロードして cache します。\n- **MCP stdio 対応**: ローカル MCP server として AI client から使えます。\n- **CLI も同じ機能を提供**: AI agent が叩きやすい JSON 出力を標準にしています。\n- **project 単位の検索**: workspace path から `project_id` を導出します。\n- **全 project 横断検索**: 必要に応じて全記憶を検索できます。\n- **保存前 safety gate**: secret や個人情報を保存前に拒否します。\n- **push 失敗に強い**: push に失敗しても local commit を残し、後から `retry-push` で復旧できます。\n\n## 現在の位置づけ\n\nこの repository は利用可能ですが、まだ若い実装です。ローカル個人利用に最適化していますが、同じ memory repository を複数人または複数端末で共有する運用にも耐える設計です。\n\n- memory repository は `main` branch を直線的に使う\n- 記憶ファイルは append-only\n- 書き込み前に `git pull --rebase` し、push 失敗時は `retry-push` で復旧する\n- SQLite は local index\n- embedding は local ONNX model\n- MCP transport は stdio\n\n詳細な設計メモは [docs/design.md](docs/design.md) を参照してください。\n\n## 構成\n\n![git-mcp-memory 構成図](docs/assets/architecture.svg)\n\n```text\nAI client / CLI\n  |\n  | save_memory / search_memory\n  v\ngit-mcp-memory\n  |\n  | Git pull / commit / push\n  | Markdown source files\n  | SQLite index\n  | ONNX embeddings\n  v\nMemory Git repository\n```\n\nmemory repository の例:\n\n```text\nmemory-repo/\n└── projects/\n    └── my-project-a1b2c3d4/\n        └── decision-title_20260622_101530_a1b2c3.md\n```\n\n各 memory file は YAML front matter 付き Markdown です。\n\n## 必要なもの\n\n- Go 1.24+\n- Git\n- memory 保存用の Git remote repository\n- その remote へ push できる SSH または HTTPS 認証\n- 初回利用時の model download 用 network access\n\n現在の embedding model:\n\n- provider: `builtin_onnx`\n- model: `intfloat/multilingual-e5-small`\n- dimension: 384\n\n## インストール\n\n最新の GitHub Release から build 済み archive を取得します。\n\nmacOS arm64:\n\n```bash\ncurl -L -O https://github.com/tomohiro-owada/gmem/releases/latest/download/git-mcp-memory-darwin-arm64.tar.gz\ntar -xzf git-mcp-memory-darwin-arm64.tar.gz\nmkdir -p ~/.local/bin\nmv git-mcp-memory-darwin-arm64 ~/.local/bin/git-mcp-memory\nchmod +x ~/.local/bin/git-mcp-memory\n```\n\nLinux amd64:\n\n```bash\ncurl -L -O https://github.com/tomohiro-owada/gmem/releases/latest/download/git-mcp-memory-linux-amd64.tar.gz\ntar -xzf git-mcp-memory-linux-amd64.tar.gz\nmkdir -p ~/.local/bin\nmv git-mcp-memory-linux-amd64 ~/.local/bin/git-mcp-memory\nchmod +x ~/.local/bin/git-mcp-memory\n```\n\n確認:\n\n```bash\ngit-mcp-memory schema --output json\n```\n\nrelease artifact には `.tar.gz` archive と `.sha256` checksum を含めます。source からの build も可能です。\n\n```bash\ngo build -ldflags '-s -w' -o ~/.local/bin/git-mcp-memory ./cmd/git-mcp-memory\n```\n\n## 設定\n\nOS ごとの標準 config path:\n\n- macOS: `~/Library/Application Support/git-mcp-memory/config.json`\n- Windows: `%LOCALAPPDATA%\\git-mcp-memory\\config.json`\n- Linux: `${XDG_CONFIG_HOME:-~/.config}/git-mcp-memory/config.json`\n\n設定例:\n\n```json\n{\n  \"git_dir\": \"/Users/alice/Library/Application Support/git-mcp-memory/repo\",\n  \"remote_url\": \"git@github.com:alice/my-memory-repo.git\",\n  \"index_path\": \"/Users/alice/Library/Application Support/git-mcp-memory/index.sqlite\",\n  \"embedding_provider\": \"builtin_onnx\",\n  \"embedding_model\": \"multilingual-e5-small\",\n  \"embedding_model_repo\": \"intfloat/multilingual-e5-small\",\n  \"embedding_model_revision\": \"main\",\n  \"embedding_query_prefix\": \"query: \",\n  \"embedding_document_prefix\": \"passage: \",\n  \"limits\": {\n    \"max_title_bytes\": 512,\n    \"max_content_bytes\": 65536,\n    \"hard_max_content_bytes\": 1048576\n  },\n  \"security_policy\": {\n    \"reject_personal_information\": true,\n    \"reject_organization_names\": true,\n    \"reject_customer_names\": true\n  }\n}\n```\n\n補足:\n\n- `remote_url` は作成済みの Git repository を指定してください。\n- GitHub repository 作成や SSH key 作成はこの tool では行いません。\n- `git_dir` が存在しなければ `remote_url` から clone します。\n- SQLite は Git に commit しません。local cache として扱います。\n\n## MCP として使う\n\nMCP server 起動:\n\n```bash\ngit-mcp-memory mcp\n```\n\nMCP client 設定例:\n\n```toml\n[mcp_servers.gmem]\ncommand = \"/Users/alice/.local/bin/git-mcp-memory\"\nargs = [\"mcp\"]\nstartup_timeout_sec = 120\n```\n\n利用できる tool:\n\n- `save_memory`\n- `search_memory`\n- `retry_push`\n\n`save_memory` は保存前に安全性検査、embedding 生成、Git pull、Markdown 作成、commit、push、index 更新を行います。\n\n`search_memory` は Git の同期、SQLite 再 index、query embedding 生成、vector search を行います。\n\n`retry_push` は push 失敗時に残った local commit の再送に使います。\n\n## CLI として使う\n\nschema:\n\n```bash\ngit-mcp-memory schema --output json\n```\n\nstatus:\n\n```bash\ngit-mcp-memory status --output json\n```\n\n初回利用前は、たいてい `assets_ready` が `false` です。最初の `save`、`search`、`sync` で ONNX model、tokenizer、ONNX Runtime を local application data directory へダウンロードするため、通常より時間がかかります。AI agent は本番操作の前に次の field を見れば、初回 setup 中かどうかを判断できます。\n\n```json\n{\n  \"assets_ready\": false,\n  \"embedding_model_ready\": false,\n  \"tokenizer_ready\": false,\n  \"onnx_runtime_ready\": false\n}\n```\n\ncache 済みになるとこれらは `true` になり、以降の操作では再ダウンロードしません。\n\n保存:\n\n```bash\ngit-mcp-memory save \\\n  --workspace /path/to/project \\\n  --title \"Decision title\" \\\n  --content \"Markdown body\" \\\n  --output json\n```\n\ndry-run:\n\n```bash\ngit-mcp-memory save \\\n  --workspace /path/to/project \\\n  --title \"Dry run\" \\\n  --content \"Validate and embed only.\" \\\n  --dry-run \\\n  --output json\n```\n\nproject 検索:\n\n```bash\ngit-mcp-memory search \"local embeddings\" \\\n  --workspace /path/to/project \\\n  --limit 5 \\\n  --output json\n```\n\n全 project 横断検索:\n\n```bash\ngit-mcp-memory search \"incident summary\" --all --limit 10 --output json\n```\n\n同期と再 index:\n\n```bash\ngit-mcp-memory sync --output json\n```\n\npush 再試行:\n\n```bash\ngit-mcp-memory retry-push --output json\n```\n\n## Agent Skill\n\nこの repository には CLI 操作用の Codex-style agent skill を同梱しています。\n\n```text\nagents/skills/git-mcp-memory-cli/\n```\n\nMCP tool ではなく CLI から `git-mcp-memory` を使う agent 向けです。JSON-first な command 利用、dry-run 保存、project 検索、全 project 横断検索、status 確認、push 失敗時の復旧手順を含みます。\n\n## セキュリティ\n\n`save_memory` と `save` は保存前に server-side の safety gate を通します。\n\n常に拒否されるもの:\n\n- private key\n- AWS access key\n- GitHub token\n- OpenAI key\n- Slack token\n- bearer token\n- `TOKEN=...` のような env secret\n- invalid UTF-8\n- 危険な control character\n\nデフォルトで拒否されるもの:\n\n- email address\n- phone number\n- built-in rule で検出される会社名、顧客名 label\n\n拒否された値そのものは response に含めません。category と field だけを返します。\n\n## Git 障害時の挙動\n\nこの tool は、同期失敗を隠さず、かつ local の記憶を失わないことを重視します。\n\n- 保存時は local Git commit を作成します。\n- push は即座に試みます。\n- push に失敗しても local commit は残します。\n- response には `pushed: false` と `push_failed` warning を返します。\n- search は可能な限り local repository state で継続し、warning を返します。\n- network や認証を直した後に `retry-push` で復旧できます。\n\n## 開発\n\ntest:\n\n```bash\ngo test ./...\n```\n\nbuild:\n\n```bash\ngo build -o ./bin/git-mcp-memory ./cmd/git-mcp-memory\n```\n\nsmoke test:\n\n```bash\ngit-mcp-memory save \\\n  --workspace \"$PWD\" \\\n  --title \"Smoke test\" \\\n  --content \"This is a local smoke test.\" \\\n  --dry-run \\\n  --output json\n```\n\n## Release\n\nCI は `main` への push と pull request で実行されます。\n\nrelease は `v*` tag を push すると作成されます。\n\n```bash\ngit tag vX.Y.Z\ngit push origin vX.Y.Z\n```\n\nrelease workflow は GitHub-hosted Linux/macOS runner で native artifact を build し、checksum と一緒に GitHub Release へ公開します。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomohiro-owada%2Fgmem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomohiro-owada%2Fgmem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomohiro-owada%2Fgmem/lists"}