×
Community Blog Using SQL to Call LLMs? Hologres + Model Studio Enables Data Developers to "Talk" Directly to AI

Using SQL to Call LLMs? Hologres + Model Studio Enables Data Developers to "Talk" Directly to AI

Discover how Alibaba Cloud Hologres + Model Studio lets data teams use plain SQL to call LLMs for PDF analysis, image understanding, and RAG—no GPU, Python, or AI engineering required.

In the daily life of data teams, do you often hear questions like:

"Can I query data using natural language?"
"Are there any risk clauses in this PDF contract?"
"Help me check if this shelf layout matches our plan."

As data developers, we're familiar with SQL, data warehouse layering, and ETL processes. But when faced with these requests, we often have to shake our heads helplessly—because they belong to the realm of "AI engineering" involving large models, multimodal processing, and vector retrieval. Building a RAG system? That means GPU clusters, LangChain, FastAPI, vector databases...a steep increase in tech stack complexity and soaring operational costs.

But today, I want to tell you: these scenarios can actually be solved with SQL.

Alibaba Cloud Hologres has deeply integrated with the Model Studio large model platform to introduce AI Function capabilities—no Python, no additional services needed. Using your familiar SQL, you can directly call large models to enable intelligent analysis across all modalities, from structured data to images, PDFs, and videos.

Why Hologres + Model Studio?

Traditional AI solutions suffer from three major pain points, which Hologres + Model Studio addresses precisely:

1.      AI and data are siloed: Data resides in data warehouses while models run externally, requiring back-and-forth data movement that's slow and poses security risks.
Hologres brings models "into" the data, completing inference right next to where the data lives, ensuring data never leaves the warehouse.

2.      High engineering costs: Self-hosted LLM services require GPUs, API gateways, rate limiting, circuit breakers...making them difficult for data teams to maintain.
Model Studio provides managed large model services, which Hologres can call with a single function—zero operations overhead.

3.      Mismatched tech stacks: SQL developers don't know how to write LangChain, and algorithm engineers don't understand data warehouse layering.
Use SQL to orchestrate AI logic, empowering data teams to lead end-to-end AI applications.

What is Model Studio? What does it bring to data development?

Model Studio is Alibaba Cloud's one-stop large model development and application building platform, integrating mainstream models like Qwen, DeepSeek, and Kimi, supporting various capabilities including text generation, multimodal understanding (e.g., Qwen-VL), embedding, translation, and more.

For data developers, Model Studio's core value is: you only need to focus on "how to use it," not "how to run it."

     Model deployment, elastic scaling, monitoring, and alerting are all managed by the platform

     OpenAI API compatible, with low migration costs

     Supports VPC calls, meeting enterprise security and compliance requirements

     Pay-per-token pricing, ready-to-use with no wasted idle resources

How do Hologres and Model Studio work together?

Hologres integrates with Model Studio through API key-based direct calls, balancing agility with production-grade performanc

O1CN01LD1hqy1WvLumDNDqh_!!6000000002850-

Figure: Hologres integrates with Model Studio through API key configuration, enabling direct model calls from SQL

Simply configure a Model Studio API Key in the Hologres console deployment page, then deploy Model Studio large models with one click. After that, you can directly call models on the Model Studio platform (such as qwen3-max, tongyi-embedding-vision-plus) using SQL.

Note: For dedicated model requirements, it's recommended to deploy built-in models using Hologres AI nodes

     Use cases: Ideal for exploration, low-frequency, or lightweight scenarios

     Key advantages: No GPU management required, pay-per-token pricing

     Security: Data transmitted through secure channels, supports VPC calls

Unified Development Experience

Developers call Model Studio large models through unified AI Functions (such as ai_gen, ai_embed) using standard SQL consistent with data warehouse operations, enabling seamless switching.

Enhanced Multimodal Capabilities

More powerfully, combined with Object Table and Dynamic Table, Hologres can automatically detect changes in unstructured data (such as images, PDFs, videos) in OSS, enablg incremental automatic processing and vectorization—truly achieving "one data source, one computation, multi-modal analysis."


Hologres AI Function Deep Dive: SQL as Your AI Orchestration Language

Hologres provides rich AI functions covering the entire pipeline from preprocessing to inference, all callable through standard SQL:

O1CN01k74iQ01H4wLyaNyAn_!!6000000000705-

 

Function Category

Function Examples

Typical Use Cases

Multimodal Parsing

ai_parse_document

Convert PDF/images to text

Text Preprocessing

ai_chunk, ai_mask

Long text chunking, sensitive information masking

Information Extraction

ai_extract

Extract fields like amounts and dates from contracts

Vectorization

ai_embed

Generate embeddings for text/images, supports multimodal models

Semantic Computing

ai_similarity, ai_rank

Similarity scoring, result re-ranking

Generation & Understanding

ai_gen, ai_summarize, ai_classify, ai_analyze_sentiment

Q&A, summarization, classification, sentiment analysis

Translation

ai_translate

Multi-language translation

Practical Scenarios: From "Writing Reports" to "Understanding the Unstructured World"

In the past, the core battlefield for data development was structured data—we modeled, aggregated, scheduled, and ultimately produced reports. But today, real business insights are often hidden in unstructured data like PDF contracts, store photos, and in-car videos. How can we make these "silent data" queryable with SQL? Hologres + Model Studio provides the answer.

