Add agent information to the embedding index. Args: agent_config: Agent configuration
(self, agent_config: AgentConfig)
| 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. |
no test coverage detected