Skip to content

Commit 7bab72d

Browse files
committed
Update Kai assistant documentation: remove outdated sections, enhance best practices for new users, and streamline troubleshooting guidance. Revise navigation structure to reflect changes in content organization.
1 parent d410ce3 commit 7bab72d

File tree

10 files changed

+145
-814
lines changed

10 files changed

+145
-814
lines changed

.playwright-mcp/kai-chat-panel.png

455 KB
Loading
597 KB
Loading

.playwright-mcp/kai-welcome.png

455 KB
Loading

_data/navigation.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -743,9 +743,6 @@ items:
743743
- url: /ai/kai-assistant/best-practices/
744744
title: Best Practices
745745

746-
- url: /ai/kai-assistant/technical/
747-
title: Technical Details
748-
749746
- url: /ai/mcp-server/
750747
title: MCP Server
751748

ai/kai-assistant/best-practices.md

Lines changed: 41 additions & 260 deletions
Original file line numberDiff line numberDiff line change
@@ -6,293 +6,74 @@ permalink: /ai/kai-assistant/best-practices/
66
* TOC
77
{:toc}
88

9-
This guide helps you leverage Kai as a high-impact team member. Learn how to communicate effectively, structure your workflows, and get the most value from your AI assistant.
9+
## Effective Prompting
1010

11-
## Understanding How Kai Works
11+
### Provide Business Context
1212

13-
Before diving into best practices, it's important to understand what makes Kai different from generic AI tools.
13+
Kai knows your schema but not your business rules. Include domain context for better results.
1414

15-
### Context Awareness
16-
Kai can "see" your Keboola project—table schemas, transformation logic, job logs, and component configurations. When you ask about an error, it doesn't guess based on syntax; it reads the actual state of your project and proposes fixes based on what's actually there.
15+
| Weak | Strong |
16+
|------|--------|
17+
| "Calculate Q3 revenue" | "Calculate Q3 revenue from `orders` where `status = 'completed'`, excluding VAT in `tax_amount`" |
18+
| "Show customer churn" | "Calculate monthly churn from `subscriptions` where `end_date` is not null and `churn_reason` != 'upgrade'" |
1719

18-
### Agent Behavior
19-
Kai is an agent, not just a chatbot. For complex requests, it executes multi-step reasoning: configuring extractors, writing transformations, and setting up writers—asking for your approval at key stages.
20+
**Pro tip:** Have Kai update your table metadata with business definitions—future queries benefit automatically.
2021

21-
### Approval-Based Actions
22-
Every action that changes your project requires explicit consent. You'll see exactly what Kai wants to do before it executes.
22+
### Plan Before Building
2323

24-
## Effective Prompting Strategies
24+
For complex tasks, ask Kai to outline its approach first:
2525

26-
### Lead with Business Context
27-
28-
Kai knows your schema but not your business rules. The most successful interactions include domain context.
29-
30-
| Weak Prompt | Strong Prompt |
31-
|-------------|---------------|
32-
| "Calculate Q3 revenue." | "Calculate Q3 revenue from `orders`. Revenue = `total_amount` for orders where `status = 'completed'`, excluding VAT (stored in `tax_amount`)." |
33-
| "Show me customer churn." | "Calculate monthly churn rate from `subscriptions`. A churned customer is one whose `end_date` is not null and `churn_reason` is not 'upgrade'." |
34-
35-
**Pro tip:** Have Kai update your table and column metadata with business definitions. Future queries will benefit from this context automatically.
36-
37-
### Plan Before You Build
38-
39-
For complex tasks—pipeline construction, data modeling, multi-step transformations—ask Kai to outline its approach first. Planning upfront catches architectural errors early.
40-
41-
**Example:**
4226
```
43-
"I need to build a customer lifetime value model using data from Shopify and our CRM.
44-
First, outline which tables you'll use, how you'll join them, and what the output
45-
schema will look like. Don't execute anything yet."
27+
"I need to build a customer lifetime value model. First outline which tables you'll use and how you'll join them. Don't execute anything yet."
4628
```
4729

