Microsoft ने AI एजेंट्स के लिए visualization language Flint जारी की
(microsoft.github.io)- Flint एक visualization intermediate language है, जो AI एजेंट्स को इंसानों द्वारा edit की जा सकने वाली छोटी specifications से expressive charts बनाने में मदद करती है
- compiler data, semantic types, chart types और encodings को interpret करके scale, axis, spacing और layout जैसी low-level settings अपने-आप भर देता है
- यह 46 chart types और 83 gallery examples देता है, और Vega-Lite, ECharts, Chart.js rendering को support करता है
- TypeScript / JavaScript environment में इसे npm से install किया जा सकता है, और agent workflows में MCP server इस्तेमाल किया जा सकता है
- backend-specific API differences को एक unified interface के पीछे छिपाकर, एक ही specification से renderer switch करना या chart design बदलना आसान बनाता है
Flint जिस समस्या को हल करना चाहता है
- Flint Microsoft Research का project है, जिसे AI agents के लिए simple और human-editable chart specifications से charts generate करने के लिए design किया गया है
- specification data, semantic types और chart specification से मिलकर बनती है
- example specification में
periodकोYearMonth,totalUsersकोQuantity, औरgameTypeवregionकोCategoryके रूप में specify किया जाता है Line Chartमेंregionको column,periodको x,totalUsersको y, औरgameTypeको color से bind करके region-wise monthly active users line chart बनाया जाता है
- example specification में
- npm के जरिए TypeScript / JavaScript environment में install किया जा सकता है
- agent workflows में MCP server इस्तेमाल किया जा सकता है
- gallery में 46 chart types और 83 examples देखे जा सकते हैं
specification को chart में बदलने का तरीका
- Flint compressed specification से शुरू करके Vega-Lite जैसे backend-native specifications generate करता है, और जरूरी low-level details भरकर chart render करता है
- semantic types data fields के meaning को express करते हैं
- examples में
Rank,YearMonth,Delta,Temperatureजैसे types शामिल हैं - Flint इनके आधार पर parsing, scale, axis, formatting और color scheme जैसी chart settings infer करता है
- games और months के हिसाब से net new users दिखाने वाले heatmap में time value parser, axis formatting, diverging color scheme और midpoint semantic types के आधार पर तय किए जाते हैं
- examples में
- automatic layout optimization elastic layout model और banking principle पर आधारित है
- compiler size, spacing और arrangement को dynamically manage करके chart को canvas में fit होने लायक adjust करता है
- grouped bar charts की संख्या बढ़ने पर यह canvas को बड़ा करता है और band width घटाता है, ताकि dense version भी canvas में fit हो सके
- chart design changes को chart type switching और visual encoding rebinding से handle किया जा सकता है
- 2000 की US Census के gender और age-wise population distribution वाले faceted bar chart को pyramid chart में बदलते समय, user सिर्फ chart type बदलता है और बाकी compiler संभालता है
rendering backends और उपलब्धता की स्थिति
- Flint Vega-Lite, ECharts, Chart.js में 46 chart types support करता है
- यह अलग-अलग APIs और programming models को unified interface के पीछे छिपाता है
- जब Vega-Lite में native sunburst न हो, तो ECharts पर switch किया जा सकता है
- region × gameType × game hierarchy visualization के लिए grouped bar chart की तुलना में sunburst chart को बेहतर विकल्प के रूप में पेश किया गया है
- Flint open source है और तुरंत इस्तेमाल किया जा सकता है
- शुरुआत के लिए GitHub और gallery examples उपलब्ध हैं
- Microsoft Research ने IDEAS Lab और Renmin University of China के साथ मिलकर Flint बनाया है
1 टिप्पणियां
Hacker News की राय
“AI agents के लिए” वाली marketing क्यों ज़रूरी है, यह समझ आता है, लेकिन आखिरकार यह सिर्फ़ charts को व्यक्त करना आसान बनाने वाली भाषा है—इतना ही इसे काफ़ी प्रभावशाली और उपयोगी बनाता है
पेज पर भी लिखा है कि “scale, axis, spacing, layout जैसे verbose low-level parameters मांगने के बजाय, Flint compiler data, semantic types, chart types और encodings से optimized chart configuration निकालता है”
agent systems में एक नया pattern उभर रहा है, और यह project उसका अच्छा example है
तरीका यह है कि LLM द्वारा generate करके पास की जाने वाली किसी intermediate representation (IR) को रखा जाए, और उसके ऊपर compiler या code generator जैसी deterministic layer लगाई जाए। निकट भविष्य में ऐसी संरचना ज़्यादा देखने को मिलेगी लगता है
पेज पर नहीं है, लेकिन data visualization बनाते समय accessibility को design stage में शामिल करना सच में महत्वपूर्ण है
इस podcast में इससे जुड़ा छोटा interview अच्छी तरह summarize किया गया है: https://open.spotify.com/episode/18dHTAxCCeIaLOTch6tRld
interviewee Frank Elavsky हैं, जो इस field में काफ़ी प्रसिद्ध लगते हैं, और उन्होंने accessibility audit के लिए heuristics, principles और guidelines वाला Chartability project भी बनाया है: https://chartability.github.io/POUR-CAF/
tracking के लिए issue add किया है: https://github.com/microsoft/flint-chart/issues/48
उत्सुक हूं कि क्या कोई ठोस explanation है कि यह Vega से कैसे बेहतर या अलग है: https://vega.github.io/vega/docs/specification/
Vega पहले से ही visualization के लिए expressive DSL है, और लगता है LLM training data में भी काफ़ी व्यापक रूप से शामिल होगा
Flint higher-level abstraction है, इसलिए spec कहीं ज़्यादा छोटी और सरल है, और compiler low-level decisions निकालकर अच्छा दिखने वाला chart बनवाता है। यानी जिन अच्छे charts के लिए पहले लंबा program चाहिए था, उन्हें agent छोटे program से बना सकता है
“सरल chart specs stable हो सकते हैं, लेकिन system defaults पर निर्भर होने से generated charts की quality कम होती है; complex specs अच्छे दिखने वाले charts बना सकते हैं, लेकिन वे verbose होते हैं, इसलिए agents के लिए उन्हें reliably handle करना मुश्किल है”—इस दावे से बहुत ज़्यादा सहमत नहीं हूं
analysis agents बनाने के थोड़े-से work experience में यह प्रभावशाली लगा कि LLMs Python और R में visualizations काफ़ी अच्छी तरह बनाते हैं। छोटे open-weight models भी ऐसे ही थे, और ambiguous हिस्सों को थोड़ा iterate करके refine करने पर अक्सर कमियां खत्म हो जाती थीं। सोच रहा हूं कि क्या इस दावे को support करने वाली, या problem points दिखाने वाली कोई research line है
निजी तौर पर Claude और ChatGPT ggplot models अच्छे generate करते हैं, लेकिन customization बढ़ने पर चीज़ें थोड़ी complex हो जाती हैं
“स्केल, axis, interval, layout जैसे लंबे-चौड़े low-level parameters” वाला वर्णन देखकर लगता है कि Microsoft दो अलग-अलग चीज़ों को मिला रहा है
LLM इस बात की ज़्यादा परवाह नहीं करता कि code low-level और verbose है या नहीं; वह assembly या SPIR-V भी अच्छी तरह पढ़ सकता है। असली समस्या visual composition है। LLM इंसानों से अलग तरीके से “देखता” है, इसलिए visual comparison के ज़रिए spatial composition समझना उसके लिए स्वाभाविक नहीं है, और इसे bypass करने के लिए code के रूप में visualization जैसी ऐसी representation देनी होगी जिसे LLM आसानी से reason और समझ सके। यानी बस structure ऐसा न हो जो बहुत deeply nested हो या जिसमें hidden state infer करना पड़े
साथ ही Flint का JSON में string keys के इर्द-गिर्द types संभालने का फैसला भी मानना मुश्किल है। असली spec देखें तो इसे सीधे इंसानों के लिए लिखने में आसान TypeScript library भी बनाया जा सकता था, और शायद वह कहीं बेहतर होता। बाद में source असल में देखने पर यह सिर्फ docs देखकर बनाए गए मेरे assumed mockup से कहीं ज़्यादा complete और sophisticated निकला, लेकिन “string-key JSON बनाम असली generic authoring surface” वाली core शिकायत अब भी बनी हुई है
chartTypeवाला हिस्सा मुझे उतना elegant नहीं लगता, क्योंकि templates को और extensible होना चाहिए। इस हिस्से में सुधार चाहिएबाकी हिस्सों में visualization या diagram libraries में JSON इस्तेमाल करना काफी आम है, क्योंकि इसे अलग-अलग rendering contexts में आसानी से ले जाया जा सकता है
संबंधित लेख: https://www.openui.com/blog/stop-making-ai-write-json
LLM predictability बढ़ाने वाले custom DSL में मेरी रुचि है, और अच्छा लगा कि Microsoft जैसा दिग्गज भी इसे समझता दिख रहा है। https://slangify.org/examples में Contacts example VCARD और JCARD के बीच round-trip conversion करते हुए अपना DSL आसानी से बनाने का तरीका दिखाता है
“यह ऐसे visual decisions को explicit करवाता है जिन्हें एक अच्छे compiler को handle करना चाहिए” वाला वर्णन देखकर लगता है कि क्या Graphviz भी इसी वजह से नहीं है
Declarative language के रूप में JSON का इस्तेमाल देखकर, यह मान भी लें कि LLM JSON अच्छे से handle करते हैं, फिर भी यह इंसानों के consume करने के लिए अच्छी syntax नहीं है
Flint को जानबूझकर इस तरह design किया गया है कि agent scale, axis, zero baseline, step size जैसे low-level parameters को skip कर सके। अच्छे दिखने वाले charts के लिए ये elements बहुत महत्वपूर्ण होते हैं, और compiler इन्हें dynamically optimize करता है। इसलिए AI agent के लिए इसे handle करना आसान हो जाता है
semantic types को additional formatting element के रूप में इस्तेमाल करना बहुत उपयोगी है, क्योंकि यह बहुत सारे formatting boilerplate को compact तरीके से encode कर देता है
जानना चाहूँगा कि क्या Flint type registry को share करने या extensible बनाने की कोई योजना है। यह भी उत्सुकता है कि इसे सीधे data attribute के रूप में क्यों नहीं रखा गया। Vega-Lite के ऊपर higher-level connected charts बनाते समय मैं लगभग इसी तरह की spec तक पहुँचा था
इस project का point मुझे ठीक से समझ नहीं आ रहा। GPT-3.5 के समय से ही LLM matplotlib को एक ही बार में generate कर सकते थे, ऐसा लगता है
मैंने data visualization के लिए LLM का काफी इस्तेमाल किया है, लेकिन कोई खास समस्या नहीं आई। जानना चाहूँगा कि agent को visualization generation में specifically कहाँ दिक्कत आती है, और Flint उसे कैसे solve करता है
लेकिन इसे end users के लिए किसी tool में डालें, तो अच्छे दिखने वाले charts generate करने की 80% success rate बड़ी समस्या बनने लगती है। Data analysis system बनाते समय मैंने यह अनुभव किया। matplotlib या Vega-Lite को सीधे generate करवाने पर reliability, expressiveness, cost time और tokens—इन सबको साथ हासिल करना मुश्किल होता है, इसलिए इस language को इस trade-off के रूप में design किया गया कि कुछ decisions compiler पर shift कर दिए जाएँ, ताकि generation cost घटे और expressiveness बनी रहे
Project page: https://microsoft.github.io/flint-chart/
MCP setup: https://microsoft.github.io/flint-chart/#/mcp