RDS AI, built on Supabase, lets you automatically extract entities and relationships from your business database, build an ontology layer, and generate a skill for an AI agent with a single click. This enables you to quickly transform business data into semantically-aware AI applications.
Notes
LLM automatic modeling is a one-time process. Do not leave the page while it runs. Automatic modeling uses the LLM to infer the database schema and business semantics, a process that typically takes several minutes. If you leave the current page or refresh your browser during modeling, the task is interrupted and cannot be resumed. You must restart the process.
The business data in this document, including users, orders, and stores, is demo data generated by LLM batch data generation. The values and conclusions do not reflect real business data. Validate with real business data in a production environment.
Step 1: Prepare the instance environment
1. Create a Knowledge Graph instance
Log in to the RDS AI Application development console and go to the instance purchase page.
On the purchase page, configure the following parameters, ensuring you select Knowledge Graph for the RDS AI Application Module.
Parameter
Description
RDS AI Application Project Name
A custom name to identify the instance in the console.
Region
Select the region where your business operates. This setting cannot be changed after the instance is created. For lower network latency, deploy the instance in the same region as your applications.
VPC, Primary Zone, and Network
Select an existing VPC and vSwitch. If none exist, click Create to create them in the VPC console.
RDS AI Application Module
Knowledge Graph is a required selection. You can also select Supabase and Long-term Memory depending on your business needs.
Dashboard Username
This value is fixed to
supabaseand cannot be changed.Dashboard Password
The password must be 8 to 32 characters long and contain at least three of the following: uppercase letters, lowercase letters, digits, and underscores (_). This password is used to sign in to the Knowledge Graph workbench.
Billing Method
The available billing methods are subscription and pay-as-you-go. The subscription option is recommended for long-term use.
Engine
Available engines are PostgreSQL 17 and PostgreSQL 18. We recommend PostgreSQL 17 unless you have specific requirements.
SLR Authorization
Ensure the
AliyunServiceRoleForRdsandAliyunServiceRoleForRdsPgsqlOnEcsservice-linked roles have a green check mark. If not, follow the on-screen instructions to authorize them.Edition
Select the Basic Edition for testing and feature validation. For production environments, we recommend the High-availability Edition.
Instance Type Category, Instance Type
Select an instance type that meets your data volume and concurrency requirements. For this demo, we recommend selecting at least
pg.n2.2c.1m(2 vCPUs, 4 GB).Storage Space
The default is 20 GB. You can adjust this value to match the scale of your business data.
Database Password
The password must be 8 to 32 characters long and meet the same requirements as the Dashboard Password. This password is for connecting directly to the PostgreSQL database to perform data operations.
Review your order, complete the payment, and wait for the instance to be created. This process typically takes several minutes.
2. Configure the IP address whitelist
In the instance list of the RDS AI Application development console, click the target project name to go to the instance details page.
Add your local client's public IP address to the IP address whitelist and save the changes.
3. Sign in to Knowledge Graph
In the RDS AI Application development console, click the target project name to go to the instance details page.
In the Network Information section, copy the public endpoint (for example,
59.xxxx.182:80).In a browser, open the public endpoint and sign in with the Dashboard Username
supabaseand the Dashboard Password you set during instance creation. After signing in, you are directed to the Knowledge Graph workbench, where you will perform all subsequent operations, such as building datasets, modeling ontologies, and generating skills.
The Network Information section on the instance details page also displays the PostgreSQL public endpoint (for example, pgm-xxxxxxxx.pg.rds.aliyuncs.com) and the PostgreSQL internal endpoint. You will need these endpoints to connect directly to the RDS PostgreSQL database in a later step, so take note of them. If a public endpoint is not available, you can enable it using the Allow Public Access toggle.
Step 2: Prepare business data
In this step, you will create the business table schema and generate test data. We recommend connecting directly to RDS PostgreSQL for maximum efficiency.
1. Connect directly to the RDS PostgreSQL instance
Log in to the RDS console.
In the instance list, find the PostgreSQL instance associated with your RDS AI instance, and click the instance ID to open the Details page.
On the Database Connection page, copy the public endpoint (for example,
pgm-xxxxxxxx.rds.aliyuncs.com), and record the corresponding port, database name, username, and password.
2. Create the business table schema
Use any PostgreSQL client, such as psql, DataGrip, or Navicat, to connect to the RDS PostgreSQL instance. In the target database, such as supabase_db, run the following DDL to create the tables, foreign keys, indexes, and constraints for a food delivery ordering system.
3. Generate associated test data
Use QoderWork to batch-generate associated test data with a natural language prompt. Open QoderWork and enter a prompt similar to the following:
I need a data insertion script for my PostgreSQL database. The connection details are as follows: Endpoint: pgm-XXX.rds.aliyuncs.com, Database: supabase_db, Username: XXX, Password: XXX.
Please check my current table schema and generate 100,000 interrelated records. Ensure that all data for users, orders, shops, and menus is correctly linked.
Replace the placeholders in the prompt, such as pgm-XXX.rds.aliyuncs.com, username, and password, with the connection information from Step 1. QoderWork automatically connects to the RDS PostgreSQL instance, reads the table schema, generates associated data that complies with foreign key constraints, and inserts the data.
Step 3: Build an ontology
An ontology models the entities, properties, and relationships in a business domain. It enables an AI agent to understand your business. In this step, you will generate an ontology from your business data using agent automatic modeling. The process includes starting automatic modeling, creating an ontology dataset, configuring the connection, previewing and refining the ontology, and registering and viewing the knowledge graph.
1. Start agent automatic modeling
Sign in to the knowledge graph workbench with the Dashboard username
supabaseand your password (see section 3 of Step 1).In the left navigation pane, under the ONTOLOGY group, click Type Modeling.
In the Type Definition section, click Agent Automatic Modeling to start the automatic ontology modeling workflow.
The Modeling Template section at the top of the page provides predefined ontology templates, such as Agent Structured Memory, which cover common entities like people, projects, tasks, events, documents, and notes. If your business use case aligns with a general agent memory scenario, you can click One-click Apply to skip the automatic modeling process. This document uses a custom "food delivery ordering system" as an example and follows the agent automatic modeling workflow.
2. Create an ontology dataset
On the Automatic Ontology Modeling page, a three-stage workflow appears at the top: Connection Configuration → Preview & Refine → Finish. First, create a dataset for the ontology definition.
In the dataset drop-down list in the upper-right corner of the page, click Create Dataset.
Complete the dataset information as described in the following table.
Parameter
Description
Name
Required. A name for the dataset. We recommend using a name that reflects the business scenario, such as
food_delivery_ontology.Description
Optional. A brief description of the dataset to aid future maintenance.
RAG type
The drop-down list supports three types: GraphRAG, Ontology, and Skills. For this scenario, select Ontology.
Storage type
Set to Local Storage and cannot be changed. Ontology and Skills datasets only support local storage.
Click Create Dataset. Once created, the dataset is automatically selected and activated, and its status is displayed as active.
3. Configure connection and trigger modeling
In the Connection Configuration stage, select
publicfor the schema and enter the business logic: "This is a food delivery ordering system." This description guides the Large Language Model (LLM) in abstracting entity semantics. The more precise the description, the more closely the generated ontology will align with your business.After you confirm the configuration, click Start Analysis to enter the Preview & Refine stage. The LLM then scans table structures and foreign key relationships to infer ObjectType, LinkType, and ActionType.
LLM automatic modeling is a one-time, long-running process that typically takes several minutes. During the modeling process, do not switch pages, refresh your browser, or close the tab. This will interrupt the task, which cannot be resumed. You must then restart the modeling process.
4. Preview and refine ontology
When modeling is complete, the inferred results appear on four tabs: ObjectType, LinkType, ActionType, and Mapping. Each ObjectType card shows the primary key (PK), the number of properties, and the creation time.
In the Recommendation Center section, review the refinement suggestions. You can accept or ignore each suggestion based on your business requirements. You can also manually edit entity names, properties, and relationship types to better align the ontology with your business semantics.
Once you confirm the ontology structure is correct, click Register to Dataset and then Confirm Registration to enter the Finish stage.
5. Register and view knowledge graph
In the Finish stage, the system automatically extracts data from your RDS PostgreSQL business database based on the ontology definition. It then builds entity nodes and relationship edges and writes them to the knowledge graph. The duration of the initial synchronization depends on the data volume.
After the registration is complete, go to the ONTOLOGY group in the left navigation pane and click Ontology Graph to view a visualization of your knowledge graph. You can click any node to view its specific instance data and verify the ontology extraction.
In Instance Management, you can view the total number of instances for each ObjectType to verify that the data synchronization is complete.
Step 4: Generate and install a Skill
After you register the ontology in the Finish stage, the LLM can automatically generate an Agent Skill package from it, which AI agents can then call.
1. Click "Generate Skill" to open the dialog box
On the Finish page of the Automatic Ontology Modeling workflow, click Generate Skill in the action bar at the bottom. The Generate Agent Skill from Modeling dialog box opens. The subtitle of the dialog box displays the name of the current dataset, for example, Automatically generate a complete Agent Skill package based on the ontology model of the current dataset (food_delivery_ontology).
2. Configure the Agent Skill
Configure the parameters in the dialog box as described in the table below.
Parameter | Description |
Skill Name | A custom name for the Skill, such as |
Scene Title | Optional. A brief description of the Skill's use case, such as |
API URL | Required. The RAG gateway URL that the Skill uses to access the knowledge graph, for example, |
Use Agent Mode (LLM Generation) | This option is selected by default and recommended. When selected, the LLM understands the domain semantics and generates query priorities and an inference chain for the Skill tailored to your business scenario. If you clear this option, only basic ObjectType query templates are generated. |
Auto-publish to Skills | Optional. When selected, the generated Skill is automatically published to the Skills dataset, allowing an AI agent to call it without manual publishing. If you want to review SKILL.md before publishing, keep this option cleared. |
3. Start LLM inference
After you configure the parameters, click Agent Generate in the lower-right corner of the dialog box. A loading message Agent is generating SKILL.md (LLM inference in progress)... appears, along with the prompt The LLM is understanding the domain semantics and generating the Skill document. Please wait....
Wait for the LLM inference to complete. This typically takes several minutes and depends on the size of the ontology and the number of ObjectTypes. The system then automatically generates the
SKILL.mdfile and its associated Skill package files.If you did not select Auto-publish to Skills, you can review the content of the
SKILL.mdfile on the preview page after generation. Once you confirm that the content is correct, you can manually install the Skill to the Skills dataset.
During the LLM inference process, do not close the dialog box, refresh your browser, or switch pages. This will interrupt the task, and you must restart the process by clicking Agent Generate again.
4. Install the Skill
After the Skill is generated, install it on your local AI programming client so that an AI agent can load and call it.
In the SKILLHUB area of the left-side navigation pane, click Skills. On the newly created Skill card, such as
food-delivery-agent, click Install.In the Install Skill dialog box, select the tab corresponding to your local client: Claude, Cursor, Gemini, General, or Qoder. The dialog box displays the Target Directory for the selected client (for example, the default for Qoder is
~/.qoder/skills/<skill-name>) and a complete installation command.Click Copy in the upper-right corner of the command area, and then paste and run the command in your local terminal. The command uses
curlto download a ZIP package from the SKILLHUB artifact repository and extracts it to the target directory. If the terminal reports no errors, the installation is successful. Return to the dialog box and click Close.Reload or restart the Skill list in your local Qoder client. The newly installed Skill appears, and you can proceed to Step 5 to verify that it works correctly.
Step 5: Verify results in QoderWork
1. Select a skill and ask a question
Open the QoderWork client and select an installed Skill, such as
food-delivery-agent, from the Skill list.In the chat window, ask a question in natural language. For example:
Can you look up my store: Li XX's Chinese Restaurant?Based on the ontology, the Skill queries the underlying RDS PostgreSQL data through the knowledge graph and returns a structured analysis report.
2. Demo: Analysis report
The following is a sample of the complete analysis report the Skill returned after executing the preceding query on the sample database.
Basic store information
Attribute | Details |
Store ID | f28b7494xxxx63defce99c5 |
Store name | Li XX's Chinese Restaurant |
Category | Dessert |
Rating | 3.2 / 5.0 |
Business status | Closed |
Business hours | 09:00 - 22:00 |
Contact number | 1522499**** |
Address | No. xxx, Jiefang Road, Nanshan District, Hangzhou |
Registration date | July 29, 20xx |
Dish mix analysis
The store currently offers 5 dishes online, all tagged as "Hot Sellers":
Dish name | Category | Price | Status |
Specialty Seafood | Snack | ¥149.88 | Available |
Specialty Chicken | Beverage | ¥68.07 | Available |
Signature Chicken | Signature Dish | ¥53.83 | Available |
Specialty Beef (Style 1) | Signature Dish | ¥144.01 | Available |
Specialty Beef (Style 2) | Signature Dish | ¥172.21 | Available |
Dish strategy highlights:
Lean SKU set: With only 5 dishes, the store focuses on core offerings to reduce operational complexity.
Premium pricing: The average price of ¥117.60 is well above the platform average for fast food, indicating a premium positioning.
Focus on signature dishes: 3 of the 5 dishes are signature dishes, emphasizing a unique competitive edge.
Category mismatch: "Specialty Chicken" is categorized as "Beverage," and "Specialty Seafood" as "Snack," indicating data quality issues.
Order operations analysis
Total orders: 24 (ranked #1 on the platform).
Order status distribution
Status | Quantity | Percentage |
completed | 8 | 33.3% |
delivering | 6 | 25.0% |
preparing | 5 | 20.8% |
pending | 4 | 16.7% |
cancelled | 1 | 4.2% |
Key findings:
The completion rate of 33.3% is below the platform average of 35.1%.
In-progress orders (preparing, delivering, and pending) account for 62.5%, indicating high recent activity.
The cancellation rate is only 4.2%, which is better than the platform average of 5%.
Revenue performance
Metric | Value |
Total revenue from completed orders | ¥7,043.33 |
Average order value | ¥880.42 |
Highest single order | ¥1,496.06 |
Lowest single order | ¥140.77 |
The average order value of ¥880.42 far exceeds the platform average of ¥549 (60% higher), which validates its high-end positioning strategy.
User behavior insights
Order remarks analysis
Out of 24 orders, 13 included remarks (54.2%). This rate is much higher than the average for delivery restaurants and indicates that users have specific, personalized needs:
Remark | Frequency |
"Invoice header: personal" | 3 |
"Extra spicy" | 3 |
"Deliver to the front desk" | 2 |
"Please be quick" | 2 |
"Takeout" | 1 |
"Light on scallions" | 1 |
"Not spicy" | 1 |
Spice preferences vary widely: requests for both "Extra spicy" and "Not spicy" suggest diverse customer tastes.
Monthly order trends
Month | Order count |
20xx-04 | 2 |
20xx-05 | 1 |
20xx-06 | 2 |
20xx-07 | 3 |
20xx-08 | 2 |
20xx-09 | 5 (peak) |
20xx-10 | 1 |
20xx-11 | 4 |
20xx-12 | 2 |
20xx-01 | 2 |
September was the peak month for orders (5), possibly due to seasonal autumn demand or store promotions. The overall monthly average is approximately 2.4 orders, indicating a low but stable order volume.
Delivery coverage analysis
Order delivery addresses span multiple cities:
Hangzhou: 8 orders
Shenzhen: 4 orders
Shanghai: 4 orders
Beijing: 1 order
Guangzhou: 1 order
Wuhan: 2 orders
Chengdu: 2 orders
Xi'an: 2 orders
The delivery coverage is unusually broad, spanning eight cities nationwide. This is rare for a physical restaurant and could indicate one of the following:
The establishment is a virtual store or part of a chain brand.
The data is simulated or for testing purposes.
The store uses an inter-city delivery service.
Key issues and recommendations
Issues
Low rating (3.2/5.0): The store's rating places it near the bottom among the platform's top 10 stores by order volume, making reputation its biggest weakness.
Low completion rate (33.3%): This is below the platform average and may indicate issues with kitchen throughput or service quality.
Category and name mismatch: The store name is "Chinese Restaurant" but its category is "Dessert," and its dish categories are also inconsistent.
Currently closed: The store is missing out on potential orders.
Recommendations
Improve service quality: Focus on user feedback, optimize food preparation speed and dish quality, and aim to raise the rating to 4.0 or higher.
Reopen for business: Resume operations as soon as possible to capitalize on the traffic from current in-progress orders.
Standardize dish categorization: Correct errors such as "Specialty Chicken" being categorized as "Beverage" to improve the user search experience.
Offer spice levels: To accommodate the diverse preferences for "Extra spicy" and "Not spicy," provide options such as Mild, Medium, Hot, and No Spice.
Expand the SKU set: The current offering of five dishes is limited. We recommend adding 10 to 15 dishes at different price points to appeal to more customers.