48-
### Iterate Like You Would with a Junior Engineer
30+
### Iterate
4931

50-
Don't expect production-ready code on the first turn. The most effective conversations follow a pattern:
32+
Don't expect production-ready code on the first try:
33+
1. Request initial approach
34+
2. Review output
35+
3. Refine: "Now optimize the join, add null handling, and include comments"
5136

52-
1. **Request**: Ask for the initial approach
53-
2. **Review**: Examine the output
54-
3. **Refine**: "Good start. Now optimize the join to avoid fan-out on `users`, add error handling for null values, and include comments explaining the business logic."
55-
56-
### Be Specific About What You Want
57-
58-
Reference component IDs, table names, and configuration names directly. Vague requests produce vague results.
37+
### Be Specific
5938

6039
| Vague | Specific |
6140
|-------|----------|
62-
| "Fix the extractor" | "Analyze the latest job failure for config `keboola.ex-shopify` (ID: 12345) and identify why the `refunds` endpoint is timing out." |
63-
| "Document this" | "Generate documentation for the `tr-customer-metrics` transformation. Target audience: new team members who need to understand the business logic, not just the SQL syntax." |
64-
65-
## Task-Specific Guidance
66-
67-
### Data Analytics & Exploration
68-
69-
Analytics represents the most common use of Kai. These queries work best when you:
70-
71-
- **Specify the output format**: "Return results as a table with columns for month, revenue, and year-over-year change."
72-
- **Set boundaries**: "Analyze the last 12 months only" prevents runaway queries.
73-
- **Verify the source**: Before trusting results, ask: "Which tables are you querying and how are you joining them?"
74-
75-
**Example workflow:**
76-
1. "What tables do we have related to customer orders?"
77-
2. "Show me the schema for `orders` and `customers`."
78-
3. "Calculate average order value by customer segment for Q3, excluding test accounts (where `email` contains 'test')."
79-
80-
### Integration Setup & Configuration
81-
82-
Integration tasks are the second most common use case. Tips:
83-
84-
- **Start with what exists**: "List all configured extractors in this project" before creating new ones.
85-
- **Be explicit about auth**: "Configure the Shopify extractor using API key authentication. I'll provide the credentials when you're ready."
86-
- **Request common packages**: "Add the pandas package to the Python transformation environment."
87-
88-
### SQL & Python Transformations
89-
90-
Coding tasks work best with:
91-
92-
- **Dialect awareness**: Kai automatically adjusts for Snowflake vs. BigQuery, but specifying your backend ("We're on Snowflake") eliminates ambiguity.
93-
- **Incremental builds**: For complex transformations, build in stages: "First, create the staging table. Then we'll add the business logic."
94-
- **Conversion requests**: "Convert this Python transformation to SQL" is a common, well-handled task.
95-
96-
### Troubleshooting Failed Jobs
97-
98-
Error debugging works best when you point Kai to specifics:
99-
100-
```
101-
"Job 789012 failed. Read the event log, identify the root cause,
102-
and check if the transformation configuration has a syntax error
103-
or schema mismatch causing this."
104-
```
41+
| "Fix the extractor" | "Analyze job failure for config `keboola.ex-shopify` (ID: 12345)—why is the refunds endpoint timing out?" |
42+
| "Document this" | "Document transformation `tr-customer-metrics` for new team members, focusing on business logic" |
10543

106-
Kai will read the actual log (more efficient than pasting thousands of lines) and trace the error to its source.
44+
## Development Workflow
10745

108-
### Documentation Generation
46+
### Use Dev Branches
10947

110-
Kai excels at documentation, but audience matters:
48+
Test changes safely by creating a development branch in the Keboola UI, then working with Kai in that branch. Review changes before merging to production.
11149

