Get memory state (events, summaries, insights) for a memory system. Args: memory_name: Name of the memory system n: Number of items to retrieve. If None, returns all items. ctx: Memory context Returns: Dictionary c
(self,
memory_name: str,
n: Optional[int] = None,
ctx: SessionContext = None,
**kwargs)
| 1241 | return await instance.clear_session(ctx=ctx, **kwargs) |
| 1242 | |
| 1243 | async def get_state(self, |
| 1244 | memory_name: str, |
| 1245 | n: Optional[int] = None, |
| 1246 | ctx: SessionContext = None, |
| 1247 | **kwargs) -> Dict[str, Any]: |
| 1248 | """Get memory state (events, summaries, insights) for a memory system. |
| 1249 | |
| 1250 | Args: |
| 1251 | memory_name: Name of the memory system |
| 1252 | n: Number of items to retrieve. If None, returns all items. |
| 1253 | ctx: Memory context |
| 1254 | |
| 1255 | Returns: |
| 1256 | Dictionary containing 'events', 'summaries', and 'insights' |
| 1257 | """ |
| 1258 | memory_info = await self.get_info(memory_name) |
| 1259 | |
| 1260 | version = memory_info.version |
| 1261 | memory_instance = memory_info.instance |
| 1262 | logger.info(f"| ✅ Using memory {memory_name}@{version}") |
| 1263 | |
| 1264 | # Get events, summaries, and insights from memory instance |
| 1265 | events = await memory_instance.get_event(n=n, ctx=ctx, **kwargs) |
| 1266 | summaries = await memory_instance.get_summary(n=n, ctx=ctx, **kwargs) |
| 1267 | insights = await memory_instance.get_insight(n=n, ctx=ctx, **kwargs) |
| 1268 | |
| 1269 | return { |
| 1270 | "events": events, |
| 1271 | "summaries": summaries, |
| 1272 | "insights": insights |
| 1273 | } |
nothing calls this directly
no test coverage detected