Best practices
Learn best practices for designing agentic workflows: SQL-first logic, focused summaries, efficient Python use, bounded clarifications, and questions that guide intent.
When you build your own Missions, a few structural rules make the runs faster, more reliable, and easier to audit.
1. Start with data, end with story The first step in the workflow should be an SQL step that pulls the governed data at the right grain. The last step should turn the results into a story: the narrative, the drivers and the recommendations. In Tellius 6.4, new Missions end with a Rich Summary step by default, which builds a visual summary page. This pattern (SQL → … → Rich Summary) is what the planner expects. In releases before Tellius 6.4, the last step was a text Summary step, and older Missions keep it until you change it.
2. Put Python only where it’s needed If the logic can be done in SQL, do it there. Use Python steps only for things SQL cannot handle easily, such as changepoints, contribution/variance with volume weighting, cohorts/retention, forecasting, clustering, domain Python functions, and so on. This reduces retry loops and improves latency.
3. Keep to one summary step for each path Each Mission should produce one clear answer for each path it can take. A Mission without branches ends with one summary step that collects all findings. A branched Mission can end with its own summary or file for each path, so each branch reports its own finding.
4. Put the export details in the export step When a Mission produces a file, such as a PowerPoint deck or a PDF report, write its storyline, contents and design in the export step's instructions: the order of the story, the slides or sections and what each one shows, and the layout, colours and logos. Every run then produces the same file, and you change the file by changing one step. The export step's instructions come first. A custom skill, such as a house deck format, fills in only what the export step leaves open. To find out where a detail in a file came from, ask Kaiya, for example "Where did the logo on the cover come from?"
5. Design for the 10,000-row envelope Agentic runs currently fetch up to 10,000 rows per query. Build steps that aggregate early and avoid “give me everything” patterns. If more detail is needed, create a follow-up workflow for drilldown.
6. Clarification is bounded If the workflow asks the user for inputs and they don’t answer within the allowed number of clarification turns, Kaiya will still run the workflow with what it has or with defaults. Tell users that this is expected, not an error.
7. Plan for what a Mission can read A Mission reads its data from Business Views, Kaiya Context Models, connected systems and indexed documents. A scheduled run can't search the web, and Python steps can't call outside services. If a Mission needs outside data, bring it into one of those sources first.
Ask specific, well-defined questions
“Compare prescription performance between Q3 and Q4 2024 across top 5 districts” tells Kaiya the period, the measure, and the slice. Weak questions are vague.
“Analyze all prescription data” has no time window, no intent, and no segment, so the plan will be broad. Good questions also include intent.
“Identify top 3 underperforming regions in Q4 and recommend reallocation” tells Kaiya to produce an action, not just a chart. For example, a weak question like “Show me some charts” gives no business outcome.
Example workflows to model
Standard sales / cancellation deep dive Pull the base series (e.g. weekly cancellation). Pull the same measure by region/product/channel. Run Python to rank contributors. Summarize what changed, where, and who drove it. Output is trends, ranked drivers, and 1–2 charts.
Custom forecasting Load the registration/event data. Build the days-out framework. Calculate historical weights. Generate and backtest the forecast. Summarize with confidence bands and actions. This shows how to embed domain Python.
Risk assessment Validate the material. Retrieve SOP. Calculate risk factors. Produce a risk report with mitigation guidance. This shows how to combine clarification + SQL + Python + summary.
What you must do to trigger agentic runs
To run a Mission, ask Kaiya for it by name, and it runs straight away. A question that matches one of the Mission's trigger phrases brings up a Run saved mission question, so you can run the Mission now or have Kaiya answer directly. See Triggering a Kaiya Mission.
To run a Deep Insight, just ask. Kaiya runs one when it decides the question needs a multi-step plan. You can also select the Deep Insight tag under the ask box, or ask Kaiya for one. See Deep Insight.
If the dataset is on a source that agentic / text-to-SQL doesn’t support in that environment, the data must be available on a supported source (e.g. Snowflake, Redshift, ClickHouse) for the workflow to execute end-to-end.
Authoring conversationally
When building a Mission through the conversational interface, a few habits produce better step plans:
Lead with a complete brief. Describe the analysis, the slice, and the deliverable in one go. Kaiya drafts a tighter plan from a full brief than from a vague one.
Answer Kaiya's clarifying questions specifically. When Kaiya asks about period defaults, metric units, or how many items to surface, give concrete answers.
Run once before publishing. Execute the Mission against sample inputs to validate the output, and refine any step that needs adjusting, before exposing it to other users.
Declare runtime inputs rather than hard-coding. If a value changes per run (region, quarter, segment), let it be an input the Mission asks for, rather than fixing it in the step.
Keep older Missions current
Missions built before Tellius 6.4 keep working without changes. Two updates make them easier to use:
Replace the text Summary step with a Rich Summary step. Select Configure on the Mission's page and ask, for example "Replace the summary step with a rich summary." Check the draft's Visual summary, then publish.
Move export instructions into the export step. If a Mission's file looks different from run to run, write its storyline, contents and design in the export step.
Was this helpful?