112-
- **For business users**: "Describe the `monthly_kpis` table focusing on what each metric means for marketing, not the SQL types."
113-
- **For engineers**: "Document this transformation including input/output schemas, logic summary, dependencies, and any edge cases handled."
50+
### Manage Context
11451

115-
### Data Apps & Dashboards
52+
- **One topic per chat** — don't mix unrelated tasks
53+
- **Reset when stuck** — if Kai gets confused after 2-3 tries, start fresh with clearer context
54+
- **Let Kai read logs** — instead of pasting, use `"Read the latest job log for ex-google-analytics"`
11655

117-
Creating Streamlit dashboards tends to be high-complexity work. Break it down:
118-
119-
1. "I want a sales dashboard. What data would you need?"
120-
2. "Create the data query that powers the dashboard—monthly revenue by product category, filterable by region."
121-
3. "Now build the Streamlit app with a date picker and bar chart visualization."
122-
123-
## Development Workflow Best Practices
124-
125-
### The Dev Branch Workflow
126-
127-
Kai has write access to your project. Use development branches to test changes safely.
128-
129-
**Step 1: Isolate**
130-
```
131-
"Create a development branch named 'kai-shopify-refunds-update'."
132-
```
133-
134-
**Step 2: Build & Test**
135-
```
136-
"In this dev branch, modify the Shopify extractor to include the 'refunds' endpoint."
137-
```
138-
139-
Run the job in the dev branch. Verify the data looks correct.
140-
141-
**Step 3: Review & Merge**
142-
143-
Before merging to production:
144-
- Check for hardcoded values that should be variables
145-
- Verify naming conventions match your project standards
146-
- Confirm the logic handles edge cases
147-
148-
Only merge once you're satisfied with the results.
149-
150-
### Managing Context & Performance
151-
152-
Kai has a context window. Long conversations (50+ messages with complex operations) can degrade performance.
153-
154-
#### One Topic, One Chat
155-
156-
Don't mix unrelated tasks in a single thread. Debugging a Python transformation and analyzing sales trends should be separate conversations.
157-
158-
#### Know When to Reset
159-
160-
If Kai starts circling around an error or getting confused:
161-
162-
1. Copy any useful code it generated
163-
2. Start a fresh chat
164-
3. Provide focused context: "I'm working on [specific task]. Here's the current code: [paste]. Help me fix this specific error: [error message]."
165-
166-
#### Let Kai Read Logs Directly
167-
168-
Instead of pasting massive error logs, ask Kai to read them:
169-
170-
```
171-
"Read the latest job log for `ex-google-analytics` and identify the error."
172-
```
173-
174-
This uses Kai's tools to access logs directly—far more efficient than pasting text.
175-
176-
#### For Very Complex Projects
177-
178-
The most sophisticated conversations can span 15-20 turns and use 10+ tools. For these:
179-
180-
- Break work into discrete phases
181-
- Confirm completion of each phase before proceeding
182-
- Consider creating a brief "project brief" document that Kai can reference
183-
184-
## Security & Governance Best Practices
185-
186-
### Safe Secrets Management
56+
## Security
18757

18858
**Do:**
189-
- Use: "I'll provide the API key when you prompt me for configuration"
190-
- Let Kai handle secrets securely through the configuration interface
59+
- Say "I'll provide the API key when you prompt me" and let Kai handle credentials through the secure configuration interface
60+
- Review every tool approval before confirming
61+
- Use dev branches for testing
19162

19263
**Don't:**
193-
- Paste credentials in plain text in chat messages
194-
195-
### Tool Approval Process
196-
197-
**Always:**
198-
- Read what Kai wants to do before confirming
199-
- The tool approval prompt shows exactly what will change
200-
- Use development branches for testing changes
201-
202-
**Never:**
203-
- Blindly approve actions without understanding them
204-
- Skip the approval step for "simple" changes
205-
206-
### Audit and Compliance
207-
208-
**Remember:**
209-
- All actions are logged in a complete audit trail
210-
- Organization administrators can see all agent actions
211-
- Use this transparency to democratize knowledge while maintaining oversight
64+
- Paste credentials in plain text
65+
- Blindly approve actions
66+
- Assume Kai knows about other projects (it only sees your current project)
21267

