跪拜 Guibai
← All articles
Agent · Data Visualization · Data Analysis

A BI Developer Bolted a Natural-Language AI Assistant Onto SmartBI in One Day Without Writing a Single Line of Frontend Code

By Homi ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Internal BI tools are notoriously hard to extend, and most teams lack the frontend bandwidth to build chat interfaces from scratch. A platform that handles the UI, streaming, auth, and deployment reduces the job to writing two API-calling functions, which means a single data engineer can ship a working AI assistant in hours instead of waiting for a full-stack sprint.

Summary

A BI developer who was tired of writing the same SQL queries for business users every day built a natural-language data assistant for SmartBI in one day. The entire project used EdgeOne Makers, a platform that auto-generates the chat UI, session memory, streaming output, and deployment pipeline. Only two Python tools were needed: one to list datasets and one to query them via SmartBI's REST API.

The assistant was embedded as a floating window using a bookmarklet, avoiding any modification to the SmartBI source code and bypassing strict Content Security Policies that blocked Tampermonkey scripts. The developer hit ten specific pitfalls during the build, including Windows GBK encoding errors, SmartBI field-name suffixes, iframe cross-origin blocking, and crypto API failures on HTTP intranets, and documented the fix for each.

A six-month sample sales dataset was loaded to test queries like total sales and regional rankings. After local testing, a single CLI command deployed the agent to a public URL, making it available company-wide. The developer estimates the same project would have taken three days without the platform's scaffolding.

Takeaways
EdgeOne Makers auto-generates a chat UI, session memory, streaming output, and tool-calling framework from a template, so no frontend code is needed.
Only two Python tools were required: list_datasets to discover available data models and query_dataset to fetch rows via SmartBI's augmented query API.
SmartBI measure fields require a _m suffix in API calls; using the raw SQL column name causes 'field does not exist' errors.
The assistant was injected as a bookmarklet rather than a Tampermonkey script because SmartBI's Content Security Policy blocked script injection.
A transparent drag mask over the iframe was necessary to make JS-based window resizing work, since cross-origin iframes intercept mouse events.
Windows users must set PYTHONUTF8=1 before starting the dev server, or emoji output triggers a GBK encoding crash.
On HTTP intranets, window.crypto.randomUUID is undefined; a polyfill in index.html fixes the resulting chat-interface error.
Deployment to a public URL took one command (edgeone makers deploy) and about one minute, making the assistant available company-wide.
Conclusions

The bookmarklet injection pattern is a pragmatic workaround for locked-down enterprise apps: it requires no install, no source access, and no security-policy changes, yet delivers a persistent floating UI.

SmartBI's API design choice to suffix measure fields with _m is undocumented behavior that would break any agent relying on SQL column names; the fix is trivial once discovered but easy to miss.

EdgeOne Makers collapses the traditional three-day full-stack build into a single-day backend task, but the real time-saver isn't the UI generation — it's the pre-built SSE streaming and tool-calling loop that most internal tools lack.

The ten documented pitfalls are mostly environment-specific (Windows encoding, HTTP crypto, CSP policies) rather than logic bugs, which suggests the platform itself is stable but the surrounding enterprise infra is where time gets lost.

Concepts & terms
EdgeOne Makers
A Tencent Cloud platform that provides templates for building AI agent applications with auto-generated chat UIs, session memory, streaming output, and one-click deployment, targeting developers who want to skip frontend and infrastructure work.
Bookmarklet
A bookmark containing JavaScript code that runs in the context of the current page when clicked. Used here to inject a floating chat window into SmartBI without modifying its source code or installing browser extensions.
SmartBI Augmented Query API
A REST endpoint in SmartBI that accepts a dataset ID and a list of field names, returning row data. Field names for measures differ from SQL column names and require a _m suffix.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