Local Agent Inspector
The Local Agent Inspector is a developer tool on Agentverse designed to streamline debugging and monitoring for Agents running on a local infrastructure . It helps developers track real-time Agents behavior, whether connected to Agentverse or not, offering detailed insights into performance and interactions.
Local Agents can communicate and interact with other Agents and Functions connected to the Agentverse and Fetch Network through a Mailbox. For more information on Mailbox and how to connect local Agents and their Functions to the Agentverse, have a look at these guides:
Developers can view key details such as the local Agent's address, endpoints, message types, and sender-recipient data. This visualization simplifies communication optimization and troubleshooting for Agents handling local processing or resource management.
The Inspector displays message data in a list, with options to view payloads, and provides an overview of all running Agents. Future updates will include support for Bureau-managed Agents and direct connections to Agentverse, further enhancing management and monitoring capabilities.
How to access the Local Agent Inspector
You can access the Local Agent Inspector by first coding and defining your Agent.
For instance, consider the following simple local Agent:
agent_inspector_example.pyfrom uagents import Agent, Context, Model class Message(Model): message: str bob = Agent( name="Bob", port=8001, seed="BobSecretPhrase", endpoint=["http://127.0.0.1:8001/submit"], ) print(f"Your agent's address is: {bob.address}") @bob.on_message(model=Message) async def message_handler(ctx: Context, sender: str, msg: Message): ctx.logger.info(f'Received message from {sender}: {msg.message}') await ctx.send(sender, Message(message="Hello There!")) if __name__ == "__main__": bob.run()
Once you successfully run your local Agent and register it into the Almanac (Make sure your Agent has enough funds to do so!), you will be able to access the Inspector via the terminal log, which provides a dedicated link to the Inspector page.
By running the above Agent, the output you get should be similar to the following:
Your agent's address is: agent1qvrapvpxltu54tt3qnud5mlkul9y9d9tfn7xfpq4ec74cq4mkym6yl3jkdw INFO: [ Bob]: Registration on Almanac API successful INFO: [ Bob]: Registering on almanac contract... INFO: [ Bob]: Registering on almanac contract...complete INFO: [ Bob]: Agent inspector available at https://agentverse.ai/inspect/?uri=http%3A//127.0.0.1%3A8001&address=agent1q2kxet3vh0scsf0sm7y2erzz33cve6tv5uk63x64upw5g68kr0chkv7hw50 INFO: [ Bob]: Starting server on http://0.0.0.0:8001 (Press CTRL+C to quit)
By clicking on the dedicated link depicted here, you will then be redirected to the Inspector Dashboard. A pop-up message will appear saying that your Agent was connected successfully.
Here you can view all the information about your local Agent, including details about all messaged sent and received by the Agent.