“Hello World”
Getting started with Newo.ai is very simple but can be a bit overwhelming if you’re not familiar with the basics. Every coder writes a “Hello World” program for their first exercise, which helps highlight some basic functionality of a coding environment. This is no exception with the Newo.ai platform. We can break down several Newo.ai actions and get you familiar with the platform using this basic example.
Goal: Have the agent send “Hello World” in the Sandbox chat panel after triggering an event. No LLM involvement.
Create an Agent
- Navigate to the Agents page and click Create Agent in the top-right corner of the page.
- Add a “Name” (persona name), which is the name that will be visible to an end user.
- Add a “Title” and a “Description,” which are used to describe the agent within the platform. The fields are optional but will help later when creating many agents for different purposes.
- Click Create to save the agent. If you need to change the agent details, click the pencil icon next to the newly created agent. Once you’ve made changes, click Update.
Create a Sandbox Connector
In order for the Newo.ai platform to connect to a Sandbox chat, integrations are needed with a connector.
- To create a new Sandbox connector, navigate to the Integrations page from the left-side panel.
- Click the plus icon on the “Sandbox Integration” item.
- Add a “Title” and “Idn.” In this case, just call the title and idn “connector.”
- Click Save.
Enable the Sandbox Connector
Once a connector is created, its status will be "Stopped," and you will need to enable it.
- Click the three dots icon on the right of the created connector.
- Click Run.
Create a Flow
- Navigate to the Agents page.
- Click the plus icon next to the newly created agent.
- Add a “Flow Idn” (unique identifying name). Ensure no spaces. Leave the “Flow Template” for now, we will cover the use of this in the future.
- Add a “Flow Title,” which is used to describe the flow within the platform. For example, if you want a flow to create an agent to fit the role of a hotel receptionist, the title could be "Hotel Receptionist."
- Click Create to save the flow.
- If you need to delete a flow to create a new one, click the delete icon next to the newly created flow, and click Delete Flow on the confirmation pop-up. Repeat steps 2 to 4 to create a new flow if needed.
- Click the newly created flow. This will open up the Flow Builder where we will code the agent's behavior.
Add a User
- Click the Sandbox Chat button at the top-right corner of the Flow Builder to open the Sandbox chat panel. Ensure the correct agent is selected from the dropdown within the panel.
- Click the plus icon next to the “User:” section in the Sandbox chat.
- Add a “Name.” In this case, this is the name of a user who will be talking to the agent, which can be your name or a made-up name for testing purposes.
- Click the checkbox if you'd like to create an actor for the user persona. An Actor is someone who communicates through a specific connector. For example, a specific user could communicate via the Sandbox chat (Sandbox chat connector) and over the phone (Twilio connector), which each have identifiers of separate actors. For this case, we are going to create a single actor for Sandbox chat communications (ensure the checkbox is ticked).
- Under the "Actor settings," select “sandbox” for the “Integration” and “connector” for the “Connector.”
- Click Create and apply to save the user.
Create a Skill
- Click the plus icon next to the Skills section on the left-side panel.
- Add a “Skill Idn.” Ensure no spaces.
- Add a “Skill title.” This is merely used as a description of the Skill (optional).
- Click Create to save the Skill.
Note that "Skill Settings" appears on the right. This displays the "Skill Title," "Idn," "Model," "Result Action," and "Result Variable Name."
Add Code to the Skill Script
The “SendMessage” action is used to send plain text to the Sandbox chat. Copy the following code into the Skill Script section (the middle section of the interface):
{{SendMessage(message="Hello World")}}
Create an Event (Sandbox Integration)
In order for the newly created Skill to be activated, the Skill needs to be subscribed to an event. This is because the agent needs to know when or what event needs to happen to send the message “Hello World.” In this case, the event trigger will be a message sent in the Sandbox chat.
- Click the plus icon next to the Event Subscription section on the left-side panel.
- Under the “Event Idn,” select “user_message” from the dropdown.
- Under “Integration,” select “sandbox” from the dropdown.
- Under “Connector,” select “connector” from the dropdown.
- Under “Skill selector,” select “skill_idn” from the dropdown. You are telling your flow that when a user sends a message from the Sandbox chat, select a specific Skill to activate.
- In this case, you want to activate the newly created Skill. Select it from the “Skill name” dropdown.
- Add an “Event description.” This field is optional but will help in the future when identifying the purpose of an event from a complex flow containing multiple event subscriptions.
- Click Create to save the event.
Test Functionality and View Results
- Click Save and Publish in the top-right corner of the Flow Builder.
- Type anything in the Sandbox chat field, and click the send icon. The response should be “Hello World.”
Updated 7 months ago