MCPcopy Create free account
hub / github.com/SkyworkAI/DeepResearchAgent / get_state

Method get_state

src/memory/context.py:1243–1273  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 }

Callers

nothing calls this directly

Calls 5

get_infoMethod · 0.95
infoMethod · 0.45
get_eventMethod · 0.45
get_summaryMethod · 0.45
get_insightMethod · 0.45

Tested by

no test coverage detected