The AI Assistant

ChakataStat has a built-in assistant that can run analyses on your behalf when you describe what you want in plain language. It is not a separate chatbot bolted on — it drives the same engine the menus do, so anything it produces is a real ChakataStat result you could have run yourself.

Open the panel with View → AI Assistant (Ctrl+Shift+A); it docks on the right of the workbench.

Connecting a model backend

The assistant needs a model to talk to. ChakataStat is provider-neutral and works with:

  • Claude (Anthropic);
  • any OpenAI-compatible endpoint — OpenAI itself, DeepSeek, Kimi (Moonshot AI), a local Ollama server, or other compatible providers and proxies.

You supply an API key through an environment variable before launching, and a local endpoint needs no key. The recognized variables are:

Variable Backend
ANTHROPIC_API_KEY Claude (Anthropic)
DEEPSEEK_API_KEY DeepSeek
OPENAI_API_KEY OpenAI
MOONSHOT_API_KEY Kimi (Moonshot)
ChakataStat_OLLAMA=1 local Ollama (no key)

These exact names are also listed under Settings → AI Assistant → Environment variables, each marked set or unset, so you can confirm you set the key under the name the app reads. The key is used in memory only — it is never written to disk or into your session.

Which model each backend uses

Setting a key is enough: each backend comes with a current default model, so there is nothing to choose unless you want to.

Backend Default model
Claude (Anthropic) claude-opus-5
OpenAI gpt-5.6
DeepSeek deepseek-chat
Kimi (Moonshot) kimi-latest
Ollama (local) llama3.1

To use a different one, set the model id under Settings → AI Assistant, or the ChakataStat_AI_MODEL environment variable — either overrides the default for whichever backend is active.

Two notes if you do override it. Recent Claude and OpenAI models no longer accept a sampling temperature; ChakataStat leaves the setting out of the request for those models rather than let it fail the whole message, so a temperature you set will simply have no effect there. And current models may reason before they answer, out of the same maximum response tokens budget as the reply itself — so if you lower that setting a long answer can run out of room mid-sentence.

One more, for the OpenAI backend specifically: on the GPT-5 family ChakataStat asks for no reasoning pass on its requests. Those models refuse a request that carries function tools together with their default reasoning setting, and the assistant's every message carries the tools — so without this every message would fail. The model still answers and still runs tools; it does so without its private deliberation step. (Found, and fixed, by running the assistant against the live service — 0.22.0.)

Choosing among several backends

If you have more than one backend configured, you can pick and switch the active one live from Settings → AI Assistant, and your choice is remembered between launches (the choice — never the key). The Settings page also exposes optional overrides: the model id, temperature, maximum response tokens, a custom base URL and headers, the tool-round cap, a system-prompt override, and the read-only toggle (on by default — see below). The custom base URL and headers are stored in plain text in your session file, so keep API keys in their environment variable, never in a header.

Asking for an analysis

Type what you want in the panel's input box, for example:

  • "Show me descriptive statistics for age, BMI and systolic BP."
  • "Is fasting glucose different between diabetic and non-diabetic participants?"
  • "Run a logistic regression predicting hypertension from age and BMI."

The assistant chooses the right procedure, runs it through the engine, and shows the actual result tables and charts inline in the conversation — the same output you would get from the menus.

Answers stream in as they are written rather than appearing all at once, so a long reply starts reading immediately. Per-reply token usage is shown beneath each answer; where the backend was able to reuse a cached copy of the unchanging part of the request, the line names that share too (for example 9,152 tokens · 9,140 in (9,000 cached) / 12 out). Cached input is charged at a fraction of the usual rate, so a long conversation on one dataset costs far less per message than the raw totals suggest.

Explaining a result you already have

The assistant sees your data, not your output. A result you ran from the menus is invisible to it — so asking "what does that table mean?" in the panel would, at best, make it run the analysis again to find out.

Every card in the Output tab therefore carries an Ask the assistant about this button (the ✨ icon in the card's header, beside Remove). It hands that one result to the assistant and opens the panel if it is closed. The explanation comes back in plain language, and nothing is re-run — the numbers you are shown are the numbers you already had.

It works on charts as well as tables, and charts are where it earns its keep: a histogram or a scatterplot cannot be read back off the screen, so this is the only way the assistant learns what was drawn.

Two things worth knowing:

  • The button appears only when a model backend is connected. If you do not see it, no API key was found — see Connecting a model backend above.
  • It works the same under read-only mode (the default). Asking for an explanation grants the assistant nothing new: the result is sent as part of your message, rather than by giving it a way to reach into your output.

A very large result — a frequency table over thousands of distinct values, say — is sent as its opening section rather than in full, and the assistant is told that is what it is looking at.

Adding context about your data

The assistant sees your variable names, types and labels, so well-defined variables (see Working with Data) make it far more accurate. You can also add custom context in Settings — a note describing your study, your coding conventions, or what you are trying to find out — which is sent with each request so the assistant interprets your data correctly.

What it can and cannot do

  • It can run any analysis, chart or transform exposed as a tool — subject to the read-only switch.
  • Read-only is the default. Out of the box the assistant can run analyses and draw charts but cannot change your data — neither the transforms (sort, compute, rank, …) nor an analysis's save columns options (saved clusters, residuals, scores, …), which are withheld from it and refused if it names one anyway — a safe way to let it explore. To let it transform your dataset, click the Read-only chip in the panel's header (it becomes Full access; click again to go back) or use the switch under Settings → AI Assistant. Every change it then makes is an ordinary command — journaled, undoable and visible in the Syntax console.

Reproducibility

The assistant's actions are commands like any other, so they appear in the Syntax console and can be reviewed, edited and replayed. The conversation itself persists with your session, so closing and reopening ChakataStat keeps the thread (you can start fresh with the panel's New conversation button).

Privacy

When you use a hosted backend, your prompts — including the data context you add and the result summaries — are sent to that provider. Use a local Ollama endpoint if the data must not leave your machine. No API key is ever stored by ChakataStat — but the custom base URL and headers you set under Settings → AI Assistant are stored, in plain text, in your session file; never put a key in a header, use the environment variable.