The Flink AI Assistant helps you write Flink SQL jobs, diagnose anomalies, and analyze log issues more efficiently.
Function overview
The Flink AI Assistant is an intelligent development tool built on a large language model (LLM) and deeply integrated into the Flink real-time computing console. It lowers the barrier to real-time data development and improves coding and O&M efficiency.
Through natural language interaction, it handles end-to-end tasks from SQL code generation and logic explanation to failure diagnosis.
Core capabilities
-
Intelligent code generation
Interprets natural language descriptions of business needs and generates Flink SQL code snippets or complete jobs. Supports declaring source tables, joining dimension tables, performing complex window calculations, and writing to sink tables. -
Code logic explanation
For complex or legacy SQL logic, provides line-by-line parsing and translates technical implementations into clear business language, helping you quickly understand data flow and computation logic. -
Intelligent fault diagnosis
When a job fails due to runtime exceptions or syntax errors, analyzes error logs, identifies root causes, and provides specific remediation suggestions. -
Performance optimization suggestions
Detects potential performance bottlenecks—such as data skew or oversized state—and recommends parameter tuning or SQL rewrites based on Flink best practices.
Skills
The AI Assistant provides predefined skills for common job development and O&M tasks. Type @ in the input box to open the skill list, select a skill, and describe your intent in natural language.
|
Skill |
Description |
|
Draft development |
Query and interpret Flink job draft information |
|
Deployment management |
Query and interpret Flink job deployment information |
|
Job lifecycle operations |
Manage Flink job runtime status and lifecycle |
|
Session cluster management |
Query and interpret Session cluster information |
|
Job diagnostics |
Perform in-depth diagnosis of Flink job issues, including problem identification and remediation suggestions |
|
Resource configuration |
Query and interpret job resource configuration details |
|
Runtime parameters |
Query Flink job runtime parameter settings |
Agent mode and Chat mode
The AI Assistant offers two interaction modes, switchable below the input box:
-
Agent mode—The assistant actively invokes skills to perform operations. Use this mode for data queries, diagnostics, or other workspace actions.
-
Chat mode—Pure conversational Q&A. Use this mode for conceptual questions or SQL syntax explanations that don’t involve system operations.
Quick start
How to invoke
In the development console, click the
icon in the floating window at the bottom right to open the AI Assistant.
AI Assistant responses may contain hallucinations or outdated information. The assistant might generate syntactically correct but nonexistent parameters, or reference deprecated ones due to rapid version updates. Always verify against the official connector parameter documentation.
Interface overview
The AI Assistant appears within the development console. After opening, it displays a welcome page with four tabs at the top: Development & Debugging, Anomaly Diagnosis, Performance Tuning, and FAQ. Each tab lists common questions for quick access. At the bottom, an input box lets you interact directly with the assistant using natural language.
Feature details
Resource planning consultation
Before scaling or configuring Flink compute units (CUs), the AI Assistant provides capacity estimates based on your business scale. More precise questions yield better recommendations.
-
Data throughput: Specify message rate (TPS/QPS) or data volume (MB/s).
-
Computation complexity: Describe key operations (e.g., simple filtering, multi-stream join, large window aggregation).
-
Latency tolerance: State acceptable delay (e.g., sub-second, minute-level).
Example:
I need to read from Kafka at approximately 50,000 records/second, with each record sized 1 KB. The logic involves field renaming and simple filtering before writing to Hologres. Please recommend suitable concurrency and CU count.
The AI Assistant returns a two-part response: a Conclusion with recommended concurrency and CU count, and a Rationale covering QPS handling capacity, concurrency settings, external system bottlenecks, and window function impact.
Job drafting assistance
The AI Assistant generates Flink-compliant SQL code as needed.
-
Define source and sink: Clearly describe your input source (Source) and output destination (Sink). Specify the connector type (e.g., Kafka, JDBC, HBase) along with field names and data types.
-
Describe processing logic: Explain required data transformations, including filter conditions, aggregate operations, window types (tumbling, sliding, or session windows), and any necessary joins.
Example:
Write a Flink SQL job. The source is the Kafka topic user_behavior, containing user_id and timestamp. Calculate unique visitors (UV) per 5-minute tumbling window and write results to the MySQL table uv_stats.
The AI Assistant generates a complete Flink SQL job template, including CREATE TABLE statements for source and sink tables with WITH clause configurations. Copy the output directly into the SQL editor.
The assistant favors ANSI SQL-compliant DDL (data definition language) and DML (data manipulation language) code aligned with Flink semantics. On the platform, you typically use CREATE TEMPORARY TABLE instead of CREATE TABLE.
Job development error analysis
If your job contains invalid statements or errors during development, click the analysis button in the upper-right corner of the error message.
Runtime error log analysis
-
Job fails immediately with no logs.
In , an AI diagnostics icon appears next to failed jobs.
-
Error logs are already available.
If the job hasn’t failed or the error is a non-fatal exception, click the AI diagnostics button in the upper-right corner of the job logs to analyze them.
Parameter query
-
Identify the connector type.
-
Describe the desired functionality.
Example:
What parameters enable partial column writes in Hologres?
The AI Assistant lists relevant parameters (e.g., sink.partial-insert.enabled) with their purpose, valid values, applicable scenarios, and links to reference documentation.
Resource configuration and parameter tuning
Proper parameter settings are critical for stable job operation. The AI Assistant generates optimal parallelism and memory configurations based on your resource limits (total CUs) and job characteristics.
-
Resource budget: Specify your total CU count or core count.
-
Job type: Is it compute-intensive (complex UDFs/JSON parsing) or memory-intensive (large windows/deduplication)?
-
Tuning objective: Prioritize high throughput, low latency, or job stability.
Example:
I have 10 CUs available for a standard dual-stream join job using two MySQL tables. Recommend TaskManager count, memory allocation, and parameter tuning to ensure high throughput.
The AI Assistant provides a resource allocation plan for TaskManager and JobManager, parameter tuning suggestions (including Mini-batch, state TTL, and Checkpoint settings), and optimization recommendations.