Create your first AI Agent for sentiment analysis

Get started with AI on Digibee by building your first Agent in just four steps.

Build a working AI-powered sentiment analysis API that classifies customer feedback as positive, negative, or neutral.

Step-by-step

In this quickstart, you will create a simple API that analyzes text sentiment in four steps.

1. Get your LLM provider API Key

Before you begin, make sure you have the following:

  • An API key from an LLM provider (for example, OpenAI, Anthropic, Google).

  • The API key registered in Digibee as a Secret Key account.

If you don’t have this account yet, see the documentation to create a Secret Key account.

2. Create the REST-triggered pipeline

Create a new pipeline and configure the trigger as follows:

  • Type: Select REST.

  • Methods: Remove all methods and leave only POST.

  • Other settings: Keep the default values.

To expose this pipeline as an API, you must configure an API key and deploy the pipeline. See the documentation to learn how to expose a pipeline as an API.

3. Add the Agent Component

Add the Agent Component to the pipeline right after the trigger and configure it with the settings below:

  • Model: Select your preferred model (for example, OpenAI - GPT-4o Mini)

  • Account: Click the gear icon next to the model and select the Secret Key account you registered on step 1.

Next, configure the Agent messages:

  • System Message: Defines the AI’s role and behavior.

  • User Message: Prompt that will be analyzed by the AI.

ℹ️ The {{ message.body.text }} expression dynamically retrieves data from the request payload. When the API is called with {"body": {"text": "some text"}}, the Agent receives and processes this value. To learn more, see how Double Braces expressions are used to dynamically reference data.

4. Test the Agent

In the Agent Component configuration, use the Test Panel, located on the right side of the page, and enter the following input:

Then, click Play to view the results.

Below is an example of an output returned by the Agent:

Result

Kudos! You now have a working AI-powered sentiment analysis API. As a next step, learn how to structure your output to force the AI to return consistent and deterministic JSON responses.

Last updated

Was this helpful?