Skip to main content

AI Functions

This section provides reference information for Databend's built-in AI functions, which enable natural language processing, vector embeddings, and text generation capabilities directly through SQL.

info

Databend's AI functions leverage OpenAI models and also support Azure OpenAI service for improved data privacy. These functions require an OpenAI API key configured in Databend and are available by default on Databend Cloud.

Available AI Functions

FunctionDescriptionExample
AI_TO_SQLConverts natural language instructions into SQL queriesSELECT * FROM ai_to_sql('Get all products with price less than 100')
AI_EMBEDDING_VECTORGenerates vector embeddings for text dataSELECT ai_embedding_vector('How to use Databend')
AI_TEXT_COMPLETIONGenerates text completions based on a given promptSELECT ai_text_completion('What is a data warehouse?')
Explore Databend Cloud for FREE
Low-cost
Fast Analytics
Easy Data Ingestion
Elastic Scaling
Try it today