| 
209 | 209 |     "await memory_client.create_long_term_memory([ClientMemoryRecord(\n",  | 
210 | 210 |     "    text=\"Student enrolled in CS101: Introduction to Programming on 2024-09-01\",\n",  | 
211 | 211 |     "    memory_type=\"episodic\",\n",  | 
212 |  | -    "    topics=[\"enrollment\", \"courses\"],\n",  | 
213 |  | -    "    metadata={\"course_code\": \"CS101\", \"date\": \"2024-09-01\"}\n",  | 
 | 212 | +    "    topics=[\"enrollment\", \"courses\", \"CS101\"]\n",  | 
214 | 213 |     ")])\n",  | 
215 | 214 |     "\n",  | 
216 | 215 |     "await memory_client.create_long_term_memory([ClientMemoryRecord(\n",  | 
217 | 216 |     "    text=\"Student completed CS101 with grade A on 2024-12-15\",\n",  | 
218 | 217 |     "    memory_type=\"episodic\",\n",  | 
219 |  | -    "    topics=[\"completion\", \"grades\"],\n",  | 
220 |  | -    "    metadata={\"course_code\": \"CS101\", \"grade\": \"A\", \"date\": \"2024-12-15\"}\n",  | 
 | 218 | +    "    topics=[\"completion\", \"grades\", \"CS101\"]\n",  | 
221 | 219 |     ")])\n",  | 
222 | 220 |     "\n",  | 
223 | 221 |     "await memory_client.create_long_term_memory([ClientMemoryRecord(\n",  | 
224 | 222 |     "    text=\"Student asked about machine learning courses on 2024-09-20\",\n",  | 
225 | 223 |     "    memory_type=\"episodic\",\n",  | 
226 |  | -    "    topics=[\"inquiry\", \"machine_learning\"],\n",  | 
227 |  | -    "    metadata={\"date\": \"2024-09-20\"}\n",  | 
 | 224 | +    "    topics=[\"inquiry\", \"machine_learning\"]\n",  | 
228 | 225 |     ")])\n",  | 
229 | 226 |     "\n",  | 
230 | 227 |     "print(\"✅ Stored 3 episodic memories (events and experiences)\")"  | 
 | 
292 | 289 |     "\n",  | 
293 | 290 |     "for i, memory in enumerate(results.memories, 1):\n",  | 
294 | 291 |     "    print(f\"{i}. {memory.text}\")\n",  | 
295 |  | -    "    print(f\"   Type: {memory.memory_type}\")\n",  | 
296 |  | -    "    if memory.metadata:\n",  | 
297 |  | -    "        print(f\"   Metadata: {memory.metadata}\")\n",  | 
 | 292 | +    "    print(f\"   Type: {memory.memory_type} | Topics: {', '.join(memory.topics or [])}\")\n",  | 
298 | 293 |     "    print()"  | 
299 | 294 |    ]  | 
300 | 295 |   },  | 
 | 
418 | 413 |     "\n",  | 
419 | 414 |     "for i, memory in enumerate(results.memories, 1):\n",  | 
420 | 415 |     "    print(f\"{i}. {memory.text}\")\n",  | 
421 |  | -    "    if memory.metadata:\n",  | 
422 |  | -    "        print(f\"   Metadata: {memory.metadata}\")\n",  | 
 | 416 | +    "    print(f\"   Topics: {', '.join(memory.topics or [])}\")\n",  | 
423 | 417 |     "    print()"  | 
424 | 418 |    ]  | 
425 | 419 |   },  | 
 | 
462 | 456 |     "\n",  | 
463 | 457 |     "### Best Practices\n",  | 
464 | 458 |     "\n",  | 
465 |  | -    "1. **Use descriptive topics** - Makes filtering easier\n",  | 
466 |  | -    "2. **Add metadata** - Especially for episodic memories\n",  | 
467 |  | -    "3. **Write clear memory text** - Will be searched semantically\n",  | 
 | 459 | +    "1. **Use descriptive topics** - Makes filtering and categorization easier\n",  | 
 | 460 | +    "2. **Write clear memory text** - Will be searched semantically\n",  | 
 | 461 | +    "3. **Include relevant details in text** - Dates, names, and context help with retrieval\n",  | 
468 | 462 |     "4. **Let deduplication work** - Don't worry about duplicates\n",  | 
469 | 463 |     "5. **Search before storing** - Check if similar memory exists"  | 
470 | 464 |    ]  | 
 | 
479 | 473 |     "\n",  | 
480 | 474 |     "2. **Test semantic search**: Create memories with different wordings but similar meanings. Search with various queries to see what matches.\n",  | 
481 | 475 |     "\n",  | 
482 |  | -    "3. **Explore metadata**: Add rich metadata to episodic memories. How can you use this in your agent?\n",  | 
 | 476 | +    "3. **Explore topics**: Add rich topics to episodic memories. How can you use topic filtering in your agent?\n",  | 
483 | 477 |     "\n",  | 
484 | 478 |     "4. **Cross-session test**: Create a memory, close the notebook, restart, and verify the memory persists."  | 
485 | 479 |    ]  | 
 | 
0 commit comments