---
title: "Sidekick's continual learning loop"
description: "Shopify's Sidekick GraphQL agent improves daily through a continual learning loop that turns production failures into model weight updates, beating frontier-model quality while cutting estimated serving costs from about $27M to $1M per year (96%)."
url: "https://swe.quest/articles/sidekick-s-continual-learning-loop-f72e46000910fa09"
canonical: "https://shopify.engineering/sidekicks-continual-learning-loop"
source: "Shopify Engineering"
published: "2026-08-05"
difficulty: "hard"
kind: "Case study"
reading_minutes: 9
tags: ["model-training","evals","inference","llms","cost-optimization"]
---

# Sidekick's continual learning loop

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2026-08-05, 9 min read, Case study. Original: [https://shopify.engineering/sidekicks-continual-learning-loop](https://shopify.engineering/sidekicks-continual-learning-loop)

## Summary

Shopify's Sidekick GraphQL agent improves daily through a continual learning loop that turns production failures into model weight updates, beating frontier-model quality while cutting estimated serving costs from about $27M to $1M per year (96%). The loop starts with a rubric validated by inter-annotator agreement (Cohen's kappa) and an LLM judge calibrated with DSPy using GEPA and ACE, then backtested against past A/B tests and degradation tests. An autoresearch agent tunes prompts, tools and harness code against the judge. Hard negatives from production are then repaired by a panel of frontier critics via hinting and replay, and the repaired trajectories train a smaller model through chain-of-thought SFT followed by GRPO with the judge as reward. Gist-token compression shrinks the ~6,000-token system prompt to ~1,500 tokens, cutting end-to-end latency about 38% and GPU needs about 14%.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Cost optimization](https://swe.quest/tags/cost-optimization.md) (Reliability & operations)

## Prerequisites

- LLM fine-tuning ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- reinforcement learning basics ([easy posts on Model training](https://swe.quest/tags/model-training.md?difficulty=easy))
- LLM-as-judge evaluation ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- transformer attention

## Keywords

Sidekick, GRPO, DSPy, GEPA, Agentic Context Engineering, gist tokens, GraphQL, Toloka

## Related posts

- [How Shopify turns open models into task experts](https://swe.quest/articles/how-shopify-turns-open-models-into-task-experts-a2ba67e222beb92b.md): Shopify Engineering · 2026-10-21 · Hard · 5 min read · Model training, Inference & serving, Evaluation, AI agents, Cost optimization
  Shopify's Sidekick keeps a frontier model for merchant conversation and planning but offloads token-heavy subagent work, such as GraphQL query generation, to open models it post-trains and self-hosts.
- [Gisting: Compressing LLM Agent context to ↑ throughput and ↓ cost](https://swe.quest/articles/gisting-compressing-llm-agent-context-to-throughput-and-cost-77b1a192c9e3be28.md): Shopify Engineering · 2026-08-19 · Hard · 5 min read · Inference & serving, LLMs, Model training, Cost optimization, Performance engineering
  Shopify compressed the ~6,000-token system prompt of its Sidekick GraphQL agent into ~1,500 learned gist tokens (4:1) without losing prediction quality.
- [Flow generation through natural language: An agentic modeling approach](https://swe.quest/articles/flow-generation-through-natural-language-an-agentic-modeling-approach-84b1ba2f65ecd1a0.md): Shopify Engineering · 2026-04-22 · Medium · 12 min read · Model training, AI agents, Evaluation, LLMs, ML platforms
  Shopify fine-tuned Qwen3-32B into a tool-calling agent that turns natural-language requests into Shopify Flow automations for Sidekick, reporting 2.2x lower latency and 68% lower cost than the closed frontier model it replaced.
- [Building production-ready agentic systems: Lessons from Shopify Sidekick](https://swe.quest/articles/building-production-ready-agentic-systems-lessons-from-shopify-sidekick-338be221de1210c1.md): Shopify Engineering · 2025-08-26 · Medium · 6 min read · AI agents, Evaluation, Model training, LLMs
  Shopify's Sidekick merchant assistant outgrew a monolithic system prompt once its tool count passed ~50, so the team moved to just-in-time instructions returned alongside tool results, which kept prompt caches intact and improved maintainability and metrics.
- [Production is the New Prototype: Notes from LangChain Interrupt 2026](https://swe.quest/articles/production-is-the-new-prototype-notes-from-langchain-interrupt-2026-598a0cd4d231f95d.md): 8th Light · 2026-05-17 · Easy · 8 min read · AI agents, Evaluation, Observability, LLMs, Cost optimization
  Production agent deployments at LangChain Interrupt 2026 point to operational discipline, not model capability, as the hard part of shipping agents.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
