Sections
Getting started
CLI flags & config
SQL
DDLDMLSELECTFunctions & expressionsTransactions
Clients
HTTP APINative driversPostgreSQL / MySQL wire protocolBinary RPC
Features
RBAC (multi-user)Embeddings (semantic search)File importBackupsDemo showcase mode and .fdb management
Operations
DeploymentArchitectureFileDB on Windows: tray and autostart
Reference
FileDB vs PostgreSQL / MySQL
AI
AI Features: overviewAI Chat and AI AgentSmart Export and AI Import MappingEmbeddings and Hybrid SearchAI setup: providers and presets
Dashboards
Dashboards: overviewDatasets and chartsNo-Code query builderDashboards AI assistantWidgets, grid and filtersPublic links and exportLayout, text cards and KPI comparison

Smart Export and AI Import Mapping

Smart Export: text → SQL

POST /api/ai/sql-suggest turns a natural-language description into a ready SELECT, using the same model as AI Chat/Agent:

curl -X POST $URL/api/ai/sql-suggest -H "X-Token: $TOK" -d '{
  "prompt": "All orders from the last month over 5000"
}'
{
  "sql": "SELECT * FROM orders WHERE created_at >= ... AND amount > 5000",
  "explain": "Filters orders from the last 30 days with amount over 5000"
}

Just like AI Chat, the endpoint never runs the query itself — the web UI shows the suggested SQL, the operator can edit it, and only then it's sent to /api/query; the result is serialized to CSV right in the browser. A model that hallucinates a DELETE instead of a SELECT can't delete anything on its own — a human always has to click "Run".

AI import mapping

When importing a file (/import — see the "File Import" page), POST /api/import/ai-suggest looks at the uploaded file's columns and 3–5 sample rows, compares them against the target table's columns, and suggests a source_col → target_col mapping, optionally with a transform expression (UPPER(value), CONCAT(...), etc.) — which pre-fills the mapping form.

The provider is whatever's configured for that database's embeddings (it reuses the api_key/base_url from the embeddings config — many OpenAI-compatible proxies expose both /v1/embeddings and /v1/chat/completions on the same key). The default model is gpt-4o-mini, overridable via ai_model_hint in the embeddings settings. Only OpenAI-compatible chat endpoints are supported today; AI column mapping isn't yet available for Yandex/Gemini.

Fault tolerance is built in by default: if the LLM isn't configured, unreachable, or returns a malformed response, mapping quietly falls back to the heuristic name-matching that existed before this feature. Import never blocks because of an AI problem.

Related pages
← Previous
AI Chat and AI Agent
Next →
Embeddings and Hybrid Search