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

Method _store

src/tool/context.py:356–381  ·  view source on GitHub ↗

Add tool information to the embedding index. Args: tool_config: Tool configuration

(self, tool_config: ToolConfig)

Source from the content-addressed store, hash-verified

354 return tool_configs
355
356 async def _store(self, tool_config: ToolConfig):
357 """Add tool information to the embedding index.
358
359 Args:
360 tool_config: Tool configuration
361 """
362 if self._faiss_service is None:
363 return
364
365 try:
366 # Create comprehensive text representation
367 tool_text = f"Tool: {tool_config.name}\nDescription: {tool_config.description}"
368
369 # Add to FAISS index
370 request = FaissAddRequest(
371 texts=[tool_text],
372 metadatas=[{
373 "name": tool_config.name,
374 "description": tool_config.description
375 }]
376 )
377
378 await self._faiss_service.add_documents(request)
379
380 except Exception as e:
381 logger.warning(f"| ⚠️ Failed to add tool {tool_config.name} to FAISS index: {e}")
382
383 async def build(self, tool_config: ToolConfig) -> ToolConfig:
384 """Create a tool 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