Get Started

Using DB Node (Structured Data Reader)

Using DB Node (Structured Data Reader)

Using DB Node (Structured Data Reader)

Using Database Nodes (DB Reader)

This tutorial covers how to use the DB Reader node in Agentria. The DB Reader node retrieves data stored in Data Storage. Set a search condition to return records that match the criteria.

In this tutorial, you will build a workflow that accepts a customer name as input, queries the customer Data Storage for matching records, and outputs the results.

Before You Begin

For instructions on accessing the Agentria canvas, refer to the πŸ”—3-Step Core Guide.

The DB Reader node requires Data Storage to be configured in advance. Refer to the πŸ”—Data Storage Guide.

After completing this tutorial, you will be able to:

  1. Use the DB Reader node to retrieve records from Data Storage.

  2. Write search conditions using the $column == @variable format.

  3. Set the query range with page size and page number.

  4. Process and output query results using an LLM node.

Workflow Overview

The core of this tutorial is the DB Reader node.

The DB Reader node retrieves records from the specified storage that match the search condition. $ references a storage column and @ references an input variable β€” combine these two symbols to write condition expressions.

Step 1: Create an Ability

Create a new Ability on the Agentria canvas.

Use the +Add Node button to add a DB Reader node and an LLM node to the canvas.

Step 2: Declare Input Variables

Double-click the Input Node to open the Node Editor.

The storage used in this tutorial is Customer Data, with the column structure below. Declare input variables to match the columns you want to search by.

Variable

Type

Description

name

String

Customer name

phone

String

Phone number

grade

String

Customer grade

memo

String

Memo

Step 3: Configure the DB Reader Node

Double-click the DB Reader node to open the Node Editor.

The DB Reader node provides the following options.

Option

Required

Description

storage

Required

Select the storage to query

query

Optional

Search condition ($column == @variable format)

page_size

Optional

Maximum number of records per page

page_number

Optional

Page number to retrieve (starts at 0)

This tutorial configures storage, query, page_size, and page_number.

Select Storage

Click the Select Storage button to open the selection screen. Select the storage that holds the customer data.

Write the Search Condition

Enter a condition expression in the query field. To search by name, enter the following.


  • $ β€” references a column in the Data Storage

  • @ β€” references an input variable


Page Settings

Option

Value

Description

page_size

10

Maximum records to retrieve at once

page_number

0

First page (starts at 0)

Step 4: Configure the LLM Node (Optional)

To format the retrieved data as a natural language message, add a prompt to the LLM node. Double-click the LLM node to open the Node Editor and enter the following in the System Prompt field.

The LLM node is optional. If omitted, connect the DB Reader node's Out-Pin directly to the Output Node.

Step 5: Configure the Output Node

Double-click the Output Node to open the Node Editor. Add the following variable to the Output Section.

Variable

Type

result

String

Drag and drop the output variable from the LLM node onto the result variable in the Output Node.

Connect the edges.

  1. Out-Pin of Input Node β†’ In-Pin of DB Reader node

  2. Out-Pin of DB Reader node β†’ In-Pin of LLM node

  3. Out-Pin of LLM node β†’ In-Pin of Output Node

Step 6: Run Test

Click the RUN TEST button at the bottom right of the canvas.

Enter the customer name to search for in the name field and run the test β€” the matching customer's information will be returned as output.

Next Steps

πŸŽ‰ Congratulations! You've successfully built the "Customer Data Query" workflow using Agentria.

Try combining multiple search conditions, or extend the workflow by passing the retrieved results to a DB Updater node for editing.

Agentria is a place where ideas become realityβ€”your workflow can expand infinitely with your creativity.