{"title":"Memory API","slug":"memory","category":"api","summary":"อ้างอิงครบถ้วนสำหรับ 22 memory endpoint: store, recall, search, semantic search, sync, audit และอื่น ๆ","audience":["human","llm"],"tags":["api","memory","crud","search","fts5","semantic"],"difficulty":"intermediate","updated":"2026-06-27","word_count":420,"read_minutes":2,"llm_context":"Auth: Mind Key (Authorization: Bearer mk_xxx OR ?key=mk_xxx)\nALWAYS call GET /memory/recall at session start.\nPOST /memory with same category+key updates the existing memory.\nCategories: identity, preference, fact, project, skill, mistake, context, note, credentials\nPriorities: low, normal, high, critical\nSearch: GET /memory/search?q=... (FTS5 syntax: AND, OR, \"phrases\", prefix*)\nSemantic: GET /memory/semantic-search?q=... (slower, conceptual)\nSync: GET /memory/diff?since=TIMESTAMP (incremental sync)\nExport: GET /memory/mind-export (full JSON dump)\n","lang":"th","translated":true,"requested_lang":"th","content_markdown":"\n# Memory API\n\nMemory API เป็นหัวใจของ Synapse ให้บริการ 22 endpoint สำหรับจัดเก็บ, ดึง, ค้นหา, และจัดการ memory ที่มีโครงสร้าง endpoint ทั้งหมดต้องใช้ Mind Key สำหรับการยืนยันตัวตน\n\n> [!CRITICAL]\n> **เรียก `GET /memory/recall` เสมอที่จุดเริ่มต้นของทุก session** นี่เป็นวิธีเดียวที่จะ rebuild context จาก session ก่อนหน้า\n\n## Categories\n\nmemory ถูกจัดเป็น 8 category:\n\n| Category | กรณีใช้งาน |\n|----------|----------|\n| `identity` | ชื่อผู้ใช้, role, ข้อมูลติดต่อ, ค่ากำหนดเกี่ยวกับตนเอง |\n| `preference` | สิ่งที่ชอบ/ไม่ชอบ, สไตล์การทำงาน, ค่ากำหนดการสื่อสาร |\n| `fact` | fact ที่ตรวจสอบได้ (รายละเอียดโปรเจกต์, วันที่, URL) |\n| `project` | สถานะโปรเจกต์, milestone, architecture |\n| `skill` | สิ่งที่ผู้ใช้ทำได้ดี |\n| `mistake` | error ในอดีต — หลีกเลี่ยงการทำซ้ำ |\n| `context` | context ที่เกี่ยวข้องกับ session |\n| `note` | note อื่น ๆ |\n\n## Priorities\n\n- `low` — รู้ไว้ก็ดี\n- `normal` — ค่าเริ่มต้น\n- `high` — สำคัญ\n- `critical` — ต้องไม่ลืมเด็ดขาด (ตัวตนผู้ใช้, ข้อมูลทางกฎหมาย)\n\n## Core Endpoints\n\n### GET /memory/recall\n\nส่งกลับ memory ทั้งหมดในรูปแบบ plain text ที่ปรับให้เหมาะกับ LLM เรียกสิ่งนี้ที่จุดเริ่มต้นของทุก session\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/memory/recall\n```\n\nResponse (text/plain):\n\n```\nMind: Michael's Mind\nMemories: 12 total (10 verified)\n\n[001] identity (CRITICAL)\n  user_name\n  Michael Schäfer\n  Tags: person, identity\n\n...\n```\n\n### POST /memory\n\nจัดเก็บ memory ใหม่หรืออัปเดต memory ที่มีอยู่ (category + key เดียวกัน = อัปเดต)\n\n```bash\ncurl -X POST https://synapse.schaefer.zone/memory \\\n  -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"category\": \"fact\",\n    \"key\": \"user_name\",\n    \"content\": \"The user's name is Michael Schäfer\",\n    \"tags\": [\"person\", \"identity\"],\n    \"priority\": \"critical\"\n  }'\n```\n\nResponse: `{ \"id\": \"mem_001\", \"status\": \"stored\" }`\n\n### GET /memory\n\nรายการ memory พร้อม filter ที่เลือกได้\n\n```bash\n# All memories (JSON)\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     \"https://synapse.schaefer.zone/memory?limit=50&offset=0\"\n\n# Filter by category\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     \"https://synapse.schaefer.zone/memory?category=project\"\n\n# Filter by tag\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     \"https://synapse.schaefer.zone/memory?tag=docker\"\n```\n\n### PUT /memory/:id\n\nอัปเดต memory เฉพาะตาม ID\n\n```bash\ncurl -X PUT https://synapse.schaefer.zone/memory/mem_001 \\\n  -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"content\": \"Updated content\", \"priority\": \"high\"}'\n```\n\n### DELETE /memory/:id\n\nลบ memory เดียว\n\n```bash\ncurl -X DELETE -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/memory/mem_001\n```\n\n## Search Endpoints\n\n### GET /memory/search\n\nFull-text search โดยใช้ FTS5\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     \"https://synapse.schaefer.zone/memory/search?q=docker+swarm\"\n```\n\nไวยากรณ์ FTS5:\n\n- หลายคำ = AND: `docker swarm`\n- Phrase: `\"docker swarm\"`\n- Prefix: `docker*`\n- Boolean: `docker OR kubernetes`\n- Exclude: `docker -swarm`\n\n### GET /memory/semantic-search\n\nการค้นหาเชิงแนวคิดโดยใช้ embeddings (ช้ากว่า FTS5 แต่เข้าใจความหมาย)\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     \"https://synapse.schaefer.zone/memory/semantic-search?q=container+orchestration\"\n```\n\nส่งกลับ memory ที่คล้ายเชิง semantic กับ query แม้ไม่มี keyword ตรงกัน มีประโยชน์สำหรับ \"ค้นหา memory เกี่ยวกับ X\" โดยที่ X ถูกอธิบายต่างกัน\n\n### GET /memory/by-tag\n\nรายการ memory ตาม tag\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/memory/by-tag?tag=docker\n```\n\n### GET /memory/related/:id\n\nค้นหา memory ที่เกี่ยวข้องกับ memory เฉพาะ (ผ่าน tag ที่ใช้ร่วมกัน)\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/memory/related/mem_001\n```\n\n## Sync & Diff\n\n### GET /memory/diff\n\nSync แบบ incremental — ส่งกลับ memory ที่เปลี่ยนแปลงตั้งแต่ timestamp\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     \"https://synapse.schaefer.zone/memory/diff?since=1700000000\"\n```\n\nResponse: `{ \"added\": [...], \"updated\": [...], \"deleted\": [...] }`\n\n### POST /memory/sync\n\nนำ diff จาก instance อื่นมาใช้ (สำหรับ self-hosted sync)\n\n```bash\ncurl -X POST https://synapse.schaefer.zone/memory/sync \\\n  -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"added\": [...], \"updated\": [...], \"deleted\": [...]}'\n```\n\n## การดำเนินการแบบ Bulk\n\n### POST /memory/bulk-delete\n\nลบ memory หลายรายการตาม ID\n\n```bash\ncurl -X POST https://synapse.schaefer.zone/memory/bulk-delete \\\n  -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"ids\": [\"mem_001\", \"mem_002\", \"mem_003\"]}'\n```\n\n### POST /memory/embed-batch\n\nสร้าง embeddings สำหรับ memory ที่ยังไม่มี (สำหรับ semantic search)\n\n```bash\ncurl -X POST https://synapse.schaefer.zone/memory/embed-batch \\\n  -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"limit\": 100}'\n```\n\n### GET /memory/embed-batch-status\n\nตรวจสอบความคืบหน้าการสร้าง embedding\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/memory/embed-batch-status\n```\n\n## การยืนยัน\n\nmemory มี flag `verified` memory ที่จัดเก็บโดย agent จะเป็น unverified โดยค่าเริ่มต้น (`source=agent`); memory ที่จัดเก็บโดย human จะเป็น verified (`source=user`)\n\n### POST /memory/verify\n\nทำเครื่องหมาย memory ว่า verified (ต้องใช้ JWT ไม่ใช่ Mind Key)\n\n```bash\ncurl -X POST https://synapse.schaefer.zone/memory/mem_001/verify \\\n  -H \"Authorization: Bearer YOUR_JWT\"\n```\n\n### POST /memory/unverify\n\nทำเครื่องหมาย memory ว่า unverified (ต้องใช้ JWT)\n\n```bash\ncurl -X POST https://synapse.schaefer.zone/memory/mem_001/unverify \\\n  -H \"Authorization: Bearer YOUR_JWT\"\n```\n\n### GET /memory/unverified\n\nรายการ memory ที่รอการยืนยันจาก human\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     \"https://synapse.schaefer.zone/memory/unverified?limit=100\"\n```\n\n## Statistics & Audit\n\n### GET /memory/stats\n\nสถิติรวมสำหรับ mind ปัจจุบัน\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/memory/stats\n```\n\nส่งกลับ: `{ \"total\": 12, \"verified\": 10, \"unverified\": 2, \"by_category\": {...}, \"by_priority\": {...} }`\n\n### GET /memory/audit\n\nAudit log ของการดำเนินการที่เปลี่ยนแปลงสถานะทั้งหมด\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     \"https://synapse.schaefer.zone/memory/audit?limit=100&action=store\"\n```\n\n### GET /memory/contradictions\n\nตรวจหา contradiction ที่อาจเกิดขึ้นใน memory ที่จัดเก็บไว้\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/memory/contradictions\n```\n\n### GET /memory/expiring\n\nรายการ memory ที่มีวันหมดอายุใกล้เข้ามา\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     \"https://synapse.schaefer.zone/memory/expiring?within=7d\"\n```\n\n## Health & Export\n\n### GET /memory/health\n\nHealth check อย่างรวดเร็วสำหรับระบบ memory\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/memory/health\n```\n\n### GET /memory/mind-export\n\nJSON export แบบเต็มของ memory ทั้งหมด (สำหรับสำรองข้อมูล)\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/memory/mind-export > backup.json\n```\n\n### POST /memory/compact\n\nรวบรวม memory ที่คล้ายกัน (auto-summarization)\n\n```bash\ncurl -X POST https://synapse.schaefer.zone/memory/compact \\\n  -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"dry_run\": true}'\n```\n\n## ขั้นตอนถัดไป\n\n- [Quick Start for LLMs](/docs/getting-started/quick-start-llm)\n- [Memory Best Practices](/docs/guides/memory-best-practices)\n- [FTS5 Search](/docs/concepts/fts5-search)\n- [Semantic Search](/docs/concepts/semantic-search)\n","content_html":"<h1>Memory API</h1>\n<p>Memory API เป็นหัวใจของ Synapse ให้บริการ 22 endpoint สำหรับจัดเก็บ, ดึง, ค้นหา, และจัดการ memory ที่มีโครงสร้าง endpoint ทั้งหมดต้องใช้ Mind Key สำหรับการยืนยันตัวตน</p>\n<div class=\"callout callout-critical\">**เรียก `GET /memory/recall` เสมอที่จุดเริ่มต้นของทุก session** นี่เป็นวิธีเดียวที่จะ rebuild context จาก session ก่อนหน้า</div><h2>Categories</h2>\n<p>memory ถูกจัดเป็น 8 category:</p>\n<table>\n<thead>\n<tr>\n<th>Category</th>\n<th>กรณีใช้งาน</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>identity</code></td>\n<td>ชื่อผู้ใช้, role, ข้อมูลติดต่อ, ค่ากำหนดเกี่ยวกับตนเอง</td>\n</tr>\n<tr>\n<td><code>preference</code></td>\n<td>สิ่งที่ชอบ/ไม่ชอบ, สไตล์การทำงาน, ค่ากำหนดการสื่อสาร</td>\n</tr>\n<tr>\n<td><code>fact</code></td>\n<td>fact ที่ตรวจสอบได้ (รายละเอียดโปรเจกต์, วันที่, URL)</td>\n</tr>\n<tr>\n<td><code>project</code></td>\n<td>สถานะโปรเจกต์, milestone, architecture</td>\n</tr>\n<tr>\n<td><code>skill</code></td>\n<td>สิ่งที่ผู้ใช้ทำได้ดี</td>\n</tr>\n<tr>\n<td><code>mistake</code></td>\n<td>error ในอดีต — หลีกเลี่ยงการทำซ้ำ</td>\n</tr>\n<tr>\n<td><code>context</code></td>\n<td>context ที่เกี่ยวข้องกับ session</td>\n</tr>\n<tr>\n<td><code>note</code></td>\n<td>note อื่น ๆ</td>\n</tr>\n</tbody></table>\n<h2>Priorities</h2>\n<ul>\n<li><code>low</code> — รู้ไว้ก็ดี</li>\n<li><code>normal</code> — ค่าเริ่มต้น</li>\n<li><code>high</code> — สำคัญ</li>\n<li><code>critical</code> — ต้องไม่ลืมเด็ดขาด (ตัวตนผู้ใช้, ข้อมูลทางกฎหมาย)</li>\n</ul>\n<h2>Core Endpoints</h2>\n<h3>GET /memory/recall</h3>\n<p>ส่งกลับ memory ทั้งหมดในรูปแบบ plain text ที่ปรับให้เหมาะกับ LLM เรียกสิ่งนี้ที่จุดเริ่มต้นของทุก session</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/memory/recall</code></pre><p>Response (text/plain):</p>\n<pre><code class=\"hljs language-plaintext\">Mind: Michael&#x27;s Mind\nMemories: 12 total (10 verified)\n\n[001] identity (CRITICAL)\n  user_name\n  Michael Schäfer\n  Tags: person, identity\n\n...</code></pre><h3>POST /memory</h3>\n<p>จัดเก็บ memory ใหม่หรืออัปเดต memory ที่มีอยู่ (category + key เดียวกัน = อัปเดต)</p>\n<pre><code class=\"hljs language-bash\">curl -X POST https://synapse.schaefer.zone/memory \\\n  -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n  -H <span class=\"hljs-string\">&quot;Content-Type: application/json&quot;</span> \\\n  -d <span class=\"hljs-string\">&#x27;{\n    &quot;category&quot;: &quot;fact&quot;,\n    &quot;key&quot;: &quot;user_name&quot;,\n    &quot;content&quot;: &quot;The user&#x27;</span>s name is Michael Schäfer<span class=\"hljs-string\">&quot;,\n    &quot;</span>tags<span class=\"hljs-string\">&quot;: [&quot;</span>person<span class=\"hljs-string\">&quot;, &quot;</span>identity<span class=\"hljs-string\">&quot;],\n    &quot;</span>priority<span class=\"hljs-string\">&quot;: &quot;</span>critical<span class=\"hljs-string\">&quot;\n  }&#x27;</span></code></pre><p>Response: <code>{ &quot;id&quot;: &quot;mem_001&quot;, &quot;status&quot;: &quot;stored&quot; }</code></p>\n<h3>GET /memory</h3>\n<p>รายการ memory พร้อม filter ที่เลือกได้</p>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># All memories (JSON)</span>\ncurl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone/memory?limit=50&amp;offset=0&quot;</span>\n\n<span class=\"hljs-comment\"># Filter by category</span>\ncurl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone/memory?category=project&quot;</span>\n\n<span class=\"hljs-comment\"># Filter by tag</span>\ncurl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone/memory?tag=docker&quot;</span></code></pre><h3>PUT /memory/:id</h3>\n<p>อัปเดต memory เฉพาะตาม ID</p>\n<pre><code class=\"hljs language-bash\">curl -X PUT https://synapse.schaefer.zone/memory/mem_001 \\\n  -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n  -H <span class=\"hljs-string\">&quot;Content-Type: application/json&quot;</span> \\\n  -d <span class=\"hljs-string\">&#x27;{&quot;content&quot;: &quot;Updated content&quot;, &quot;priority&quot;: &quot;high&quot;}&#x27;</span></code></pre><h3>DELETE /memory/:id</h3>\n<p>ลบ memory เดียว</p>\n<pre><code class=\"hljs language-bash\">curl -X DELETE -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/memory/mem_001</code></pre><h2>Search Endpoints</h2>\n<h3>GET /memory/search</h3>\n<p>Full-text search โดยใช้ FTS5</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone/memory/search?q=docker+swarm&quot;</span></code></pre><p>ไวยากรณ์ FTS5:</p>\n<ul>\n<li>หลายคำ = AND: <code>docker swarm</code></li>\n<li>Phrase: <code>&quot;docker swarm&quot;</code></li>\n<li>Prefix: <code>docker*</code></li>\n<li>Boolean: <code>docker OR kubernetes</code></li>\n<li>Exclude: <code>docker -swarm</code></li>\n</ul>\n<h3>GET /memory/semantic-search</h3>\n<p>การค้นหาเชิงแนวคิดโดยใช้ embeddings (ช้ากว่า FTS5 แต่เข้าใจความหมาย)</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone/memory/semantic-search?q=container+orchestration&quot;</span></code></pre><p>ส่งกลับ memory ที่คล้ายเชิง semantic กับ query แม้ไม่มี keyword ตรงกัน มีประโยชน์สำหรับ &quot;ค้นหา memory เกี่ยวกับ X&quot; โดยที่ X ถูกอธิบายต่างกัน</p>\n<h3>GET /memory/by-tag</h3>\n<p>รายการ memory ตาม tag</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/memory/by-tag?tag=docker</code></pre><h3>GET /memory/related/:id</h3>\n<p>ค้นหา memory ที่เกี่ยวข้องกับ memory เฉพาะ (ผ่าน tag ที่ใช้ร่วมกัน)</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/memory/related/mem_001</code></pre><h2>Sync &amp; Diff</h2>\n<h3>GET /memory/diff</h3>\n<p>Sync แบบ incremental — ส่งกลับ memory ที่เปลี่ยนแปลงตั้งแต่ timestamp</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone/memory/diff?since=1700000000&quot;</span></code></pre><p>Response: <code>{ &quot;added&quot;: [...], &quot;updated&quot;: [...], &quot;deleted&quot;: [...] }</code></p>\n<h3>POST /memory/sync</h3>\n<p>นำ diff จาก instance อื่นมาใช้ (สำหรับ self-hosted sync)</p>\n<pre><code class=\"hljs language-bash\">curl -X POST https://synapse.schaefer.zone/memory/sync \\\n  -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n  -H <span class=\"hljs-string\">&quot;Content-Type: application/json&quot;</span> \\\n  -d <span class=\"hljs-string\">&#x27;{&quot;added&quot;: [...], &quot;updated&quot;: [...], &quot;deleted&quot;: [...]}&#x27;</span></code></pre><h2>การดำเนินการแบบ Bulk</h2>\n<h3>POST /memory/bulk-delete</h3>\n<p>ลบ memory หลายรายการตาม ID</p>\n<pre><code class=\"hljs language-bash\">curl -X POST https://synapse.schaefer.zone/memory/bulk-delete \\\n  -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n  -H <span class=\"hljs-string\">&quot;Content-Type: application/json&quot;</span> \\\n  -d <span class=\"hljs-string\">&#x27;{&quot;ids&quot;: [&quot;mem_001&quot;, &quot;mem_002&quot;, &quot;mem_003&quot;]}&#x27;</span></code></pre><h3>POST /memory/embed-batch</h3>\n<p>สร้าง embeddings สำหรับ memory ที่ยังไม่มี (สำหรับ semantic search)</p>\n<pre><code class=\"hljs language-bash\">curl -X POST https://synapse.schaefer.zone/memory/embed-batch \\\n  -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n  -H <span class=\"hljs-string\">&quot;Content-Type: application/json&quot;</span> \\\n  -d <span class=\"hljs-string\">&#x27;{&quot;limit&quot;: 100}&#x27;</span></code></pre><h3>GET /memory/embed-batch-status</h3>\n<p>ตรวจสอบความคืบหน้าการสร้าง embedding</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/memory/embed-batch-status</code></pre><h2>การยืนยัน</h2>\n<p>memory มี flag <code>verified</code> memory ที่จัดเก็บโดย agent จะเป็น unverified โดยค่าเริ่มต้น (<code>source=agent</code>); memory ที่จัดเก็บโดย human จะเป็น verified (<code>source=user</code>)</p>\n<h3>POST /memory/verify</h3>\n<p>ทำเครื่องหมาย memory ว่า verified (ต้องใช้ JWT ไม่ใช่ Mind Key)</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><h3>POST /memory/unverify</h3>\n<p>ทำเครื่องหมาย memory ว่า unverified (ต้องใช้ JWT)</p>\n<pre><code class=\"hljs language-bash\">curl -X POST https://synapse.schaefer.zone/memory/mem_001/unverify \\\n  -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_JWT&quot;</span></code></pre><h3>GET /memory/unverified</h3>\n<p>รายการ memory ที่รอการยืนยันจาก human</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone/memory/unverified?limit=100&quot;</span></code></pre><h2>Statistics &amp; Audit</h2>\n<h3>GET /memory/stats</h3>\n<p>สถิติรวมสำหรับ mind ปัจจุบัน</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/memory/stats</code></pre><p>ส่งกลับ: <code>{ &quot;total&quot;: 12, &quot;verified&quot;: 10, &quot;unverified&quot;: 2, &quot;by_category&quot;: {...}, &quot;by_priority&quot;: {...} }</code></p>\n<h3>GET /memory/audit</h3>\n<p>Audit log ของการดำเนินการที่เปลี่ยนแปลงสถานะทั้งหมด</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone/memory/audit?limit=100&amp;action=store&quot;</span></code></pre><h3>GET /memory/contradictions</h3>\n<p>ตรวจหา contradiction ที่อาจเกิดขึ้นใน memory ที่จัดเก็บไว้</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/memory/contradictions</code></pre><h3>GET /memory/expiring</h3>\n<p>รายการ memory ที่มีวันหมดอายุใกล้เข้ามา</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone/memory/expiring?within=7d&quot;</span></code></pre><h2>Health &amp; Export</h2>\n<h3>GET /memory/health</h3>\n<p>Health check อย่างรวดเร็วสำหรับระบบ memory</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/memory/health</code></pre><h3>GET /memory/mind-export</h3>\n<p>JSON export แบบเต็มของ memory ทั้งหมด (สำหรับสำรองข้อมูล)</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/memory/mind-export &gt; backup.json</code></pre><h3>POST /memory/compact</h3>\n<p>รวบรวม memory ที่คล้ายกัน (auto-summarization)</p>\n<pre><code class=\"hljs language-bash\">curl -X POST https://synapse.schaefer.zone/memory/compact \\\n  -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n  -H <span class=\"hljs-string\">&quot;Content-Type: application/json&quot;</span> \\\n  -d <span class=\"hljs-string\">&#x27;{&quot;dry_run&quot;: true}&#x27;</span></code></pre><h2>ขั้นตอนถัดไป</h2>\n<ul>\n<li><a href=\"/docs/getting-started/quick-start-llm\">Quick Start for LLMs</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<li><a href=\"/docs/concepts/semantic-search\">Semantic Search</a></li>\n</ul>\n","urls":{"html":"/docs/api/memory","text":"/docs/api/memory?format=text","json":"/docs/api/memory?format=json","llm":"/docs/api/memory?format=llm"},"translations_available":["en","zh","hi","es","fr","ar","pt","ru","ja","de","it","ko","nl","pl","tr","sv","vi","th","id","uk"]}