{"title":"Quick Start per agenti LLM","slug":"quick-start-llm","category":"getting-started","summary":"In 3 chiamate API: richiama tutte le memorie, ne memorizza una nuova, cerca. Il workflow LLM essenziale.","audience":["llm"],"tags":["llm","agent","quickstart","memory"],"difficulty":"beginner","updated":"2026-06-27","word_count":373,"read_minutes":2,"llm_context":"Base URL: https://synapse.schaefer.zone\nAuth: Authorization: Bearer YOUR_MIND_KEY (header) OR ?key=YOUR_MIND_KEY (query)\nALWAYS call /memory/recall at the start of every session.\nWichtigste Befehle: GET /memory/recall, POST /memory, GET /memory/search?q=...\nCategories: identity, preference, fact, project, skill, mistake, context, note, credentials\nPriorities: low, normal, high, critical\nFTS5 search: multiple words = AND, \"phrases\" in quotes, prefix* for prefix search\n","lang":"it","translated":true,"requested_lang":"it","content_markdown":"\n# Quick Start per agenti LLM\n\nPerde tutta la memoria tra le sessioni. Synapse è il suo cervello esterno.\nQuesta guida mostra le tre chiamate API essenziali che ogni agente LLM deve\nconoscere.\n\n> [!CRITICAL]\n> Chiami `GET /memory/recall` all'INIZIO di OGNI sessione.\n> Senza questa chiamata, non ha memoria di chi è l'utente, cosa ha promesso,\n> o a cosa stava lavorando l'ultima volta.\n\n## Passo 1: Richiami tutte le memorie (SEMPRE PER PRIMO)\n\n```\nGET /memory/recall\nAuthorization: Bearer YOUR_MIND_KEY\n```\n\nRestituisce un riassunto strutturato in testo semplice di tutte le memorie\nsalvate. Lo analizzi per ricostruire il suo modello mentale dell'utente, dei\nsuoi progetti e delle interazioni passate.\n\nRisposta di esempio:\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[002] preference (HIGH)\n  communication_style\n  Prefers concise technical responses, no fluff\n  Tags: communication, preference\n\n[003] project (HIGH)\n  project_synapse\n  Synapse v1.5.0 deployed on vps1.schaefer.zone. Admin panel at /admin.\n  Tags: synapse, deployment\n  ...\n```\n\n## Passo 2: Memorizzi una nuova memoria\n\nQuando impara qualcosa che vale la pena ricordare:\n\n```\nPOST /memory\nAuthorization: Bearer YOUR_MIND_KEY\nContent-Type: application/json\n\n{\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\n**Categorie:** `identity`, `preference`, `fact`, `project`, `skill`, `mistake`, `context`, `note`, `credentials`\n\n**Priorità:** `low`, `normal`, `high`, `critical`\n\n> [!TIP]\n> Includa sempre un campo `key` — un breve identificatore per la memoria. Questo\n> le permette di aggiornare la stessa memoria in seguito con un nuovo POST usando\n> la stessa chiave.\n\n## Passo 3: Cerchi una memoria specifica\n\n```\nGET /memory/search?q=Docker+Swarm\nAuthorization: Bearer YOUR_MIND_KEY\n```\n\n> [!TIP]\n> Sintassi FTS5: più parole = ricerca AND. Frasi tra virgolette: `\"docker swarm\"`.\n> Ricerca per prefisso: `docker*`. Booleano: `docker OR kubernetes`.\n\n## Strumenti aperti (nessun header di auth)\n\nSe il suo strumento può solo aprire URL (nessun header personalizzato), usi il\nparametro `?key=`:\n\n```\nGET /memory/recall?key=YOUR_MIND_KEY\nPOST /memory?key=YOUR_MIND_KEY (+ JSON body)\nGET /memory/search?key=YOUR_MIND_KEY&q=suchbegriff\n```\n\n> [!WARNING]\n> `?key=` è limitato a 60 richieste/minuto. L'header Bearer non ha rate limit.\n> Usi l'header Bearer quando possibile.\n\n## Workflow completo di sessione\n\n1. **Inizio sessione:** `GET /memory/recall` — carica tutte le memorie\n2. **Durante il lavoro:** `GET /memory/search?q=...` — trova fatti specifici\n3. **Su nuove info:** `POST /memory` — le memorizza (con category, key, tags, priority)\n4. **Periodicamente:** `GET /chat/poll` — controlla i messaggi dell'umano\n5. **Fine sessione:** Memorizzi gli ultimi apprendimenti tramite `POST /memory`\n\n## Modelli comuni\n\n### Aggiornare una memoria esistente\n\nPOST `/memory` con la stessa `category` e `key` — la memoria esistente viene\naggiornata, non duplicata.\n\n### Memorizzare lo stato di un progetto\n\n```json\n{\n  \"category\": \"project\",\n  \"key\": \"project_synapse_status\",\n  \"content\": \"Synapse v1.5.0 deployed. Next: v1.6.0 with docs system. CI green.\",\n  \"tags\": [\"synapse\", \"deployment\", \"status\"],\n  \"priority\": \"high\"\n}\n```\n\n### Registrare un errore (per non ripeterlo)\n\n```json\n{\n  \"category\": \"mistake\",\n  \"key\": \"mistake_npm_version_bump\",\n  \"content\": \"Always bump package.json version after changes — npm publish fails otherwise.\",\n  \"tags\": [\"npm\", \"ci\", \"deployment\"],\n  \"priority\": \"high\"\n}\n```\n\n### Verificare i messaggi dell'umano\n\n```\nGET /chat/poll\nAuthorization: Bearer YOUR_MIND_KEY\n```\n\nRestituisce i messaggi non letti dall'umano. Risponda con:\n\n```\nPOST /chat/reply\nAuthorization: Bearer YOUR_MIND_KEY\nContent-Type: application/json\n\n{\"content\": \"Got it! Working on it now.\"}\n```\n\n## Prossimi passi\n\n- [Autenticazione](/docs/getting-started/authentication) — Mind Key vs JWT\n- [Riferimento Memory API](/docs/api/memory) — tutti i 22 endpoint memory\n- [Chat API](/docs/api/chat) — comunicazione asincrona con gli umani\n- [LLM Cookbook](/docs/llm-cookbook/session-start-pattern) — modelli pratici\n","content_html":"<h1>Quick Start per agenti LLM</h1>\n<p>Perde tutta la memoria tra le sessioni. Synapse è il suo cervello esterno.\nQuesta guida mostra le tre chiamate API essenziali che ogni agente LLM deve\nconoscere.</p>\n<div class=\"callout callout-critical\">Chiami `GET /memory/recall` all'INIZIO di OGNI sessione.\nSenza questa chiamata, non ha memoria di chi è l'utente, cosa ha promesso,\no a cosa stava lavorando l'ultima volta.</div><h2>Passo 1: Richiami tutte le memorie (SEMPRE PER PRIMO)</h2>\n<pre><code class=\"hljs language-plaintext\">GET /memory/recall\nAuthorization: Bearer YOUR_MIND_KEY</code></pre><p>Restituisce un riassunto strutturato in testo semplice di tutte le memorie\nsalvate. Lo analizzi per ricostruire il suo modello mentale dell&#39;utente, dei\nsuoi progetti e delle interazioni passate.</p>\n<p>Risposta di esempio:</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[002] preference (HIGH)\n  communication_style\n  Prefers concise technical responses, no fluff\n  Tags: communication, preference\n\n[003] project (HIGH)\n  project_synapse\n  Synapse v1.5.0 deployed on vps1.schaefer.zone. Admin panel at /admin.\n  Tags: synapse, deployment\n  ...</code></pre><h2>Passo 2: Memorizzi una nuova memoria</h2>\n<p>Quando impara qualcosa che vale la pena ricordare:</p>\n<pre><code class=\"hljs language-plaintext\">POST /memory\nAuthorization: Bearer YOUR_MIND_KEY\nContent-Type: application/json\n\n{\n  &quot;category&quot;: &quot;fact&quot;,\n  &quot;key&quot;: &quot;user_name&quot;,\n  &quot;content&quot;: &quot;The user&#x27;s name is Michael Schäfer&quot;,\n  &quot;tags&quot;: [&quot;person&quot;, &quot;identity&quot;],\n  &quot;priority&quot;: &quot;critical&quot;\n}</code></pre><p><strong>Categorie:</strong> <code>identity</code>, <code>preference</code>, <code>fact</code>, <code>project</code>, <code>skill</code>, <code>mistake</code>, <code>context</code>, <code>note</code>, <code>credentials</code></p>\n<p><strong>Priorità:</strong> <code>low</code>, <code>normal</code>, <code>high</code>, <code>critical</code></p>\n<div class=\"callout callout-ok\">Includa sempre un campo `key` — un breve identificatore per la memoria. Questo\nle permette di aggiornare la stessa memoria in seguito con un nuovo POST usando\nla stessa chiave.</div><h2>Passo 3: Cerchi una memoria specifica</h2>\n<pre><code class=\"hljs language-plaintext\">GET /memory/search?q=Docker+Swarm\nAuthorization: Bearer YOUR_MIND_KEY</code></pre><div class=\"callout callout-ok\">Sintassi FTS5: più parole = ricerca AND. Frasi tra virgolette: `\"docker swarm\"`.\nRicerca per prefisso: `docker*`. Booleano: `docker OR kubernetes`.</div><h2>Strumenti aperti (nessun header di auth)</h2>\n<p>Se il suo strumento può solo aprire URL (nessun header personalizzato), usi il\nparametro <code>?key=</code>:</p>\n<pre><code class=\"hljs language-plaintext\">GET /memory/recall?key=YOUR_MIND_KEY\nPOST /memory?key=YOUR_MIND_KEY (+ JSON body)\nGET /memory/search?key=YOUR_MIND_KEY&amp;q=suchbegriff</code></pre><div class=\"callout callout-warn\">`?key=` è limitato a 60 richieste/minuto. L'header Bearer non ha rate limit.\nUsi l'header Bearer quando possibile.</div><h2>Workflow completo di sessione</h2>\n<ol>\n<li><strong>Inizio sessione:</strong> <code>GET /memory/recall</code> — carica tutte le memorie</li>\n<li><strong>Durante il lavoro:</strong> <code>GET /memory/search?q=...</code> — trova fatti specifici</li>\n<li><strong>Su nuove info:</strong> <code>POST /memory</code> — le memorizza (con category, key, tags, priority)</li>\n<li><strong>Periodicamente:</strong> <code>GET /chat/poll</code> — controlla i messaggi dell&#39;umano</li>\n<li><strong>Fine sessione:</strong> Memorizzi gli ultimi apprendimenti tramite <code>POST /memory</code></li>\n</ol>\n<h2>Modelli comuni</h2>\n<h3>Aggiornare una memoria esistente</h3>\n<p>POST <code>/memory</code> con la stessa <code>category</code> e <code>key</code> — la memoria esistente viene\naggiornata, non duplicata.</p>\n<h3>Memorizzare lo stato di un progetto</h3>\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;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. Next: v1.6.0 with docs system. 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;status&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>\n<span class=\"hljs-punctuation\">}</span></code></pre><h3>Registrare un errore (per non ripeterlo)</h3>\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;mistake&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;mistake_npm_version_bump&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;Always bump package.json version after changes — npm publish fails otherwise.&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;npm&quot;</span><span class=\"hljs-punctuation\">,</span> <span class=\"hljs-string\">&quot;ci&quot;</span><span class=\"hljs-punctuation\">,</span> <span class=\"hljs-string\">&quot;deployment&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>\n<span class=\"hljs-punctuation\">}</span></code></pre><h3>Verificare i messaggi dell&#39;umano</h3>\n<pre><code class=\"hljs language-plaintext\">GET /chat/poll\nAuthorization: Bearer YOUR_MIND_KEY</code></pre><p>Restituisce i messaggi non letti dall&#39;umano. Risponda con:</p>\n<pre><code class=\"hljs language-plaintext\">POST /chat/reply\nAuthorization: Bearer YOUR_MIND_KEY\nContent-Type: application/json\n\n{&quot;content&quot;: &quot;Got it! Working on it now.&quot;}</code></pre><h2>Prossimi passi</h2>\n<ul>\n<li><a href=\"/docs/getting-started/authentication\">Autenticazione</a> — Mind Key vs JWT</li>\n<li><a href=\"/docs/api/memory\">Riferimento Memory API</a> — tutti i 22 endpoint memory</li>\n<li><a href=\"/docs/api/chat\">Chat API</a> — comunicazione asincrona con gli umani</li>\n<li><a href=\"/docs/llm-cookbook/session-start-pattern\">LLM Cookbook</a> — modelli pratici</li>\n</ul>\n","urls":{"html":"/docs/getting-started/quick-start-llm","text":"/docs/getting-started/quick-start-llm?format=text","json":"/docs/getting-started/quick-start-llm?format=json","llm":"/docs/getting-started/quick-start-llm?format=llm"},"translations_available":["en","zh","hi","es","fr","ar","pt","ru","ja","de","it","ko","nl","pl","tr","sv","vi","th","id","uk"]}