21368
## What to Avoid
21469

215-
### Don't Assume Cross-Project Knowledge
216-
Kai sees your current project. It doesn't know about data in other Keboola projects or external warehouses not connected to your flows.
217-
218-
### Don't Argue with a Confused Kai
219-
If it's not understanding after 2-3 clarifications, reset the conversation with clearer context.
220-
221-
### Don't Skip Verification
222-
Always verify Kai's suggestions, especially for:
223-
- Business logic implementation
224-
- Data quality rules
225-
- Security configurations
226-
- Production deployments
227-
228-
## Advanced Techniques
229-
230-
### Prompt Chaining for Complex Tasks
231-
232-
Break large requests into a sequence:
233-
234-
1. "Analyze our customer data structure and identify key metrics we should track"
235-
2. "Based on that analysis, design a customer health score calculation"
236-
3. "Now implement that as a SQL transformation"
237-
4. "Create a dashboard to visualize the health scores"
238-
239-
### Using Kai for Learning
240-
241-
Leverage Kai's explanatory capabilities:
242-
243-
```
244-
"Explain this SQL query step by step and suggest any optimizations"
245-
```
246-
247-
```
248-
"What are the best practices for this type of transformation in Keboola?"
249-
```
250-
251-
### Collaborative Documentation
252-
253-
Use Kai to maintain living documentation:
254-
255-
```
256-
"Update the project README to reflect the new customer segmentation logic we just implemented"
257-
```
258-
259-
## Team Collaboration
260-
261-
### Sharing Kai Insights
262-
263-
- **Document key solutions**: Save important code snippets and configurations Kai generates
264-
- **Share successful prompts**: Help teammates learn effective communication patterns
265-
- **Maintain context**: Keep project documentation updated so Kai has better context for everyone
266-
267-
### Training New Team Members
268-
269-
Use Kai to help onboard new team members:
270-
271-
```
272-
"Give a new data engineer an overview of this project's architecture and key components"
273-
```
274-
275-
## Measuring Success
276-
277-
### Track Your Efficiency Gains
278-
279-
- **Time to solution**: How quickly can you resolve issues with Kai's help?
280-
- **Code quality**: Are Kai's suggestions improving your implementations?
281-
- **Learning velocity**: How much faster are you picking up new Keboola features?
282-
283-
### Continuous Improvement
284-
285-
- **Use feedback buttons**: Rate Kai's responses to help improve the system
286-
- **Share challenging cases**: Help the development team understand edge cases
287-
- **Suggest improvements**: Your usage patterns help shape future capabilities
288-
289-
## Getting Help
290-
291-
When you need assistance with Kai itself:
70+
- **Don't argue with a confused Kai** — reset the conversation instead
71+
- **Don't skip verification** — always review business logic, data quality rules, and production deployments
72+
- **Don't expect cross-project knowledge** — Kai only sees your current project
29273

293-
- **In-chat feedback**: Use thumbs up/down buttons for immediate feedback
294-
- **Keboola Support**: For access issues or technical problems
295-
- **Community**: Join discussions in `#feature-kai-in-platform-assistant`
296-
- **Documentation**: Refer back to [Use Cases](/ai/kai-assistant/use-cases/) for specific examples
74+
## Team Tips
29775

298-
Remember: Kai is designed to be your data engineering partner. The more context you provide and the clearer you communicate, the more valuable it becomes to your workflow.
76+
- Save and share successful prompts with teammates
77+
- Use Kai to onboard new team members: `"Give a new engineer an overview of this project's architecture"`
78+
- Keep project documentation updated so Kai has better context for everyone
79+
- Use thumbs up/down buttons to provide feedback

0 commit comments

Comments
 (0)