|
| 1 | +--- |
| 2 | +title: "LLM Agentic Tool Mesh: Orchestrating agentic tools for the next revolution" |
| 3 | +date: 2025-01-20T08:36:14.226Z |
| 4 | +author: Antonio Fin |
| 5 | +authorimage: /img/afin_photo.jpg |
| 6 | +disable: false |
| 7 | +--- |
| 8 | +<style> |
| 9 | +li { |
| 10 | + font-size: 27px !important; |
| 11 | + line-height: 33px !important; |
| 12 | + max-width: none !important; |
| 13 | +} |
| 14 | +</style> |
| 15 | + |
| 16 | +In our previous blog posts, we delved into the [Chat Service](https://developer.hpe.com/blog/ll-mesh-exploring-chat-service-and-factory-design-pattern/), [Agent Service](https://developer.hpe.com/blog/llm-agentic-tool-mesh-harnessing-agent-services-and-multi-agent-ai-for-next-level-gen-ai/), and [RAG Service](https://developer.hpe.com/blog/llm-agentic-tool-mesh-empowering-gen-ai-with-retrieval-augmented-generation-rag/) of [LLM Agentic Tool Mesh open source project](https://github.com/HewlettPackard/llmesh). Today, we'll explore the System Services of LLM Agentic Tool Mesh that are essential for managing and orchestrating the mesh of agentic tools. We'll provide insights into these services, showcase an example of a Mesh available in the repository, discuss federated governance, and share our vision for the future evolution of the LLM Agentic Tool Mesh project. |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | +# Understanding LLM Agentic Tool Mesh System Services |
| 21 | + |
| 22 | +The System Services in LLM Agentic Tool Mesh are crucial for the seamless operation and orchestration of agentic tools and web applications. These services ensure consistency, ease of use, and flexibility across the platform. They include: |
| 23 | + |
| 24 | +1. Tool Client Service |
| 25 | +2. Tool Server Service |
| 26 | + |
| 27 | +Let's explore each of these components in detail. |
| 28 | + |
| 29 | +## Tool Client Service |
| 30 | + |
| 31 | +The Tool Client Service enables developers to transform any code function into an LLM Agentic Tool Mesh tool by applying a simple decorator. This service abstracts the complexities of tool integration, allowing for quick conversion of functions into reusable tools within the LLM Agentic Tool Mesh ecosystem. |
| 32 | + |
| 33 | +Key Features: |
| 34 | + |
| 35 | +* Decorator-Based: Convert functions into tools using the `@AthonTool` decorator. |
| 36 | +* Seamless Integration: Decorated functions are fully integrated into the LL-Mesh platform. |
| 37 | + |
| 38 | +Example Usage: |
| 39 | + |
| 40 | +```python |
| 41 | +from athon.system import AthonTool, Logger |
| 42 | + |
| 43 | +config = { |
| 44 | + "greetings": "Hello World! Welcome, " |
| 45 | +} |
| 46 | +logger = Logger().get_logger() |
| 47 | + |
| 48 | +@AthonTool(config, logger) |
| 49 | +def hello_world(query: str) -> str: |
| 50 | + """Greets the user.""" |
| 51 | + greeting_message = f"{config['greetings']} {query}!" |
| 52 | + return greeting_message.capitalize() |
| 53 | +``` |
| 54 | + |
| 55 | +## Tool Server Service |
| 56 | + |
| 57 | +The Tool Server Service provides the necessary infrastructure to manage and run LLM Agentic Tool Mesh tools on the platform. It includes capabilities for tool discovery and execution, ensuring that tools are easily accessible and efficiently managed. |
| 58 | + |
| 59 | +Key Features: |
| 60 | + |
| 61 | +* Tool Discovery: Automatically discover tools within the platform. |
| 62 | +* Execution Management: Manage the execution of tools, ensuring efficient operation. |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +Example Usage: |
| 67 | + |
| 68 | +```python |
| 69 | + |
| 70 | +from athon.agents import ToolRepository |
| 71 | +from athon.system import ToolDiscovery |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | +projects_config = [ |
| 76 | + { |
| 77 | + "name": "Simple Project", |
| 78 | + "tools": [ |
| 79 | + "examples/local_tool", # A local tool path |
| 80 | + "https://127.0.0.1:5003/", # A remote tool URL |
| 81 | + ] |
| 82 | + } |
| 83 | +] |
| 84 | +tools_config = { |
| 85 | + "type": "LangChainStructured" |
| 86 | +} |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | +def discover_and_load_tools(projects_config, tools_config): |
| 91 | + tool_repository = ToolRepository.create(tools_config) |
| 92 | + tool_discovery = ToolDiscovery() |
| 93 | + tool_id_counter = 1 |
| 94 | + |
| 95 | + for project in projects_config: |
| 96 | + for tool_reference in project["tools"]: |
| 97 | + tool_info = tool_discovery.discover_tool(tool_reference) |
| 98 | + if tool_info: |
| 99 | + tool_metadata = { |
| 100 | + "id": tool_id_counter, |
| 101 | + "project": project["name"], |
| 102 | + "name": tool_info["name"], |
| 103 | + "interface": tool_info.get("interface") |
| 104 | + } |
| 105 | + tool_repository.add_tool(tool_info["tool"], tool_metadata) |
| 106 | + tool_id_counter += 1 |
| 107 | + |
| 108 | + return tool_repository |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | +# Run the tool discovery and loading process |
| 113 | +tool_repository = discover_and_load_tools(projects_config, tools_config) |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | +# Display the discovered tools |
| 118 | +for tool in tool_repository.get_tools().tools: |
| 119 | + print(f"Discovered tool: {tool['name']} from project: {tool['metadata']['project']}") |
| 120 | +``` |
0 commit comments