O1CN010AKMQG1EwZtHShRn2_!!6000000000416-

Figure: Hologres enables unified processing of structured and unstructured data through Object Table and Dynamic Table, with AI functions powered by Model Studio

Intelligent Customer Service Upgrade: RAG Implementation at Taobao Merchant Service Center

Every day, millions of Taobao merchants inquire about platform rules, after-sales processes, or marketing policies. Traditional keyword-matching knowledge base systems often provide irrelevant answers. Alibaba's CCO (Customer Experience Operations) team wanted to build a truly semantic-understanding intelligent Q&A system: when a merchant asks "How to handle malicious buyer returns?", the system should accurately retrieve and generate relevant solutions.

With Hologres, they stored tens of thousands of help documents in OSS and automatically synchronized file metadata through Object Table. Using the declarative capabilities of Dynamic Table, the system automatically called ai_parse_document to parse content for new documents, then used ai_chunk to semantically segment paragraphs, and finally generated vectors using ai_embed with Model Studio's text-embedding-v4 model, persisting them to Hologres tables. When users asked questions, the system first vectorized the query using ai_embed, performed dual-path retrieval (vector + full-text) within Hologres, then used ai_rank to refine candidate results, and ultimately generated natural language responses using ai_gen (calling qwen3-max). The entire pipeline required no data export or external service orchestration—all driven by standard SQL. After launch, recall rate improved by 13.6% and accuracy by 24.3%, with significantly increased click-through rates, truly achieving "ask accurately, answer correctly."

SaaS Enterprise Multimodal Recommendation: Intelligent Invoice-Contract Matching

A global top-tier SaaS company provides ERP systems, with customers uploading large volumes of invoices, contracts, and transaction documents daily, expecting the system to automatically recommend historically similar templates to reduce repetitive entry. However, these documents have mixed formats (PDF, scanned copies, Word), and traditional OCR plus rule-engine approaches had limited effectiveness and high maintenance costs.

The company unified all unstructured files into OSS, automatically captured metadata through Hologres' Object Table, and used Dynamic Table with incremental capabilities to call ai_parse_document to extract text content, then used ai_embed (based on Model Studio's tongyi-embedding-vision-plus multimodal model) to generate unified embeddings for each document. When querying, users upload a new invoice, the system automatically vectorizes it, and performs hybrid retrieval in Hologres—combining vector similarity with full-text keywords (such as customer name, amount, tax ID) for joint scoring and sorting. Thanks to Hologres' powerful hybrid indexing and high-performance vector engine, average latency was only 72.8ms at single concurrency, maintaining millisecond-level response even at 40 concurrent requests, with accuracy reaching 84.46%. More importantly, data didn't need synchronization to dedicated vector databases but was unified in Hologres, significantly reducing data redundancy, synchronization complexity, and total cost of ownership (TCO).

Autonomous Driving Multimodal Analysis: Making Vehicle Images "Queryable and Computable"

In the smart driving domain, an automotive manufacturer needed to identify high-risk scenarios from massive amounts of vehicle images and sensor signals, such as "pedestrians suddenly crossing the road." Traditional solutions required sending images to independent CV platforms for processing, then flowing inference results back to the data warehouse—not only creating long pipelines but also causing timestamp alignment difficulties and data inconsistency issues.

Now, they store raw images in OSS and stream structured signals (GPS coordinates, vehicle speed, brake pressure, etc.) in real-time to Hologres. Through Object Table, the system automatically associates images with corresponding structured events. Then, using Dynamic Table, it calls ai_embed (using Model Studio-deployed Qwen3-VL multimodal model) to generate visual embeddings for new images, combining them with structured fields into wide tables. Safety analysis teams simply need one SQL query:

SELECT image_url, ai_similarity(vision_emb, ai_embed('pedestrian crossing')) AS risk_score
FROM driving_events
WHERE speed > 30 AND brake_pressure > 0.8
ORDER BY risk_score DESC;

This quickly identifies high-risk segments. This "multimodal fusion analysis" capability enables data teams to directly participate in driving strategy optimization and accident attribution, rather than just being log movers.

These cases collectively reveal a trend: AI is moving from algorithmic black boxes to becoming part of data infrastructure. Hologres + Model Studio makes unstructured data manageable, processable, and queryable like ordinary tables, with SQL becoming the universal language connecting data and intelligence—this is the optimal path for data developers to lead AI application implementation.

Conclusion: The AI Era Has Arrived for SQL Developers

Hologres + Model Studio isn't "just another AI tool," but rather deeply integrates large model capabilities into data infrastructure. It enables data developers to build cutting-edge multimodal intelligent applications without needing to transform into AI engineers.

You no longer need to write glue code, apply for GPU clusters, or coordinate with algorithm teams—with SQL, you can unlock the value of large models.

Take action now:

     Configure a Model Studio API Key in Hologres

     Or deploy a model to AI nodes

     Then run this SQL:

SELECT ai_gen('Summarize the value of Hologres + Model Studio in one sentence');

The answer will be: Empowering data development to become the productivity engine of the AI era.

Want to see how Hologres lets you call LLMs directly using standard SQL? 👉 Try Hologres on Alibaba Cloud or talk to our solution architect to explore how you can seamlessly integrate AI capabilities into your real-time data workflows.
For more details, check out the official documentation:

     Hologres AI Overview

     Supported Models from Alibaba Cloud Model Studio

0 0 0
Share on

You may also like

Comments