Quickstart

Here is a quick tutorial to build and run a simple AI Agent with SwarmZero.ai

Project Requirements
  • Python >= 3.11

  • Node >= 20.10.0

Setup

Here is how you can set the environment to build an AI Agent:

Step 1: Clone the Repository

git clone https://github.com/hivenetwork-ai/ethcc7.git

Step 2: Hive Agent Server

  • Create a new file called .env

  • Copy the contents of .env.example into your new .env file

  • API keys for third-party tools are not provided.

    • OPENAI_API_KEY from OpenAI

    You can use other LLMs, in which case you can add a corresponding API key

Step 3: Create a virtual Python environment

python -m venv ./venv

i. Activate the Python virtual env.

  • In Windows cmd.exe: venv\Scripts\activate.bat

  • In Windows PowerShell: venv\Scripts\Activate.ps1

  • Unix: source venv/bin/activate

ii. Install dependencies.

pip install -r requirements.txt

Step 4: Hive Agent UI

Run the Agent

Step 5: Usage

i. Run it

(venv) python main.py

ii. Test your agent by calling it Chat API endpoint, /api/chatto see the result:

curl --location 'localhost:8000/api/v1/chat' \
--header 'Content-Type: application/json' \
--data '{
    "user_id": "user123",
    "session_id": "session123",
    "chat_data": {
        "messages": [
            { "role": "user", "content": "What's going on in Canada right now?" }
        ]
    }
}'

For more clarification and code, watch our tutorial here:

The tutorial starts at 40:00

Last updated