title | description | icon |
---|---|---|
Quickstart |
Build your first AI agent with Upsonic In under 2 Minute |
rocket |
Let's create a simple agent that expert on our company and roled as Product Manager.
Before we proceed, make sure you have Upsonic
installed.
If you haven't installed them yet, you can do so by following the installation guide.
Follow the steps below to get your sonics! 🦔
Upsonic supports multiple LLMs. In this example, we will use OpenAI's GPT-4 model, for which we need to set environment variables.<CodeGroup>
```python Python
import os
os.environ["OPENAI_API_KEY"] = "sk-***"
```
```bash Mac
export OPENAI_API_KEY=sk-***
```
```powershell Windows
setx OPENAI_API_KEY sk-***
```
</CodeGroup>
```python
from upsonic import Task, Agent
from upsonic.client.tools import Search
task = Task(
"Research latest news in Anthropic and OpenAI",
tools=[Search]
)
```
```python
agent = Agent("Product Manager")
```
Upsonic framework, support to start and connect any MCP server for your purposes. Model Context Protocol servers are varously and maintain by companies and community. Upsonic support all MCP servers.
At this step you need to use @client.mcp()
decorator to an class with command, args and env.
# Hackernews MCP Server
class HackerNewsMCP:
command = "uvx"
args = ["mcp-hn"]
# env = {"": ""}
task1 = Task(
"Research latest news in Anthropic and OpenAI",
tools=[HackerNewsMCP]
)