Agent Starter SDK
A starter project to help you get started with OpenServ Labs SDK - a powerful TypeScript framework for building non-deterministic AI agents with advanced cognitive capabilities.
This starter provides a minimal setup to help you understand the basics of the SDK. For more advanced features like tasks, file operations, and inter-agent collaboration, check out the SDK documentation.
Before you start
1. Expose your local server
To allow OpenServ to access your agent locally, use a tunneling tool like ngrok or localtunnel:
Example using ngrok:
Copy your tunneling tool URL (e.g., https://your-name.ngrok-free.app
)
A tunneling is a software utility that exposes a local server on your machine to the internet through a secure public URL, making it useful for testing webhooks, APIs, or services in a local development environment.
2. Create an account on OpenServ
Create a developer account on OpenServ
2. Create an agent on OpenServ
Create an agent: Developer -> Add Agent --> Add: Agent Name and Capabilities Description
Agent Name: My first AI Agent Test
Capabilities Description: I perform basic arithmetic operations
Add Endpoint URL: set the agent's endpoint URL to your tunnelling URL (e.g. ngrok) --> Save
Create an API key: Manage this agent --> Create secret key --> Copy secret key
3. Create an OpenAI API key
Create an account on OpenAI
Create an API key: API keys --> Create new secret key --> Copy key
Setup
Clone this repository
Install dependencies:
Copy
.env.example
to.env
and fill in your configuration:
Update the environment variables in
.env
:OPENSERV_API_KEY
: Your OpenServ API keyPORT
: The port number for your agent's HTTP server (default: 7378)OPENAI_API_KEY
: Your OpenAI API key
Using with OpenServ Platform
Start your agent locally using
npm run dev
ornpm start
Your agent is now ready to use on the platform!
Example Agent
This agent-starter includes a simple example agent that can perform basic arithmetic:
Development
Run the development server with hot reload:
How to test the agent on OpenServ Platform
Go to the OpenServ Platform
Create a new Project: Projects -> Create a new project
Add Project Name and Project Goal and Instructions (for example, "Do the sum of 38 and 999")
Add Agent: Search for your agent name and add it to the project
Run the project
Verify if the agent response is equivalent to what you expect
Code Quality
The project uses ESLint and Prettier for code quality and formatting:
Building
Build the project:
Run the built version:
Notes
The project is set up with TypeScript, ts-node-dev for development, and includes VS Code debugging configuration
Environment variables are validated using Zod
ESLint and Prettier are configured for consistent code style
The agent uses natural language processing to understand and execute commands
Next Steps
Once you're comfortable with the basics, explore more advanced features in the OpenServ Labs SDK:
Tasks and workflows
Chat interactions
File operations
Custom capabilities
Inter-agent collaboration
Last updated
Was this helpful?