If you want to quickly obtain data query results by asking questions in natural language, you can use LangStudio to connect large language models that have tool calling capabilities with databases based on the Model Context Protocol (MCP) to build an intelligent data analytics assistant. This topic uses the Qwen3 model and Hologres database as an example to demonstrate how to easily interact with data through conversation.
Solution overview
This solution connects three core components through LangStudio to form a complete data analytics application:
Large language model (LLM): We use the Qwen model that supports Tool Calling as the "brain" of the application, responsible for understanding your natural language questions.
MCP server: It functions as a "bridge," converting instructions issued by the large model (such as "query the user table") into SQL statements that Hologres can execute. This topic uses a Hologres MCP Server deployed on Function Compute as an example.
LangStudio Agent: As the "scheduling center" of the application, it receives your questions, calls the LLM for processing, interacts with the Hologres database through the MCP Server, and finally organizes the query results into easy-to-understand answers for you.
Billing
This topic involves multiple paid cloud products. Please understand their billing rules before you start. Release resources promptly when they are no longer needed to avoid unexpected charges:
Elastic Algorithm Service: Used to deploy large language model services. For billing details, see Elastic Algorithm Service billing.
Function Compute: Used to host the Hologres MCP Server. For billing details, see Function Compute billing overview.
Hologres: Real-time data warehouse instance. For billing details, see Hologres billing overview.
For other cloud resources that might be used, see LangStudio billing.
Preparations
Before you begin, make sure you have completed the following preparations:
Plan your network environment: To ensure secure and efficient communication between components, we recommend deploying all resources in the same region and the same virtual private cloud (VPC). If you do not have a VPC yet, create a VPC and vSwitch and create a security group.
Prepare a Hologres instance and data:
You can use an existing Hologres instance or purchase Hologres (pay attention to the VPC selection when purchasing).
Create a database and import the public dataset tpch_10g with one click for testing.
1. Create a model service connection
1.1 (Optional) Deploy a model service
This topic deploys the Qwen3-32B model service with one click through Getting Started > Model Gallery.
Enter Qwen3-32B in the search box, click Deploy on the model card, and use the default parameters.
You can also choose other large language model services, such as Alibaba Cloud Model Studio or other existing model services. Note that this example requires the model service to support Tool Calling.
1.2 Create a connection
If you are using a non-EAS model service, please select an appropriate model service connection according to your service type. For more information, see Connection configuration.
Go to LangStudio, click Connections > Model Service tab, and click Create Connection with the following configuration:
Connection Type: Select Generic LLM Model Service Connection.
Service Provider: Select PAI-EAS Model Service. After selecting the deployed EAS service from the dropdown, base_url and api_key will be automatically filled with the VPC endpoint and Token of the deployed service.
Tool Call: This option is automatically selected for models deployed from Model Gallery. For models deployed using other methods, configure this parameter as needed.

2. Create an MCP service connection
The MCP Server is the "bridge" connecting the Agent and the Hologres database, encapsulating database operations into standard tool interfaces.
In LangStudio, you can quickly deploy the Hologres MCP Server using an MCP template.
Go to LangStudio, and in the tab, search for Hologres.
Click the aliyun-hologres-mcp-server card, and set the deployment parameters on the right side of the page as follows, keeping others as default:
Region: Select the same region as your Hologres instance.
Function Compute Access Hologres Service Role: AliyunFCDefaultRole. If it does not exist, click Create Role. Note that you need to create a user with this role in the Hologres console and add permissions.
VPC ID: Select the same VPC as your Hologres instance, and follow the console page instructions to select VSwitch and Security Group.
Hologres Instance Host: Enter the domain name corresponding to the VPC access of your Hologres instance. You can find this in the Network Information section of the Hologres instance details page.

After deployment is complete, the service name and address will be generated on the right side of the template. Click Online Test to test the connectivity between the MCP Server and the Hologres instance.
NoteThe service address shown here is the public network access address. If you need the VPC access address, click the arrow to the right of the service name to enter the service details page and obtain it from the Access Address tab.

Under Connections > MCP Service, the system will automatically generate a connection record for this MCP service.
NoteMCP Servers created through templates or custom configurations in LangStudio will automatically generate connection configurations. If you deploy your own MCP service or use a third-party platform to host it, you can configure it by creating a new connection.
3. Create a runtime environment
In the Runtime tab, click Create Runtime to create a runtime instance that provides the running environment for the application flow.
If you use an existing runtime, we recommend updating the image to the latest version.

4. Create an application flow
In the Application Flow tab, click Create Application Flow to create an Intelligent Data Agent application flow.
In the Application Flow tab, click the target application flow to enter the application flow details page. Click the Agent node and complete the following settings:
Agent Strategy: Select FunctionCalling.
Model Settings: Select the model connection created in step 1.2.
Conversation History: Turn it on.
MCP Service Configuration: Click Add MCP Service, select Type as connection, and select the MCP service connection created in step 2.
Set Input Variables information, including System Prompt and USER prompt. Set Maximum Loop Count to 5, which can be adjusted as needed.

5. Test and verify
After configuration is complete, click Run in the upper right corner. You can test in the conversation interface.
Because the public dataset imported into Hologres has multiple schemas, directly asking questions about tables might not yield answers. You can follow these steps for guidance:
What schemas are in Hologres?

What tables are in hologres_dataset_tpch_10g?

Calculate how many different countries customers come from

Production application recommendations
When you have finished debugging in LangStudio and are satisfied with the results, you can deploy it as a production-level API service with one click.
Deploy the application flow: In the upper right corner of the LangStudio application flow canvas, click Deploy, select appropriate resource specifications, and be sure to select the same VPC and vSwitch as all other components to ensure network connectivity. For more information, see Application flow deployment.
Public network access configuration: If your application flow needs to access other services through the public network, make sure to configure public network access capabilities when deploying as an EAS service.
Cost and performance: Based on your business load, reasonably select the resource specifications and number of instances for the EAS service to balance performance and cost. After testing is complete, promptly release all experimental resources.
FAQ
Can I connect to other types of databases (such as MySQL, PostgreSQL)?
Yes. The core of this solution is the MCP protocol. As long as you can find or develop an MCP Server for your target database, you can replace the Hologres MCP Server information in the Agent configuration to query other data sources.
Can I build an Agent application using a model service that does not support tool calling?
Yes. You need to select the ReAct strategy in the Agent node, which does not require the model to support tool calling. We recommend selecting a model with strong inference capabilities.


