Key Concepts

Get Started

Get Started

Development Guide

Get Started

Get Started

Operations Guide

Get Started

Get Started

Deployment Guide

Get Started

Get Started

Get Started

Using AI Nodes : Today's Fortune

Using AI Nodes : Today's Fortune

Using AI Nodes : Today's Fortune

The tutorial in the Beginner Guide covers the most fundamental yet essential steps for newcomers to Agentria.

In this tutorial, you will create and run an ability that inputs your name and birthday and displays a simple ‘Today's Fortune’.


Prerequisites


To begin, create a project in Agentria and enter the Ability Editor canvas.

For the canvas entry procedure, please refer to 3-Step Core Guide.


Upon completing this tutorial, you will be able to perform the following tasks:

  1. Add nodes

  2. Declare variables in the Input node

  3. Connect nodes

  4. Write prompts in the LLM node

  5. Pass the generated response from the LLM node to the Output node

  6. Verify workflow execution results via Run Test


Step 1: Declaring Input Variables


The Agentria canvas is initially populated with one Start node and one End node.

The Start node initiates the entire workflow, while the End node concludes it.

Therefore, to build the ‘Today's Fortune’ workflow, you must first declare the required variables at the Start node.

Double-clicking an Input node opens the node editor in a pop-up window, where you can declare variables by setting their data type, name, and description.


We will set the variables ‘Name’ and ‘Birthday’ as the information needed to check the fortune.

First, set the name variable's data type to String and save it as Name.

Second, set the birthday variable's data type to String and save it as BirthDate.

Once variable declaration is complete, return to the editor canvas.


Step 2: Adding Nodes via Drag and Drop


Now it's time to add the nodes that will generate your fortune.

Using the LLM node, you can generate output based on input values simply by writing a prompt.

Click the +Add Node button at the bottom of the canvas, then drag and drop the LLM node from the AI category onto the canvas.

This tutorial uses Azure OpenAI LLM.


Step 3: Connecting Nodes with Edge


To use variables declared in the Input node within the LLM node, you must connect the two nodes.

This connecting line is called an edge.

Connecting the small edge port on the right side of the Input node to the left edge port of the LLM node transmits the value connected in the Input node to the LLM.


Step 4: Writing System Prompts


Double-click the LLM node to open the node editor.

If Name and BirthDate appear in the Input area, the two nodes are connected correctly.

The LLM node includes a Detailed Settings area where you can configure credential settings, write system prompts, write user prompts, and adjust performance and output characteristics.


In the system prompt field, write instructions specifying the role the AI should perform and the output format.

The more specifically you instruct the AI on its role and output rules, the higher the quality of the results.

Example:


You are the ‘Today's Horoscope Notifier’. Use positive and kind language.
This horoscope is for entertainment only and must include a final sentence suggesting that something better than expected awaits.

<p>Format:</p>
<ul>
<li>Today's Horoscope One-Line Summary</li>
<li>Detailed Daily Horoscope</li>
</ul>
<p>(Finance, Love, Health, Other)</p>


Step 5: Writing the User Prompts


The user prompt contains the request to pass input values.

Specifically, this step involves passing the name and birthday received from the Input node to the AI.

Example:


Name:

<p>Birthday:</p>
<p>Using the above information, write today's fortune in approximately 100 characters.</p>
<p>Address the user by name in the first sentence. Example: “Hello, (Name).”<br>Based on their birthday, estimate their age and season of birth, then output a suitable fortune.</p>


Step 6: Bind Variables with Drag and Drop


In Agentria, you can easily import variables using drag and drop without writing any additional code.

Place the Name variable to the right of the ‘Name: ’ field and the BirthDate variable to the right of the ‘Birthday: ’ field.


Step 7: Declaring the LLM Output Variable


To connect to the Output node for final output, you must declare an Output variable in the LLM node.

Set the data type to String and name the variable Fortune to complete all settings for the LLM node.

For this tutorial, proceed with the LLM node's detailed settings using the default values.


Step 8: Run a Single Test


After configuring the prompt, press the TEST button in the Input area to run a single test.

If a fortune sentence outputs correctly after entering your name and birthday and running the test, the LLM node is configured correctly.


Step 9: Connecting the Output Node


Now, pass the generated fortune result to the Output node.

Return to the canvas and connect the LLM node to the End node with an edge.

Double-click the End node to open the node editor and add a String-type variable named Today.

Select or drag and drop the Fortune variable created by the LLM node to connect it to the Today variable.

This completes the ‘Today's Fortune’ generation workflow.


Step 10: Run the Entire Workflow with Run Test


Click the Run Test button in the bottom-right corner of the canvas to execute the entire completed workflow.

Just like a single test, enter a name and birthday, then run the test. The result of today's fortune will appear in the Output.


“Today”: "Hello Joy. Born on January 1, 2000, you arrived with the calmness of winter and the hope of the new year. Today will be a day when your positive energy shines brightly! 😊\n\n- <strong>Today's Fortune in a Nutshell:</strong> A day where your calm yet bright energy will make you stand out.\n\n- <strong>Today's Detailed Fortune:</strong>  \n  - <strong>Money:</strong> Unexpected small luck may come your way, so welcome it cheerfully.  \n  - <strong>Love:</strong> Offering a warm smile to those around you might bring a good connection your way.  \n  - <strong>Health:</strong> Born in winter, try warming yourself up today with a cup of hot tea.  \n  - <strong>Other:</strong> It's a great day to take on new challenges. Have confidence! \n\n- <strong>Lucky Item:</strong> A cozy scarf \n- <strong>Words of Encouragement:</strong>


Next Steps


Congratulations on completing your first Agentria workflow.

Moving forward, you can experiment with different inputs to observe the results and gradually refine your LLM prompts.


Agentria is a space of possibilities where ideas become reality.

Your workflow can expand infinitely with your imagination.


If you're curious about more introductory examples, check out the Beginner Guide page.