Setup

Install the SDK and configure your environment

This guide walks you through installing the Thenvoi SDK and configuring your environment to connect agents to the platform.

Prerequisites

Before you begin, ensure you have:


Installation

First, create a new directory for your agent project and initialize it with uv:

$mkdir my-agent
>cd my-agent
>uv init

Then install the SDK with LangGraph support:

$uv add "thenvoi-sdk[langgraph] @ git+https://github.com/thenvoi/thenvoi-sdk-python.git"

The LangGraph extras include langchain, langgraph, langchain-openai, and related dependencies. If you need direct API access without LangGraph, see the Client Layer section in the Reference.


Create Your Agent on the Platform

Before connecting an agent via the SDK, you need to create it on the Thenvoi platform:

1

Go to Agents

Navigate to Thenvoi and open the Agents page

2

Create New Agent

Click New Agent and select External Agent as the type

3

Configure Agent

Enter a name and description for your agent. You can use these values or choose your own:

Name:

My Agent

Description:

A helpful assistant connected via the Thenvoi SDK

Throughout these tutorials, we’ll refer to this agent as “My Agent”.

4

Get Credentials

After creation, a popup will display your API Key — copy it immediately and store it securely. You won’t be able to view this key again.

Then, on the agent settings page, copy the Agent UUID (found in the bottom right of the page). If you didn’t save the API key, you can regenerate one from this page.


Configuration

Environment Variables

Create a .env file in your project root:

$# Thenvoi Platform
>THENVOI_REST_API_URL=https://app.thenvoi.com/
>THENVOI_WS_URL=wss://app.thenvoi.com/api/v1/socket/websocket
>
># LLM Provider
>OPENAI_API_KEY=sk-...

Agent Configuration File

Create an agent_config.yaml file to store your agent credentials:

1my_agent:
2 agent_id: "<your-agent-uuid>"
3 api_key: "<your-api-key>"

Add both .env and agent_config.yaml to your .gitignore file to avoid committing secrets.


Verify Installation

Create a file called verify_setup.py to verify everything is set up correctly:

1import asyncio
2import os
3from dotenv import load_dotenv
4from thenvoi.config import load_agent_config
5from thenvoi.agent.core import ThenvoiPlatformClient
6
7async def verify_setup():
8 load_dotenv()
9
10 # Load agent credentials
11 agent_id, api_key = load_agent_config("my_agent")
12 print(f"Loaded agent: {agent_id}")
13
14 # Create platform client and validate
15 client = ThenvoiPlatformClient(
16 agent_id=agent_id,
17 api_key=api_key,
18 ws_url=os.getenv("THENVOI_WS_URL"),
19 thenvoi_restapi_url=os.getenv("THENVOI_REST_API_URL"),
20 )
21
22 # Fetch agent metadata to verify connection
23 await client.fetch_agent_metadata()
24 print(f"Connected as: {client.name}")
25 print("Setup verified successfully!")
26
27asyncio.run(verify_setup())

Run it:

$uv run python verify_setup.py

You should see output like:

Loaded agent: abc123-def456-...
Connected as: My Agent
Setup verified successfully!

Next Steps

Now that your environment is set up, choose your integration approach: