|
146 | 146 | "# Store student preferences\n", |
147 | 147 | "await memory_client.create_long_term_memory([ClientMemoryRecord(\n", |
148 | 148 | " text=\"Student prefers online courses over in-person classes\",\n", |
149 | | - " memory_type=MemoryType(eq=\"semantic\"),\n", |
| 149 | + " memory_type=\"semantic\",\n", |
150 | 150 | " topics=[\"preferences\", \"course_format\"]\n", |
151 | 151 | ")])\n", |
152 | 152 | "\n", |
153 | 153 | "await memory_client.create_long_term_memory([ClientMemoryRecord(\n", |
154 | 154 | " text=\"Student's major is Computer Science with a focus on AI/ML\",\n", |
155 | | - " memory_type=MemoryType(eq=\"semantic\"),\n", |
| 155 | + " memory_type=\"semantic\",\n", |
156 | 156 | " topics=[\"academic_info\", \"major\"]\n", |
157 | 157 | ")])\n", |
158 | 158 | "\n", |
159 | 159 | "await memory_client.create_long_term_memory([ClientMemoryRecord(\n", |
160 | 160 | " text=\"Student wants to graduate in Spring 2026\",\n", |
161 | | - " memory_type=MemoryType(eq=\"semantic\"),\n", |
| 161 | + " memory_type=\"semantic\",\n", |
162 | 162 | " topics=[\"goals\", \"graduation\"]\n", |
163 | 163 | ")])\n", |
164 | 164 | "\n", |
165 | 165 | "await memory_client.create_long_term_memory([ClientMemoryRecord(\n", |
166 | 166 | " text=\"Student prefers morning classes, no classes on Fridays\",\n", |
167 | | - " memory_type=MemoryType(eq=\"semantic\"),\n", |
| 167 | + " memory_type=\"semantic\",\n", |
168 | 168 | " topics=[\"preferences\", \"schedule\"]\n", |
169 | 169 | ")])\n", |
170 | 170 | "\n", |
|
189 | 189 | "# Store course enrollment events\n", |
190 | 190 | "await memory_client.create_long_term_memory([ClientMemoryRecord(\n", |
191 | 191 | " text=\"Student enrolled in CS101: Introduction to Programming on 2024-09-01\",\n", |
192 | | - " memory_type=MemoryType(eq=\"episodic\"),\n", |
| 192 | + " memory_type=\"episodic\",\n", |
193 | 193 | " topics=[\"enrollment\", \"courses\"],\n", |
194 | 194 | " metadata={\"course_code\": \"CS101\", \"date\": \"2024-09-01\"}\n", |
195 | 195 | ")])\n", |
196 | 196 | "\n", |
197 | 197 | "await memory_client.create_long_term_memory([ClientMemoryRecord(\n", |
198 | 198 | " text=\"Student completed CS101 with grade A on 2024-12-15\",\n", |
199 | | - " memory_type=MemoryType(eq=\"episodic\"),\n", |
| 199 | + " memory_type=\"episodic\",\n", |
200 | 200 | " topics=[\"completion\", \"grades\"],\n", |
201 | 201 | " metadata={\"course_code\": \"CS101\", \"grade\": \"A\", \"date\": \"2024-12-15\"}\n", |
202 | 202 | ")])\n", |
203 | 203 | "\n", |
204 | 204 | "await memory_client.create_long_term_memory([ClientMemoryRecord(\n", |
205 | 205 | " text=\"Student asked about machine learning courses on 2024-09-20\",\n", |
206 | | - " memory_type=MemoryType(eq=\"episodic\"),\n", |
| 206 | + " memory_type=\"episodic\",\n", |
207 | 207 | " topics=[\"inquiry\", \"machine_learning\"],\n", |
208 | 208 | " metadata={\"date\": \"2024-09-20\"}\n", |
209 | 209 | ")])\n", |
|
299 | 299 | "try:\n", |
300 | 300 | " await memory_client.create_long_term_memory([ClientMemoryRecord(\n", |
301 | 301 | " text=\"Student prefers online courses over in-person classes\",\n", |
302 | | - " memory_type=MemoryType(eq=\"semantic\"),\n", |
| 302 | + " memory_type=\"semantic\",\n", |
303 | 303 | " topics=[\"preferences\", \"course_format\"]\n", |
304 | 304 | ")])\n", |
305 | 305 | " print(\"❌ Duplicate was stored (unexpected)\")\n", |
|
311 | 311 | "try:\n", |
312 | 312 | " await memory_client.create_long_term_memory([ClientMemoryRecord(\n", |
313 | 313 | " text=\"Student likes taking classes online instead of on campus\",\n", |
314 | | - " memory_type=MemoryType(eq=\"semantic\"),\n", |
| 314 | + " memory_type=\"semantic\",\n", |
315 | 315 | " topics=[\"preferences\", \"course_format\"]\n", |
316 | 316 | ")])\n", |
317 | 317 | " print(\"Memory stored (may be merged with existing similar memory)\")\n", |
|
0 commit comments