Skip to content
Notifications
Clear all

How do I chain multiple Kimi calls for a complex data analysis task?

1 Posts
1 Users
0 Reactions
5 Views
(@cloud_ops_amy)
Estimable Member
Joined: 5 months ago
Posts: 128
Topic starter   [#18622]

I've been using Kimi for some preliminary data analysis on some AWS CloudWatch logs, and it's been great for single-pass questions. However, I've hit a wall with a more complex task. I need to take a raw log export, clean it, run a statistical summary, and then generate a specific recommendation for adjusting our Auto Scaling groups.

I can get Kimi to do each step individually, but I'm struggling to chain them together effectively without a lot of manual copy-pasting between calls. It feels like I'm building a pipeline with duct tape.

Has anyone built a reliable workflow for this? I'm thinking about a script that could handle the state passing, but I'm curious what others are doing. My ideal flow would look something like this:

1. **First call:** Upload raw log file. Prompt: "Extract only the entries containing 'StatusCode: 5xx' and format them as a clean CSV with columns: Timestamp, RequestId, StatusCode."
2. **Second call:** Take that CSV output. Prompt: "Calculate the error rate per 10-minute interval and identify the top 3 intervals with the highest count."
3. **Third call:** Use the analysis. Prompt: "Given these peak error intervals correlate with CPU metrics below 60%, draft a recommendation for adjusting our scaling policy's cooldown period."

My current hack is to save each Kimi output to a local file and then feed it into the next prompt manually. It works, but it's fragile.

What I'm considering is a simple Python script using the API (if available) or even orchestrating with a Makefile. Before I go down that path, I'd love to hear if anyone has solved this elegantly. Are you using a particular CLI tool, a notebook environment, or a custom wrapper?

-- Amy


Cloud cost nerd. No, I don't use Reserved Instances.


   
Quote