Skip to main content

Build your first AI Agent

This guide provides a walkthrough of building your first customized AI agent using Agent Studio.

In this guide you will build your first no-code AI agent. This agent lets you interact with sample business data in natural language without writing any code. Utilize this onboarding experience to gain insights on your data set and automate tasks based on your data.

Setup

Prerequisites: You will need a Squid account to complete this tutorial.

  1. To get started, navigate to the Squid Console. If you do not have an application, create a new one. Then select Agent Studio from the left sidebar menu.

  2. Click Create your first Agent to add an agent. Provide the following details:

    • Agent ID: onboarding
    • Description: This is an agent for Squid AI's Agent Studio onboarding guide
  3. Click Create to create the agent.

  4. Once you have created your agent, you will be taken to the Overview tab where you can configure your agent. To continue, click the Onboarding Tutorial button on the right side of the screen under Enhance your agent. Then select Initialize Onboarding.

    • By initializing the onboarding experience, your application will automatically be configured with a new connector – a MongoDB database that will be used to demonstrate how your agent can interact with data and automate tasks.

Customizing your agent

Now that we have a new connector, we can begin to customize the agent. Squid AI agents use Abilities to interact with data and services. Abilities are like skills that your agent can use to perform tasks. Learn more about abilities here.

Agent configuration

Start by configuring your agent's basic settings. This includes setting the LLM model and instructions, located on the Overview tab of the Agent Studio.

  • LLM Model: The default LLM (GPT-4o) will work well for this agent, but you can choose another LLM if you prefer.
  • Instructions: Provide instructions to your agent on how it should respond and interact with the user.
You are an expert assistant for an internal team at a homegoods business. You will answer questions about the homegoods business based on our data and your general knowledge. Only generate a PDF when the user specifically asks for it.

The database ability

By adding the database ability, the agent will be able to query the MongoDB database and retrieve data. This is useful for answering questions about your data.

  1. First, it is important to provide descriptions of the database's schema so the AI agent has a better understanding of the structure of the data.

    To add descriptions, navigate to the Connectors tab of the left sidebar menu and select the homegoods-business connector. Next, click on the Schema tab and add descriptions by dropping down the AI features button and selecting Generate Descriptions. In the additional instructions pop-up, add the following instructions. Then click Confirm. Once the descriptions are generated, click Save Schema to save the changes:

All fields with a monetary value are in US dollars.
  1. Add the MongoDB database ability to the agent. This will allow your agent to query the MongoDB database and retrieve data.
    • Navigate to your agent's Overview page in the Agent Studio tab
    • Click on Add Abilities on the right side of the page.
    • Click on the Database ability and click the + symbol to add the MongoDB connector with an ID of homegoods-business.
    • A screen will appear asking for instructions on when to use the ability, instructions on how the agent should use the ability, and a field for specifying specific collections to query in the database. Use the following value for the When to use field, leaving the other two blank:
Call this connector whenever the user asks about our homegoods orders.
  1. Click Add connector to add the ability to the agent. The database ability is now ready to use!

Adding more abilities

Each agent comes with a few built-in abilities that can be added to extend the agent's functionality. These abilities include knowledge bases and specialized AI functions. In this guide we will add two AI functions to the agent's list of abilities.

  1. On the Overview page of your agent, click on Add Abilities on the right side of the page.
  2. Scroll down to the AI Functions section and add the createPdfFromHtml. This ability enables the agent to generate PDFs, a useful ability for creating reports, insights, and summaries.
  3. Repeat step 1 to add a second AI function, searchWeb. We will use this ability to augment the agent with additional knowledge from the web. This is useful for answering questions that are not directly related to the data in the database.

The AI agent workflow

All three of the agent's abilities work together to create a customized AI agent workflow. Here are some sample prompts to send to the AI agent in the Test Agent tab:

1. Generate a PDF invoice for order ID 63572.
2. Who are some of our biggest competitors in the homegoods space?
3. Show me a table of customers who have placed multiple orders.
4. How many orders have a status of Refunded?
5. What percent of orders were placed online?

While using the AI agent, note that you can see the process of the agent workflow on the right side of the screen. Dropdown each step of the workflow for more technical detail.

Test prompts that combine multiple abilities, such as, "Create a PDF with a list of all orders with a total over 1000", or "Search the web for the cheapest available overnight shipping to the customer's address for order ID 17011."

It is important to understand the capabilities and limitations of each ability in order to most effectively use AI agents. For example, some data may not exist in the database, or the AI agent may not have access to all the information necessary. In these cases, the agent will provide a response indicating that it is unable to answer the question.

Next steps

Congratulations! You just built your first Squid AI Agent!

Now that you have created your first AI agent, you can continue to customize it by adding more abilities. You can also explore the Agent Studio documentation to learn more about how to build and manage no-code AI agents, or explore other ways to build custom AI solutions with Squid AI.