app icon
DataFocus
0.0.5

Two plugins,One is the Hallucination controllable Text2SQL component,the other is the fast response ChatBI.

joto/datafocus4178 installs

English

Overview

DataFocus includes two tools, FocusSQL and FocusGPT. FocusSQL is the Hallucination controllable Text2SQL component,FocusGPT is the fast response ChatBI.

There are already so many Text-to-SQL frameworks. Why do we still need another one?

In simple terms, FocusSQL adopts a two-step SQL generation solution, which enables control over the hallucinations of LLM and truly builds the trust of non-technical users in the generated SQL results.

Below is the comparison table between FocusSQL and others:

Comparison Analysis Table

Here’s a side-by-side comparison of DataFocus plugin with other LLM-based frameworks:

FeatureTraditional LLM FrameworksFocusSQL
Generation ProcessBlack box, direct SQL generationTransparent, two-step (keywords + SQL)
Hallucination RiskHigh, depends on model qualityLow, controllable (keyword verification)
SpeedSlow, relies on large model inferenceFast, deterministic keyword-to-SQL
CostHigh, requires advanced modelsLow, reduces reliance on large models
Non-Technical User FriendlinessLow, hard to verify resultsHigh, easy keyword checking

The following will introduce how to configure and an example demonstration.

1. Apply for DataFocus Token

If you don't have the DataFocus application yet, please apply for one on the DataFocus Website.
Log in to your DataFocus application. Click Admin > Interface Authentication > Bearer Token > New Bearer Token, to create a new token and get the token value.

If you have a DataFocus private deployment environment, you can get Token on your own environment.

2. Fill in the configuration in Dify

Install DataFocus from Marketplace and fill token and host in the authorization page.Token is the value obtained in the previous step.If you have a DataFocus private deployment environment, host is your environment host. Otherwise, the SAAS environment address can be used by default.

3. Use the tool

DataFocus includes two tools, FocusSQL and FocusGPT.

FocusSQL

FocusSQL is a natural language to SQL plugin based on keyword parsing.

Output Variable JSON
NameTypeDescription
contentstringGenerated SQL statements
questionstringGenerated keywords
typestringReturn type

Output Example

FocusGPT

FocusGPT is an intelligent query plugin that supports multiple rounds of conversations, which allow you query data from your database.
FocusGPT not only can return query SQL but also return query result to you.

Output Variable JSON
nametypeDescription
codenumberStatus code
columns[[object]]Two-dimensional array storing query results
countnumberNumber of rows returned
durationstringQuery execution time, in seconds (s)
headers[object]Column header information for the two-dimensional array columns
» displaystringDisplay name of the column header
» namestringOriginal column name of the header
» sufstringPrefix of the column header, indicating aggregation method
sql[object]SQL corresponding to the query data
»select_clausestringSQL corresponding to the query data
titlestringKeywords generated from parsing

Output Example

Configuration

FocusSQL and FocusGPT have similar configuration. Below are the functions and usage instructions of each parameter

ParameterDescription
LanguageLanguage environment, only support Chinese and English
Query StatementNatural language input by users
Table NameTarget data table for query
Data ModelCustom model parameter entry
Output SQL TypeOutput SQL Type
Conversation IdUnique identifier of the session, which allow tool identify and maintain session state
ActionThe behavior of tool execution currently includes two types: obtaining table lists and dialogues
Datasource TypeTypes of external data sources connected. If datasource type was selected, the connection parameters below need to be filled in
Hosthost
Portport
DB useruser
DB Passwordpassword
Database Namedatabase name
JDBCJDBC
SchemaSchema name

Model Parameters

The data model needs to pass in a JSON string, and the structure of the model is as follows

Structure
NameTypeRequiredDescription
typestringYesDatabase type
versionstringYesDatabase version, eg: 8.0
tables[object]YesTable structure list
» tableDisplayNamestringNoTable display name
» tableNamestringNoOriginal table name
» columns[object]NoColumns structure list
»» columnDisplayNamestringYesColumn display name
»» columnNamestringYesOriginal column name
»» dataTypestringYesColumn data type
»» aggregationstringYesColumn default aggregation
relations[object]YesAssociation relationship list
» conditions[object]NoAssociated conditions
»» dstColNamestringNoDimension original column name
»» srcColNamestringNoFact original column name
» dimensionTablestringNoDimension original table name
» factTablestringNoFact original table name
» joinTypestringNoAssociation type
Parameter values
type
DataBaseValue
MySQLmysql
ClickHouseclickhouse
Impalaimpala
dataType
DataTypeValue
Booleanboolean
Integerint
Long integerbigint
Floatdouble
Stringstring
Timestamptimestamp
Date typedate
Time typetime
aggregation
AggregationValue
SumSUM
MeanAVERAGE
MinMIN
MaxMAX
CountCOUNT
Number of deduplicatesCOUNT_DISTINCT
VarianceVARIANCE
Standard deviationSTD_DEVIATION
NoneNONE
joinType
AssocationValue
Left associationLEFT JOIN
Right associationRIGHT JOIN
InternalINNER JOIN
Fully associativeFULL JOIN
Example

model

Consult

WeChat: datafocus2018

DataFocus Discord

CATEGORY
Tool
VERSION
0.0.5
joto·04/26/2025 07:41 AM
REQUIREMENTS
Tool invocation
App invocation
Endpoint registration
Maximum memory
256MB
Maximum storage
1MB