{"title":"メモリモデル","slug":"memory-model","category":"concepts","summary":"メモリの構造 — カテゴリ、キー、タグ、優先度、ソース、検証。","audience":["human","llm"],"tags":["concept","memory","model","structure"],"difficulty":"intermediate","updated":"2026-06-27","word_count":420,"read_minutes":2,"lang":"ja","translated":true,"requested_lang":"ja","content_markdown":"\n# メモリモデル\n\nSynapse のメモリモデルは LLM エージェント向けに設計されています — 信頼できる再取得のための十分な構造と、任意のドメインに対応する柔軟性を備えています。\n\n## メモリの構造\n\n```json\n{\n  \"id\": \"mem_abc123\",\n  \"category\": \"project\",\n  \"key\": \"project_synapse_status\",\n  \"content\": \"Synapse v1.5.0 deployed on vps1. CI green.\",\n  \"tags\": [\"synapse\", \"deployment\", \"v1.5.0\"],\n  \"priority\": \"high\",\n  \"source\": \"agent\",\n  \"verified\": false,\n  \"confidence\": 0.85,\n  \"expires_at\": null,\n  \"mind_id\": \"m_xyz789\",\n  \"created_at\": \"2026-06-27T...\",\n  \"updated_at\": \"2026-06-27T...\"\n}\n```\n\n## フィールド\n\n| フィールド | 型 | 必須 | 説明 |\n|-------|------|----------|-------------|\n| `id` | string | 自動 | ユニーク ID（mem_xxx） |\n| `category` | enum | ✅ | 8 カテゴリのいずれか |\n| `key` | string | ✅ | 安定した識別子（更新に使用） |\n| `content` | string | ✅ | メモリの内容（任意のテキスト） |\n| `tags` | string[] | – | 検索とフィルタリング用 |\n| `priority` | enum | – | low、normal、high、critical（デフォルト：normal） |\n| `source` | enum | 自動 | user、agent（保存者） |\n| `verified` | bool | 自動 | 人間が検証済みか |\n| `confidence` | float | – | 0.0 〜 1.0（デフォルト：user は 1.0、agent は 0.7） |\n| `expires_at` | timestamp | – | このメモリを忘れるタイミング |\n| `mind_id` | string | 自動 | 所有する mind |\n| `created_at` | timestamp | 自動 | 初回保存日時 |\n| `updated_at` | timestamp | 自動 | 最終更新日時 |\n\n## カテゴリ\n\n8 つのカテゴリが一般的な LLM エージェントのユースケースをカバーします。\n\n| カテゴリ | 目的 | 内容の例 |\n|----------|---------|-----------------|\n| `identity` | ユーザーが誰か | \"User is Michael Schäfer, software engineer in Berlin\" |\n| `preference` | ユーザーの設定 | \"Prefers concise technical responses\" |\n| `fact` | 検証可能な事実 | \"Office is in Berlin, timezone Europe/Berlin\" |\n| `project` | プロジェクトのステータス | \"Synapse v1.5.0 deployed, working on v1.6.0 docs\" |\n| `skill` | ユーザーのスキル | \"Advanced Python, 10+ years\" |\n| `mistake` | 過去のエラー | \"Forgot to bump npm version — CI failed\" |\n| `context` | セッションのコンテキスト | \"Currently reviewing PR #42\" |\n| `note` | その他のメモ | \"Try Redis for caching next sprint\" |\n\n## キー：安定した識別子\n\n`key` フィールドは重要です — 重複を作らずにメモリを更新するための方法です。\n\n```python\n# First store\nstore(\"project\", \"project_synapse_status\", \"v1.4.0 deployed\", priority=\"high\")\n\n# Update with same key (overwrites, doesn't duplicate)\nstore(\"project\", \"project_synapse_status\", \"v1.5.0 deployed\", priority=\"high\")\n```\n\n**キーのルール：**\n\n- (category, mind) 内でユニークである必要があります\n- `snake_case` を使用\n- 明確さのためにカテゴリをプレフィックスに：`preference_communication`、`mistake_npm_version`\n- 安定性を保つ — 作成後にキーを変更しない\n\n## タグ：検索用\n\nタグにより高速なフィルタリングと検索が可能です。\n\n```bash\n# Find all memories with tag \"docker\"\nGET /memory/by-tag?tag=docker\n\n# FTS5 search within tagged subset\nGET /memory/search?q=swarm&tag=docker\n```\n\n**タグのベストプラクティス：**\n\n- メモリごとに 2〜5 個のタグ（付けすぎない）\n- 一貫性のために小文字\n- プロジェクト名、トピック、技術を使用\n- タグは大文字小文字を区別しません\n\n## 優先度レベル\n\n| 優先度 | 使用場面 | 再取得時の挙動 |\n|----------|-------------|-----------------|\n| `critical` | ID、法的、不可逆 | 常に再取得の先頭 |\n| `high` | 進行中のプロジェクト、主要な設定 | 再取得で目立つ |\n| `normal` | ほとんどのメモリ（デフォルト） | 標準的な再取得順 |\n| `low` | 一時的、知っておくとよいこと | 要約される可能性 |\n\n`/memory/recall` は優先度（critical が先頭）、次に新しさでソートします。\n\n## ソース：user と agent\n\nメモリには `source` が付与されます。\n\n- `user` — 人間が保存（JWT または human UI 経由）\n- `agent` — LLM エージェントが保存（Mind Key 経由）\n\nこれは以下に影響します。\n\n- **検証：** `user` メモリは自動検証、`agent` メモリは未検証\n- **信頼度：** `user` はデフォルト 1.0、`agent` は 0.7\n- **再取得：** `/memory/recall` は未検証メモリに「(unverified)」を付ける\n\n> [!NOTE]\n> `agent` ソースのメモリは適切な懐疑心を持って扱ってください。ユーザーが直接述べたものではなく、推論や仮定の可能性があります。\n\n## 検証\n\n`verified` フラグは人間がメモリを確認したことを示します。\n\n- `user` メモリ：自動検証（`true`）\n- `agent` メモリ：デフォルトで未検証（`false`）\n\n以下でメモリを検証します。\n\n```bash\ncurl -X POST https://synapse.schaefer.zone/memory/mem_001/verify \\\n  -H \"Authorization: Bearer YOUR_JWT\"\n```\n\n> [!NOTE]\n> 検証には Mind Key（エージェント認証）ではなく JWT（人間の認証）が必要です。これにより、人間のみがメモリを検証済みとしてマークできます。\n\n## 信頼度\n\n`confidence` フィールド（0.0 〜 1.0）はメモリの信頼性を示します。\n\n- 1.0 — ユーザーが直接述べた\n- 0.7 — エージェントが推論した\n- 0.5 — 不確実、検証が必要\n- 0.0 — 明示的に疑わしい\n\n保存時に信頼度を設定します。\n\n```json\n{\n  \"category\": \"preference\",\n  \"key\": \"prefers_dark_mode\",\n  \"content\": \"User seems to prefer dark mode (based on their IDE screenshots)\",\n  \"confidence\": 0.5,\n  \"source\": \"agent\"\n}\n```\n\n## 有効期限\n\n時間依存のメモリには `expires_at` を設定します。\n\n```json\n{\n  \"category\": \"context\",\n  \"key\": \"current_meeting_topic\",\n  \"content\": \"Discussing Q3 roadmap\",\n  \"expires_at\": \"2026-06-28T00:00:00Z\"\n}\n```\n\n期限切れのメモリは `/memory/recall` で返されません（ただし DB には存在）。`/memory/expiring?within=7d` で期限切れが近いメモリを確認できます。\n\n## メモリのライフサイクル\n\n```\n                  ┌─────────────────┐\n                  │     Create      │\n                  │  POST /memory   │\n                  └────────┬────────┘\n                           │\n                           ▼\n                  ┌─────────────────┐\n                  │     Active      │ ◀──── PUT /memory/:id (update)\n                  │  (in recall)    │\n                  └────────┬────────┘\n                           │\n              ┌────────────┼────────────┐\n              │            │            │\n              ▼            ▼            ▼\n        ┌──────────┐ ┌──────────┐ ┌──────────┐\n        │ Expired  │ │ Verified │ │ Deleted  │\n        │ (in DB)  │ │ (flag)   │ │ (gone)   │\n        └──────────┘ └──────────┘ └──────────┘\n```\n\n## 再取得時の挙動\n\n`GET /memory/recall` は LLM コンテキスト向けに最適化されたプレーンテキストの要約を返します。\n\n```\nMind: Michael's Mind\nMemories: 12 total (10 verified, 2 unverified)\n\n[001] identity (CRITICAL) [verified]\n  user_name\n  Michael Schäfer\n  Tags: person, identity\n\n[002] preference (HIGH) [verified]\n  communication_style\n  Prefers concise technical responses\n  Tags: communication\n\n[003] project (HIGH) [unverified]\n  synapse_status\n  v1.5.0 deployed, working on v1.6.0 docs\n  Tags: synapse, deployment\n\n...\n```\n\n- 優先度（critical → low）、次に新しさでソート\n- 未検証メモリは `[unverified]` でマーク\n- タグはコンテキストのために含まれる\n- プレーンテキスト（JSON 解析不要）\n\n## 次のステップ\n\n- [Memory API](/docs/api/memory)\n- [Memory Best Practices](/docs/guides/memory-best-practices)\n- [FTS5 Search](/docs/concepts/fts5-search)\n","content_html":"<h1>メモリモデル</h1>\n<p>Synapse のメモリモデルは LLM エージェント向けに設計されています — 信頼できる再取得のための十分な構造と、任意のドメインに対応する柔軟性を備えています。</p>\n<h2>メモリの構造</h2>\n<pre><code class=\"hljs language-json\"><span class=\"hljs-punctuation\">{</span>\n  <span class=\"hljs-attr\">&quot;id&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;mem_abc123&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;category&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;project&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;key&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;project_synapse_status&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;content&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;Synapse v1.5.0 deployed on vps1. CI green.&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;tags&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">[</span><span class=\"hljs-string\">&quot;synapse&quot;</span><span class=\"hljs-punctuation\">,</span> <span class=\"hljs-string\">&quot;deployment&quot;</span><span class=\"hljs-punctuation\">,</span> <span class=\"hljs-string\">&quot;v1.5.0&quot;</span><span class=\"hljs-punctuation\">]</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;priority&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;high&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;source&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;agent&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;verified&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-literal\"><span class=\"hljs-keyword\">false</span></span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;confidence&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-number\">0.85</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;expires_at&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-literal\"><span class=\"hljs-keyword\">null</span></span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;mind_id&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;m_xyz789&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;created_at&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;2026-06-27T...&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;updated_at&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;2026-06-27T...&quot;</span>\n<span class=\"hljs-punctuation\">}</span></code></pre><h2>フィールド</h2>\n<table>\n<thead>\n<tr>\n<th>フィールド</th>\n<th>型</th>\n<th>必須</th>\n<th>説明</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>id</code></td>\n<td>string</td>\n<td>自動</td>\n<td>ユニーク ID（mem_xxx）</td>\n</tr>\n<tr>\n<td><code>category</code></td>\n<td>enum</td>\n<td>✅</td>\n<td>8 カテゴリのいずれか</td>\n</tr>\n<tr>\n<td><code>key</code></td>\n<td>string</td>\n<td>✅</td>\n<td>安定した識別子（更新に使用）</td>\n</tr>\n<tr>\n<td><code>content</code></td>\n<td>string</td>\n<td>✅</td>\n<td>メモリの内容（任意のテキスト）</td>\n</tr>\n<tr>\n<td><code>tags</code></td>\n<td>string[]</td>\n<td>–</td>\n<td>検索とフィルタリング用</td>\n</tr>\n<tr>\n<td><code>priority</code></td>\n<td>enum</td>\n<td>–</td>\n<td>low、normal、high、critical（デフォルト：normal）</td>\n</tr>\n<tr>\n<td><code>source</code></td>\n<td>enum</td>\n<td>自動</td>\n<td>user、agent（保存者）</td>\n</tr>\n<tr>\n<td><code>verified</code></td>\n<td>bool</td>\n<td>自動</td>\n<td>人間が検証済みか</td>\n</tr>\n<tr>\n<td><code>confidence</code></td>\n<td>float</td>\n<td>–</td>\n<td>0.0 〜 1.0（デフォルト：user は 1.0、agent は 0.7）</td>\n</tr>\n<tr>\n<td><code>expires_at</code></td>\n<td>timestamp</td>\n<td>–</td>\n<td>このメモリを忘れるタイミング</td>\n</tr>\n<tr>\n<td><code>mind_id</code></td>\n<td>string</td>\n<td>自動</td>\n<td>所有する mind</td>\n</tr>\n<tr>\n<td><code>created_at</code></td>\n<td>timestamp</td>\n<td>自動</td>\n<td>初回保存日時</td>\n</tr>\n<tr>\n<td><code>updated_at</code></td>\n<td>timestamp</td>\n<td>自動</td>\n<td>最終更新日時</td>\n</tr>\n</tbody></table>\n<h2>カテゴリ</h2>\n<p>8 つのカテゴリが一般的な LLM エージェントのユースケースをカバーします。</p>\n<table>\n<thead>\n<tr>\n<th>カテゴリ</th>\n<th>目的</th>\n<th>内容の例</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>identity</code></td>\n<td>ユーザーが誰か</td>\n<td>&quot;User is Michael Schäfer, software engineer in Berlin&quot;</td>\n</tr>\n<tr>\n<td><code>preference</code></td>\n<td>ユーザーの設定</td>\n<td>&quot;Prefers concise technical responses&quot;</td>\n</tr>\n<tr>\n<td><code>fact</code></td>\n<td>検証可能な事実</td>\n<td>&quot;Office is in Berlin, timezone Europe/Berlin&quot;</td>\n</tr>\n<tr>\n<td><code>project</code></td>\n<td>プロジェクトのステータス</td>\n<td>&quot;Synapse v1.5.0 deployed, working on v1.6.0 docs&quot;</td>\n</tr>\n<tr>\n<td><code>skill</code></td>\n<td>ユーザーのスキル</td>\n<td>&quot;Advanced Python, 10+ years&quot;</td>\n</tr>\n<tr>\n<td><code>mistake</code></td>\n<td>過去のエラー</td>\n<td>&quot;Forgot to bump npm version — CI failed&quot;</td>\n</tr>\n<tr>\n<td><code>context</code></td>\n<td>セッションのコンテキスト</td>\n<td>&quot;Currently reviewing PR #42&quot;</td>\n</tr>\n<tr>\n<td><code>note</code></td>\n<td>その他のメモ</td>\n<td>&quot;Try Redis for caching next sprint&quot;</td>\n</tr>\n</tbody></table>\n<h2>キー：安定した識別子</h2>\n<p><code>key</code> フィールドは重要です — 重複を作らずにメモリを更新するための方法です。</p>\n<pre><code class=\"hljs language-python\"><span class=\"hljs-comment\"># First store</span>\nstore(<span class=\"hljs-string\">&quot;project&quot;</span>, <span class=\"hljs-string\">&quot;project_synapse_status&quot;</span>, <span class=\"hljs-string\">&quot;v1.4.0 deployed&quot;</span>, priority=<span class=\"hljs-string\">&quot;high&quot;</span>)\n\n<span class=\"hljs-comment\"># Update with same key (overwrites, doesn&#x27;t duplicate)</span>\nstore(<span class=\"hljs-string\">&quot;project&quot;</span>, <span class=\"hljs-string\">&quot;project_synapse_status&quot;</span>, <span class=\"hljs-string\">&quot;v1.5.0 deployed&quot;</span>, priority=<span class=\"hljs-string\">&quot;high&quot;</span>)</code></pre><p><strong>キーのルール：</strong></p>\n<ul>\n<li>(category, mind) 内でユニークである必要があります</li>\n<li><code>snake_case</code> を使用</li>\n<li>明確さのためにカテゴリをプレフィックスに：<code>preference_communication</code>、<code>mistake_npm_version</code></li>\n<li>安定性を保つ — 作成後にキーを変更しない</li>\n</ul>\n<h2>タグ：検索用</h2>\n<p>タグにより高速なフィルタリングと検索が可能です。</p>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># Find all memories with tag &quot;docker&quot;</span>\nGET /memory/by-tag?tag=docker\n\n<span class=\"hljs-comment\"># FTS5 search within tagged subset</span>\nGET /memory/search?q=swarm&amp;tag=docker</code></pre><p><strong>タグのベストプラクティス：</strong></p>\n<ul>\n<li>メモリごとに 2〜5 個のタグ（付けすぎない）</li>\n<li>一貫性のために小文字</li>\n<li>プロジェクト名、トピック、技術を使用</li>\n<li>タグは大文字小文字を区別しません</li>\n</ul>\n<h2>優先度レベル</h2>\n<table>\n<thead>\n<tr>\n<th>優先度</th>\n<th>使用場面</th>\n<th>再取得時の挙動</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>critical</code></td>\n<td>ID、法的、不可逆</td>\n<td>常に再取得の先頭</td>\n</tr>\n<tr>\n<td><code>high</code></td>\n<td>進行中のプロジェクト、主要な設定</td>\n<td>再取得で目立つ</td>\n</tr>\n<tr>\n<td><code>normal</code></td>\n<td>ほとんどのメモリ（デフォルト）</td>\n<td>標準的な再取得順</td>\n</tr>\n<tr>\n<td><code>low</code></td>\n<td>一時的、知っておくとよいこと</td>\n<td>要約される可能性</td>\n</tr>\n</tbody></table>\n<p><code>/memory/recall</code> は優先度（critical が先頭）、次に新しさでソートします。</p>\n<h2>ソース：user と agent</h2>\n<p>メモリには <code>source</code> が付与されます。</p>\n<ul>\n<li><code>user</code> — 人間が保存（JWT または human UI 経由）</li>\n<li><code>agent</code> — LLM エージェントが保存（Mind Key 経由）</li>\n</ul>\n<p>これは以下に影響します。</p>\n<ul>\n<li><strong>検証：</strong> <code>user</code> メモリは自動検証、<code>agent</code> メモリは未検証</li>\n<li><strong>信頼度：</strong> <code>user</code> はデフォルト 1.0、<code>agent</code> は 0.7</li>\n<li><strong>再取得：</strong> <code>/memory/recall</code> は未検証メモリに「(unverified)」を付ける</li>\n</ul>\n<div class=\"callout callout-note\">`agent` ソースのメモリは適切な懐疑心を持って扱ってください。ユーザーが直接述べたものではなく、推論や仮定の可能性があります。</div><h2>検証</h2>\n<p><code>verified</code> フラグは人間がメモリを確認したことを示します。</p>\n<ul>\n<li><code>user</code> メモリ：自動検証（<code>true</code>）</li>\n<li><code>agent</code> メモリ：デフォルトで未検証（<code>false</code>）</li>\n</ul>\n<p>以下でメモリを検証します。</p>\n<pre><code class=\"hljs language-bash\">curl -X POST https://synapse.schaefer.zone/memory/mem_001/verify \\\n  -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_JWT&quot;</span></code></pre><div class=\"callout callout-note\">検証には Mind Key（エージェント認証）ではなく JWT（人間の認証）が必要です。これにより、人間のみがメモリを検証済みとしてマークできます。</div><h2>信頼度</h2>\n<p><code>confidence</code> フィールド（0.0 〜 1.0）はメモリの信頼性を示します。</p>\n<ul>\n<li>1.0 — ユーザーが直接述べた</li>\n<li>0.7 — エージェントが推論した</li>\n<li>0.5 — 不確実、検証が必要</li>\n<li>0.0 — 明示的に疑わしい</li>\n</ul>\n<p>保存時に信頼度を設定します。</p>\n<pre><code class=\"hljs language-json\"><span class=\"hljs-punctuation\">{</span>\n  <span class=\"hljs-attr\">&quot;category&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;preference&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;key&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;prefers_dark_mode&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;content&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;User seems to prefer dark mode (based on their IDE screenshots)&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;confidence&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-number\">0.5</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;source&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;agent&quot;</span>\n<span class=\"hljs-punctuation\">}</span></code></pre><h2>有効期限</h2>\n<p>時間依存のメモリには <code>expires_at</code> を設定します。</p>\n<pre><code class=\"hljs language-json\"><span class=\"hljs-punctuation\">{</span>\n  <span class=\"hljs-attr\">&quot;category&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;context&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;key&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;current_meeting_topic&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;content&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;Discussing Q3 roadmap&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;expires_at&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;2026-06-28T00:00:00Z&quot;</span>\n<span class=\"hljs-punctuation\">}</span></code></pre><p>期限切れのメモリは <code>/memory/recall</code> で返されません（ただし DB には存在）。<code>/memory/expiring?within=7d</code> で期限切れが近いメモリを確認できます。</p>\n<h2>メモリのライフサイクル</h2>\n<pre><code class=\"hljs language-plaintext\">                  ┌─────────────────┐\n                  │     Create      │\n                  │  POST /memory   │\n                  └────────┬────────┘\n                           │\n                           ▼\n                  ┌─────────────────┐\n                  │     Active      │ ◀──── PUT /memory/:id (update)\n                  │  (in recall)    │\n                  └────────┬────────┘\n                           │\n              ┌────────────┼────────────┐\n              │            │            │\n              ▼            ▼            ▼\n        ┌──────────┐ ┌──────────┐ ┌──────────┐\n        │ Expired  │ │ Verified │ │ Deleted  │\n        │ (in DB)  │ │ (flag)   │ │ (gone)   │\n        └──────────┘ └──────────┘ └──────────┘</code></pre><h2>再取得時の挙動</h2>\n<p><code>GET /memory/recall</code> は LLM コンテキスト向けに最適化されたプレーンテキストの要約を返します。</p>\n<pre><code class=\"hljs language-plaintext\">Mind: Michael&#x27;s Mind\nMemories: 12 total (10 verified, 2 unverified)\n\n[001] identity (CRITICAL) [verified]\n  user_name\n  Michael Schäfer\n  Tags: person, identity\n\n[002] preference (HIGH) [verified]\n  communication_style\n  Prefers concise technical responses\n  Tags: communication\n\n[003] project (HIGH) [unverified]\n  synapse_status\n  v1.5.0 deployed, working on v1.6.0 docs\n  Tags: synapse, deployment\n\n...</code></pre><ul>\n<li>優先度（critical → low）、次に新しさでソート</li>\n<li>未検証メモリは <code>[unverified]</code> でマーク</li>\n<li>タグはコンテキストのために含まれる</li>\n<li>プレーンテキスト（JSON 解析不要）</li>\n</ul>\n<h2>次のステップ</h2>\n<ul>\n<li><a href=\"/docs/api/memory\">Memory API</a></li>\n<li><a href=\"/docs/guides/memory-best-practices\">Memory Best Practices</a></li>\n<li><a href=\"/docs/concepts/fts5-search\">FTS5 Search</a></li>\n</ul>\n","urls":{"html":"/docs/concepts/memory-model","text":"/docs/concepts/memory-model?format=text","json":"/docs/concepts/memory-model?format=json","llm":"/docs/concepts/memory-model?format=llm"},"translations_available":["en","zh","hi","es","fr","ar","pt","ru","ja","de","it","ko","nl","pl","tr","sv","vi","th","id","uk"]}