Circle K Cloud DevOps Engineer Marek Klatowicz: Pre-querying Logs Before Passing to Agents Is More Effective Than Letting Agents Call APIs Directly
Circle K’s DevOps team built an Agentic AI incident triage system using Amazon Bedrock, reducing mean triage time from 45–60 minutes to under 15 minutes. Cloud DevOps Engineer Marek Klatowicz documented four key engineering lessons from the AWS blog during the build process: having Lambda pre-query logs and pass them directly to agents rather than letting agents query via action groups; executing searches in order of information dependency; decoupling analysis logic from the orchestration layer to support architectural migration; and adjusting knowledge retrieval configurations based on actual data.
Circle K operates more than 17,200 convenience stores and fuel retail locations across 27 countries, with cloud-native infrastructure supporting point-of-sale systems, loyalty applications, and electric vehicle (EV) charging services. When alerts fire for these digital services, on-call engineers previously spent 45 to 60 minutes toggling between CloudWatch logs, OpenSearch distributed traces, ECS task statuses, and GitHub runbooks to determine what had happened. Cloud DevOps Engineer Marek Klatowicz co-authored a piece with AWS detailing how they used Agentic AI to eliminate this repetitive labor.
The first version of the system was orchestrated by Amazon Bedrock Flows, coordinating three specialized agents working in parallel and sequence: the AWSResourceExplorerAgent checked infrastructure status, the OpenSearchExplorerAgent pulled application logs and distributed traces, and only after both completed did the GitHubExplorerAgent search code repositories to pinpoint the root cause. A final AnalysisPrompt node aggregated the three outputs into a structured summary containing the root cause, evidence, responsible team, and remediation recommendations, which was pushed to Slack. The entire process took 5 to 15 minutes. However, Klatowicz explicitly noted in the lessons learned section that the first version allowed agents to query CloudWatch logs themselves via action groups, which increased latency and often returned data volumes exceeding processing capacity. The truly effective approach was to have Lambda functions pre-query the logs and place relevant error lines directly into the agent's prompt—agents reason faster when reading actual error messages.