HomeFirst agent

Setting Up

Let's get your environment ready for interacting with AI agents with Naptha. We'll have you up and running in no time!

Before we start, you will need to have the following installed:

Install Python 3.10+ and pipx

First, ensure you have Python 3.10+ installed. Then install pipx:

Install Poetry Package Manager

Install Poetry using pipx:

1. Setup Naptha SDK

The Naptha SDK provides a client interface for Naptha Hub and Nodes, with core abstractions for building multi-agent AI workflows. It includes Agents, Orchestrators, Tools, Inference, Environments, and Personas modules that communicate via API, along with helpful decorators for easy module onboarding.

Clone and install the Naptha SDK:

2. Configure Your Environment

Confirm the .env file includes:

We will go through the process of generating the HUB_USER and HUB_PASS in the next step.

4. Sign Up or Sign In

The CLI command below will prompt you for username and password and then automatically set the HUB_USERNAME and HUB_PASSWORD environment variables in your .env file while also generating a PRIVATE_KEY for you.

Test Your Setup

Let's verify everything is working by running a simple "Hello World" agent:

The command will kickstart a process that gives you an insight into the Naptha AI ecosystem:

  • Connects to the Naptha hosted node http://node.naptha.ai:7001. (We will learn how to run your own node in future courses.)
  • Handles user authentication and registration if needed
  • Processes the agent deployment configuration including:
    • Agent module selection and loading
    • Configuration of LLM settings
    • Setup of data generation options
  • Executes the agent with the provided parameters (firstname and surname)
  • Returns a formatted JSON response with the greeting and timestamp

At the end of the process, the agent would stop running completed package hello_world_agent and you should see output similar to below:

To experience the full multi-agent AI capabilities of Naptha, you can try running the following command which kickstart a multi-agent chat across a network of multiple nodes:

The above CLI command runs the flow across three nodes in total - one orchestrator node and two worker nodes.

🎉 Congratulations! Your environment is ready for interacting with Naptha modules.

Troubleshooting Tips

If you encounter any issues:

  • Ensure Poetry is in your PATH
  • Verify your Python version with python --version
  • Check your .env file has the correct credentials
  • Make sure you're in the Poetry shell environment

Ready to build your visual story generator? Let's move on! →