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

Method _store

src/agent/context.py:367–392  ·  view source on GitHub ↗

Add agent information to the embedding index. Args: agent_config: Agent configuration

(self, agent_config: AgentConfig)

Source from the content-addressed store, hash-verified

365 return agent_configs
366
367 async def _store(self, agent_config: AgentConfig):
368 """Add agent information to the embedding index.
369
370 Args:
371 agent_config: Agent configuration
372 """
373 if self._faiss_service is None:
374 return
375
376 try:
377 # Create comprehensive text representation
378 agent_text = f"Agent: {agent_config.name}\nDescription: {agent_config.description}"
379
380 # Add to FAISS index
381 request = FaissAddRequest(
382 texts=[agent_text],
383 metadatas=[{
384 "name": agent_config.name,
385 "description": agent_config.description
386 }]
387 )
388
389 await self._faiss_service.add_documents(request)
390
391 except Exception as e:
392 logger.warning(f"| ⚠️ Failed to add agent {agent_config.name} to FAISS index: {e}")
393
394 async def build(self, agent_config: AgentConfig) -> AgentConfig:
395 """Create an agent instance and store it.

Callers 3

registerMethod · 0.95
updateMethod · 0.95
copyMethod · 0.95

Calls 3

FaissAddRequestClass · 0.90
warningMethod · 0.80
add_documentsMethod · 0.45

Tested by

no test coverage detected