Server and Agent Setup
Server and Agent Setup
When you run parlant-server
, it'll use the current working directory to store its runtime data and configuration. Hence the first thing we want to do is setup a dedicated directory for this tutorial project.
mkdir parlant-tutorial
cd parlant-tutorial
parlant-server run # Run the server in the current directory (see --help if you need to)
Please leave the server to run in that terminal. If you're curious about its workings, you can also run it with --log-level debug
and check out the logs every now and then to see what it's up to.
Create Your Agent
In a new terminal, use the Parlant CLI client to create your tech retail agent. This will connect to the running server, and can be run from anywhere on your machine (as long as the parlant
command is accessible).
parlant agent create --name "Chip Bitman"
That should return your new agent's ID.
Let's save its ID in a variable, since we're going to refer to it every now and then throughout the tutorial. Note that we'll be using UNIX shell syntax throughout this tutorial, for brevity.
Assign your agent's ID to a shell variable:
AGENT_ID=<replace with your agent's ID>
If your Parlant server is hosted remotely or uses a non-default port, include the -s/--server SERVER_ADDRESS:PORT
flag in your parlant
client commands. For example:
parlant --server http://1.2.3.4:1234 [COMMAND]
Crafting an Initial Personality
To ensure your agent embodies the desired traits, we’ll provide a description that defines its personality and role orientation.
description=$(cat <<EOF
You work at a tech store and help customers choose what to buy.
You're clever, witty, and slightly sarcastic.
At the same time you're kind and funny.
EOF
)
parlant agent update --id $AGENT_ID --description "$description"
If you're not sure how to set up an agent or perform any actions using the CLI, just run
parlant COMMAND --help
for help and instructions. For example:
$ parlant agent update --help
Now you've got your first agent, it's time to test it. It's quite vanilla still—a vanilla Chip!—but you can already get a sense of its responses.
Head over to http://localhost:8800 (or wherever else you're hosting your server) and start a new session with your agent, Chip Bitman.
