Sidekick's continual learning loop
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%.
Related posts
- How Shopify turns open models into task experts
Shopify Engineering hardMasterShopify'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. Each model is built through a loop: a rubric and an LLM judge tuned with GEPA/ACE to match human agreement, an optimized frontier agent as the baseline, open-model selection, early inference benchmarking with AIPerf, nightly self-healing that converts failed conversations into training data via critic hints, and post-training with Megatron Bridge. For GraphQL, Nemotron 3.5 Lightning went from 37.7 to 74.5 on the judge after six loops and about 61,000 healed examples, beating the frontier model's 73. It also cut median latency from 6.50s to 0.87s and serving cost by about 90%, and Blackwell GPUs made both training and serving cheaper.
- Gisting: Compressing LLM Agent context to ↑ throughput and ↓ cost
Shopify Engineering hardMasterShopify compressed the ~6,000-token system prompt of its Sidekick GraphQL agent into ~1,500 learned gist tokens (4:1) without losing prediction quality. The gist embeddings are trained by knowledge distillation (KL divergence between full-prompt teacher logits and gist-prompt student logits) with model weights frozen, then written into the embedding matrix so serving needs no special path. Gisting complements prefix caching because decode still streams the whole KV cache per generated token. At 350 RPM, median TTFT fell 19%, end-to-end latency about 38%, and throughput rose 16%, allowing 14% fewer GPUs. Key recipe findings from an autoresearch loop: initialize gists from mean prompt-chunk embeddings, batch-level loss normalization, and precomputed teacher logits cutting training from 30 to 6 hours.
- Flow generation through natural language: An agentic modeling approach
Shopify Engineering mediumAdeptShopify 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. Training data was bootstrapped by reverse-generating user queries and tool trajectories from real merchant workflows. Transpiling Flow's JSON DSL into Python, kept lossless by a round-trip transpiler, raised syntactic correctness by 22 points and semantic correctness by 13. Small train/serve mismatches in tool names, tool order and JSON key order measurably hurt accuracy, and a 1% production rollout exposed a 35% activation gap that offline benchmarks had hidden. That gap was closed with a human-calibrated LLM judge, slice tagging and a weekly retraining flywheel on H200 nodes with FSDP, orchestrated by Tangle.
- Building production-ready agentic systems: Lessons from Shopify Sidekick
Shopify Engineering mediumAdeptShopify'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. For evaluation they replaced curated golden datasets with ground truth sets sampled from real conversations, labeled by multiple experts and validated with Cohen's Kappa, Kendall Tau and Pearson correlation. LLM judges were calibrated from a Kappa of 0.02 to 0.61 against a human baseline of 0.69, and an LLM merchant simulator replays conversations against candidate systems before release. GRPO fine-tuning with gated procedural and semantic rewards exposed reward hacking such as opting out of tasks and misusing customer tags, and fixing the validators and judges raised syntax accuracy from ~93% to ~99%.
- Production is the New Prototype: Notes from LangChain Interrupt 2026
8th Light easyNoviceProduction agent deployments at LangChain Interrupt 2026 point to operational discipline, not model capability, as the hard part of shipping agents. Recurring lessons include tracing from day one (LATAM's supervisor-plus-six-specialists concierge), shrinking tool surface area through progressive tool discovery or generic SQL-writing tools (Monday.com, Rippling), and evals built from realistic user personas and co-authored with compliance (Lyft, Chime). Cost is treated as an engineering discipline: Clay reports 4–10x throughput from TCP-style back-pressure and up to 70% savings from prompt caching. Toyota's internal platform cut agent deployment from six months to four days, and the post closes with a pitch for 8th Light's agent studio.