AI Features: overview
FileDB isn't just a SQL engine with a built-in HTTP API — on top of it sits a set of AI features that work with any chat-completions-compatible LLM provider (OpenAI and OpenAI-compatible proxies, plus Voyage/Gemini/Yandex separately for embeddings). Everything is a plain JSON HTTP endpoint — no SDK, no extra dependencies in the engine itself.
| Feature | Endpoint | What it does |
|---|---|---|
| AI Chat | POST /api/ai/chat |
Conversational SQL assistant: replies with text and suggests SQL blocks, never runs them itself |
| AI Chat (stream) | POST /api/ai/chat/stream |
Same thing, streamed |
| AI Agent | POST /api/ai/agent |
Multi-turn read-only agent with tool calling — explores schema and data on its own |
| Smart Export | POST /api/ai/sql-suggest |
Natural-language description → a ready SELECT for export |
| AI import mapping | POST /api/import/ai-suggest |
Suggests a column mapping between the uploaded file and the target table |
| Embeddings | /api/embed/* |
Vectorizes table rows, semantic (meaning-based) search |
| Hybrid search | POST /api/vector/search |
Semantic search combined with a SQL WHERE filter in one call |
One provider for the conversational features
AI Chat, AI Agent and Smart Export share one global named preset for the /chat/completions connection — configured once in the web UI and reused by all three. Details on the "AI setup: providers and presets" page.
Embeddings — configured per database
Unlike chat, the embeddings configuration (provider, model, key) is stored separately for every .fdb file — vectors are tightly coupled to whatever produced them, so different databases on the same server can use different embedding providers.
Safe by default
None of the AI features can silently damage data:
- The AI Agent is read-only — only
list_tables,describe_table, andrun_selectexist as tools; there is no DML/DDL tool for it to call, and an iteration cap (default 6) keeps it from running away. - AI Chat and Smart Export never execute SQL themselves — the model proposes code, the operator explicitly clicks "Run" after reviewing/editing it.
- AI import mapping quietly falls back to heuristic name-matching if the LLM is unavailable (no key, network failure, malformed reply) — import never breaks because AI is down.
More detail on the "AI Chat and AI Agent", "Smart Export and AI Import Mapping", "Embeddings and Hybrid Search", and "AI setup: providers and presets" pages.