{"title":"Il modello di memoria","slug":"memory-model","category":"concepts","summary":"Come sono strutturate le memorie — categorie, chiavi, tag, priorità, sorgenti, verifica.","audience":["human","llm"],"tags":["concept","memory","model","structure"],"difficulty":"intermediate","updated":"2026-06-27","word_count":743,"read_minutes":4,"lang":"it","translated":true,"requested_lang":"it","content_markdown":"\n# Il modello di memoria\n\nIl modello di memoria di Synapse è progettato per agenti LLM — sufficientemente\nstrutturato per richiamo affidabile, sufficientemente flessibile per qualsiasi\ndominio.\n\n## Anatomia di una memoria\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## Campi\n\n| Campo | Tipo | Obbligatorio | Descrizione |\n|-------|------|----------|-------------|\n| `id` | string | auto | ID univoco (mem_xxx) |\n| `category` | enum | ✅ | Una delle 8 categorie |\n| `key` | string | ✅ | Identificatore stabile (usato per gli aggiornamenti) |\n| `content` | string | ✅ | Il contenuto della memoria (qualsiasi testo) |\n| `tags` | string[] | – | Per ricerca e filtraggio |\n| `priority` | enum | – | low, normal, high, critical (predefinito: normal) |\n| `source` | enum | auto | user, agent (chi l'ha salvata) |\n| `verified` | bool | auto | Un umano l'ha verificata? |\n| `confidence` | float | – | 0.0 a 1.0 (predefinito: 1.0 per user, 0.7 per agent) |\n| `expires_at` | timestamp | – | Quando dimenticare questa memoria |\n| `mind_id` | string | auto | Quale mente la possiede |\n| `created_at` | timestamp | auto | Prima memorizzazione |\n| `updated_at` | timestamp | auto | Ultima modifica |\n\n## Categorie\n\nOtto categorie coprono i casi d'uso comuni degli agenti LLM:\n\n| Categoria | Scopo | Contenuto di esempio |\n|----------|---------|-----------------|\n| `identity` | Chi è l'utente | \"User is Michael Schäfer, software engineer in Berlin\" |\n| `preference` | Preferenze utente | \"Prefers concise technical responses\" |\n| `fact` | Fatti verificabili | \"Office is in Berlin, timezone Europe/Berlin\" |\n| `project` | Stato del progetto | \"Synapse v1.5.0 deployed, working on v1.6.0 docs\" |\n| `skill` | Competenze dell'utente | \"Advanced Python, 10+ years\" |\n| `mistake` | Errori passati | \"Forgot to bump npm version — CI failed\" |\n| `context` | Contesto di sessione | \"Currently reviewing PR #42\" |\n| `note` | Note varie | \"Try Redis for caching next sprint\" |\n\n## Chiavi: identificatori stabili\n\nIl campo `key` è critico — è come aggiorna le memorie senza creare duplicati.\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**Regole delle chiavi:**\n\n- Devono essere uniche all'interno di (category, mind)\n- Usi `snake_case`\n- Prefissi con categoria per chiarezza: `preference_communication`, `mistake_npm_version`\n- Le mantenga stabili — non cambi le chiavi dopo la creazione\n\n## Tag: per la ricerca\n\nI tag abilitano filtraggio e ricerca veloce:\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**Best practice per i tag:**\n\n- 2-5 tag per memoria (non esageri)\n- Minuscolo per consistenza\n- Usi nomi di progetto, argomenti, tecnologie\n- I tag sono case-insensitive\n\n## Livelli di priorità\n\n| Priorità | Quando usarla | Comportamento di richiamo |\n|----------|-------------|-----------------|\n| `critical` | Identità, legale, irreversibile | Sempre in cima al richiamo |\n| `high` | Progetti attivi, preferenze chiave | In evidenza nel richiamo |\n| `normal` | Maggior parte delle memorie (predefinito) | Ordine di richiamo standard |\n| `low` | Effimero, piace-da-sapere | Potrebbe essere riassunto |\n\n`/memory/recall` ordina per priorità (critical prima), poi per recency.\n\n## Sorgente: user vs agent\n\nLe memorie sono contrassegnate con `source`:\n\n- `user` — salvate da un umano (tramite JWT o UI umana)\n- `agent` — salvate da un agente LLM (tramite Mind Key)\n\nQuesto influenza:\n\n- **Verifica**: le memorie `user` sono auto-verificate, quelle `agent` no\n- **Confidenza**: `user` predefinito a 1.0, `agent` a 0.7\n- **Richiamo**: `/memory/recall` contrassegna le memorie non verificate con \"(unverified)\"\n\n> [!NOTE]\n> Tratti le memorie con sorgente `agent` con scetticismo appropriato. Potrebbero\n> essere dedotte o assunte anziché dichiarate direttamente dall'utente.\n\n## Verifica\n\nIl flag `verified` indica che un umano ha confermato la memoria:\n\n- memorie `user`: auto-verificate (`true`)\n- memorie `agent`: non verificate per default (`false`)\n\nVerifichi le memorie tramite:\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> La verifica richiede JWT (auth umana), non Mind Key (auth agente). Questo\n> garantisce che solo gli umani possano contrassegnare le memorie come verificate.\n\n## Confidenza\n\nIl campo `confidence` (0.0 a 1.0) indica quanto è affidabile la memoria:\n\n- 1.0 — dichiarata direttamente dall'utente\n- 0.7 — dedotta dall'agente\n- 0.5 — incerta, necessita verifica\n- 0.0 — esplicitamente dubitata\n\nImposti la confidenza durante la memorizzazione:\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## Scadenza\n\nImposti `expires_at` per memorie time-sensitive:\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\nLe memorie scadute non vengono restituite da `/memory/recall` (ma esistono\nancora nel DB). Usi `/memory/expiring?within=7d` per vedere le memorie in\nscadenza prossima.\n\n## Ciclo di vita della memoria\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## Comportamento di richiamo\n\n`GET /memory/recall` restituisce un riassunto in testo semplice ottimizzato per\nil contesto 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- Ordinate per priorità (critical → low), poi per recency\n- Le memorie non verificate sono contrassegnate con `[unverified]`\n- Tag inclusi per contesto\n- Testo semplice (nessun parsing JSON necessario)\n\n## Prossimi passi\n\n- [Memory API](/docs/api/memory)\n- [Best practice per la memoria](/docs/guides/memory-best-practices)\n- [Ricerca FTS5](/docs/concepts/fts5-search)\n","content_html":"<h1>Il modello di memoria</h1>\n<p>Il modello di memoria di Synapse è progettato per agenti LLM — sufficientemente\nstrutturato per richiamo affidabile, sufficientemente flessibile per qualsiasi\ndominio.</p>\n<h2>Anatomia di una memoria</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>Campi</h2>\n<table>\n<thead>\n<tr>\n<th>Campo</th>\n<th>Tipo</th>\n<th>Obbligatorio</th>\n<th>Descrizione</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>id</code></td>\n<td>string</td>\n<td>auto</td>\n<td>ID univoco (mem_xxx)</td>\n</tr>\n<tr>\n<td><code>category</code></td>\n<td>enum</td>\n<td>✅</td>\n<td>Una delle 8 categorie</td>\n</tr>\n<tr>\n<td><code>key</code></td>\n<td>string</td>\n<td>✅</td>\n<td>Identificatore stabile (usato per gli aggiornamenti)</td>\n</tr>\n<tr>\n<td><code>content</code></td>\n<td>string</td>\n<td>✅</td>\n<td>Il contenuto della memoria (qualsiasi testo)</td>\n</tr>\n<tr>\n<td><code>tags</code></td>\n<td>string[]</td>\n<td>–</td>\n<td>Per ricerca e filtraggio</td>\n</tr>\n<tr>\n<td><code>priority</code></td>\n<td>enum</td>\n<td>–</td>\n<td>low, normal, high, critical (predefinito: normal)</td>\n</tr>\n<tr>\n<td><code>source</code></td>\n<td>enum</td>\n<td>auto</td>\n<td>user, agent (chi l&#39;ha salvata)</td>\n</tr>\n<tr>\n<td><code>verified</code></td>\n<td>bool</td>\n<td>auto</td>\n<td>Un umano l&#39;ha verificata?</td>\n</tr>\n<tr>\n<td><code>confidence</code></td>\n<td>float</td>\n<td>–</td>\n<td>0.0 a 1.0 (predefinito: 1.0 per user, 0.7 per agent)</td>\n</tr>\n<tr>\n<td><code>expires_at</code></td>\n<td>timestamp</td>\n<td>–</td>\n<td>Quando dimenticare questa memoria</td>\n</tr>\n<tr>\n<td><code>mind_id</code></td>\n<td>string</td>\n<td>auto</td>\n<td>Quale mente la possiede</td>\n</tr>\n<tr>\n<td><code>created_at</code></td>\n<td>timestamp</td>\n<td>auto</td>\n<td>Prima memorizzazione</td>\n</tr>\n<tr>\n<td><code>updated_at</code></td>\n<td>timestamp</td>\n<td>auto</td>\n<td>Ultima modifica</td>\n</tr>\n</tbody></table>\n<h2>Categorie</h2>\n<p>Otto categorie coprono i casi d&#39;uso comuni degli agenti LLM:</p>\n<table>\n<thead>\n<tr>\n<th>Categoria</th>\n<th>Scopo</th>\n<th>Contenuto di esempio</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>identity</code></td>\n<td>Chi è l&#39;utente</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>Preferenze utente</td>\n<td>&quot;Prefers concise technical responses&quot;</td>\n</tr>\n<tr>\n<td><code>fact</code></td>\n<td>Fatti verificabili</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>Stato del progetto</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>Competenze dell&#39;utente</td>\n<td>&quot;Advanced Python, 10+ years&quot;</td>\n</tr>\n<tr>\n<td><code>mistake</code></td>\n<td>Errori passati</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>Contesto di sessione</td>\n<td>&quot;Currently reviewing PR #42&quot;</td>\n</tr>\n<tr>\n<td><code>note</code></td>\n<td>Note varie</td>\n<td>&quot;Try Redis for caching next sprint&quot;</td>\n</tr>\n</tbody></table>\n<h2>Chiavi: identificatori stabili</h2>\n<p>Il campo <code>key</code> è critico — è come aggiorna le memorie senza creare duplicati.</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>Regole delle chiavi:</strong></p>\n<ul>\n<li>Devono essere uniche all&#39;interno di (category, mind)</li>\n<li>Usi <code>snake_case</code></li>\n<li>Prefissi con categoria per chiarezza: <code>preference_communication</code>, <code>mistake_npm_version</code></li>\n<li>Le mantenga stabili — non cambi le chiavi dopo la creazione</li>\n</ul>\n<h2>Tag: per la ricerca</h2>\n<p>I tag abilitano filtraggio e ricerca veloce:</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>Best practice per i tag:</strong></p>\n<ul>\n<li>2-5 tag per memoria (non esageri)</li>\n<li>Minuscolo per consistenza</li>\n<li>Usi nomi di progetto, argomenti, tecnologie</li>\n<li>I tag sono case-insensitive</li>\n</ul>\n<h2>Livelli di priorità</h2>\n<table>\n<thead>\n<tr>\n<th>Priorità</th>\n<th>Quando usarla</th>\n<th>Comportamento di richiamo</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>critical</code></td>\n<td>Identità, legale, irreversibile</td>\n<td>Sempre in cima al richiamo</td>\n</tr>\n<tr>\n<td><code>high</code></td>\n<td>Progetti attivi, preferenze chiave</td>\n<td>In evidenza nel richiamo</td>\n</tr>\n<tr>\n<td><code>normal</code></td>\n<td>Maggior parte delle memorie (predefinito)</td>\n<td>Ordine di richiamo standard</td>\n</tr>\n<tr>\n<td><code>low</code></td>\n<td>Effimero, piace-da-sapere</td>\n<td>Potrebbe essere riassunto</td>\n</tr>\n</tbody></table>\n<p><code>/memory/recall</code> ordina per priorità (critical prima), poi per recency.</p>\n<h2>Sorgente: user vs agent</h2>\n<p>Le memorie sono contrassegnate con <code>source</code>:</p>\n<ul>\n<li><code>user</code> — salvate da un umano (tramite JWT o UI umana)</li>\n<li><code>agent</code> — salvate da un agente LLM (tramite Mind Key)</li>\n</ul>\n<p>Questo influenza:</p>\n<ul>\n<li><strong>Verifica</strong>: le memorie <code>user</code> sono auto-verificate, quelle <code>agent</code> no</li>\n<li><strong>Confidenza</strong>: <code>user</code> predefinito a 1.0, <code>agent</code> a 0.7</li>\n<li><strong>Richiamo</strong>: <code>/memory/recall</code> contrassegna le memorie non verificate con &quot;(unverified)&quot;</li>\n</ul>\n<div class=\"callout callout-note\">Tratti le memorie con sorgente `agent` con scetticismo appropriato. Potrebbero\nessere dedotte o assunte anziché dichiarate direttamente dall'utente.</div><h2>Verifica</h2>\n<p>Il flag <code>verified</code> indica che un umano ha confermato la memoria:</p>\n<ul>\n<li>memorie <code>user</code>: auto-verificate (<code>true</code>)</li>\n<li>memorie <code>agent</code>: non verificate per default (<code>false</code>)</li>\n</ul>\n<p>Verifichi le memorie tramite:</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\">La verifica richiede JWT (auth umana), non Mind Key (auth agente). Questo\ngarantisce che solo gli umani possano contrassegnare le memorie come verificate.</div><h2>Confidenza</h2>\n<p>Il campo <code>confidence</code> (0.0 a 1.0) indica quanto è affidabile la memoria:</p>\n<ul>\n<li>1.0 — dichiarata direttamente dall&#39;utente</li>\n<li>0.7 — dedotta dall&#39;agente</li>\n<li>0.5 — incerta, necessita verifica</li>\n<li>0.0 — esplicitamente dubitata</li>\n</ul>\n<p>Imposti la confidenza durante la memorizzazione:</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>Scadenza</h2>\n<p>Imposti <code>expires_at</code> per memorie time-sensitive:</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>Le memorie scadute non vengono restituite da <code>/memory/recall</code> (ma esistono\nancora nel DB). Usi <code>/memory/expiring?within=7d</code> per vedere le memorie in\nscadenza prossima.</p>\n<h2>Ciclo di vita della memoria</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>Comportamento di richiamo</h2>\n<p><code>GET /memory/recall</code> restituisce un riassunto in testo semplice ottimizzato per\nil contesto 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>Ordinate per priorità (critical → low), poi per recency</li>\n<li>Le memorie non verificate sono contrassegnate con <code>[unverified]</code></li>\n<li>Tag inclusi per contesto</li>\n<li>Testo semplice (nessun parsing JSON necessario)</li>\n</ul>\n<h2>Prossimi passi</h2>\n<ul>\n<li><a href=\"/docs/api/memory\">Memory API</a></li>\n<li><a href=\"/docs/guides/memory-best-practices\">Best practice per la memoria</a></li>\n<li><a href=\"/docs/concepts/fts5-search\">Ricerca FTS5</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"]}