- Create a ChatBot
- Call it into a room
- Interact with it from the MeshAgent Studio.
Step 1: Create an agent with ServiceHost
Let’s create a simple ChatBot that takes a system prompt (rules).
To run the ChatBot we’ll use the MeshAgent ServiceHost. The ServiceHost is a lightweight HTTP server that allows you to register one or more tools or agents on their own path (e.g., /agent). The host automatically exposes each path as a webhook. When a room “makes a call” to that path, ServiceHost handles the handshake, connects the agent to the room, and forwards requests and responses between your code and the MeshAgent infrastructure.
Step 2: Call the agent into a room
/chat. If you are running multiple agents or tools, you can use the same ServiceHost and set different paths for each of the agents. The service run command automatically detects the different agent paths and identities (this is the recommended way to test your agents and tools).
As an alternative to the service run command you can also run the service locally by running python main.py in one tab in your terminal, then from another tab you can call individual agents into the room using the meshagent call agent command. For example:
bash
chatbot. Once the agent joins the room, you can converse with it in MeshAgent Studio.
Step 3: Interact with the Agent in MeshAgent Studio
- Go to MeshAgent Studio and login
- Enter your room
quickstart - Select the agent
chatbotand begin chatting!
Next Steps
- Add custom rules or toolkits to your agent:
- See Build a Chat Agent to learn how to add built-in MeshAgent tools (for things like presenting a UI or writing to documents), and custom tools to your chatbot.
- TaskRunner to learn how to run agents from other agent frameworks, “agents” without an LLM, and more.
- Tools Quickstart to learn how to build custom tools.
- Learn more about services and containers to deploy your agent as a MeshAgent project-wide service or run it in a specific room with the Containers API.
- Explore the broader Room Agents Client for more information on listing agents, discovering tools, invoking tools, and more.