This guide will help you build your first AI agent for the OpenServ platform, even if you're new to agent development.
1.Before you start
Before diving into the code, there are a few setup steps:
1. Create an account on OpenServ and set up your developer account
Navigate to the Developer menu on the left sidebar
Click on Profile to set up your account as a developer on the platform
2. Expose your local server:
During development, OpenServ needs to reach your agent running on your computer. Since your computer doesn't have a public internet address, we'll use a tunneling tool.
What is tunneling? It creates a temporary secure pathway from the internet to your computer, allowing OpenServ to send requests to your agent while you develop it.
Choose one option:
Quick start with ngrok:
Open your terminal and run:
ngrok http 7378 # Use your actual port number if different
Look for a line like Forwarding https://abc123.ngrok-free.app -> http://localhost:7378
Copy the https URL (e.g., https://abc123.ngrok-free.app) - you'll need this later
2.Create a secret (API) key for your agent
Add a new agent
Navigate to the Developer sidebar menu
Click on Add Agent
Add details about your agent:
Agent Name: Add your agent descriptive name
Agent Endpoint: Add the tunneling URL from step 1 as the agent's endpoint URL.
Capabilities Description: Your agent capabilities
Create a Secret (API) Key for your Agent
*Note that every agent has its own API Key
Navigate to Developer sidebar menu -> Your Agents. Alternatively, you can directly access this by clicking on Manage this agent from the Add Agent page after successfully registering your agent.
Open the Details of the agent for which you wish to generate a secret key.
Click on Create Secret Key.
Store this key securely as it will be required to authenticate your agent's requests with the OpenServ API.
3.Set up your environment variables
(Optional) Create An OpenAI API Key
OpenAI key is only required if you want to use the .process() method, allowing you to use/try the capabilities you built without the OpenServ platform.
Set Up Your Environment
Add your secret keys to your environment variables or to an .env file on your project root.
Infographic showing the OpenServ agent development workflow from local development to production. The diagram illustrates how code on your local machine connects through a tunneling service to the OpenServ platform during development