<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Gradient Labs Team]]></title><description><![CDATA[AI, Engineering, and Product at Gradient Labs]]></description><link>https://blog.gradient-labs.ai</link><image><url>https://substackcdn.com/image/fetch/$s_!s7rb!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93fcda01-b003-463e-8fe0-7d3470c79452_800x800.png</url><title>Gradient Labs Team</title><link>https://blog.gradient-labs.ai</link></image><generator>Substack</generator><lastBuildDate>Fri, 24 Apr 2026 12:33:46 GMT</lastBuildDate><atom:link href="https://blog.gradient-labs.ai/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Gradient Labs]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[gradientlabs@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[gradientlabs@substack.com]]></itunes:email><itunes:name><![CDATA[Neal Lathia]]></itunes:name></itunes:owner><itunes:author><![CDATA[Neal Lathia]]></itunes:author><googleplay:owner><![CDATA[gradientlabs@substack.com]]></googleplay:owner><googleplay:email><![CDATA[gradientlabs@substack.com]]></googleplay:email><googleplay:author><![CDATA[Neal Lathia]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Creating a Culture for AI Builders]]></title><description><![CDATA[The day-to-day at Gradient Labs]]></description><link>https://blog.gradient-labs.ai/p/creating-a-culture-for-ai-builders</link><guid isPermaLink="false">https://blog.gradient-labs.ai/p/creating-a-culture-for-ai-builders</guid><dc:creator><![CDATA[Neal Lathia]]></dc:creator><pubDate>Mon, 02 Mar 2026 16:17:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!s7rb!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93fcda01-b003-463e-8fe0-7d3470c79452_800x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you&#8217;ve ever worked in a startup, you&#8217;ve heard the common phrases&#8212; it&#8217;s fast paced, it&#8217;s high-autonomy, it&#8217;s impact-oriented. Anyone can tell you these buzzwords. This blog post sets out to go into actual detail about how we work at Gradient Labs.</p><h3>Momentum over detailed planning</h3><p>One of the earliest conversations we had when we were starting Gradient Labs was about <em>momentum</em>. In previous roles, we had felt that the real cost of large planning exercises like quarterly OKRs was a loss of velocity and an inability to quickly update plans when circumstances changed. We therefore started out with a simple mantra: &#8220;keep things moving.&#8221;</p><p>If you go into our archives, you&#8217;ll find a <em>#one-line-updates</em> slack channel which was bullet points of updates: &#8220;___ is now done.&#8221; It was early; majority of things were yet to be done. As we grew, and updates started spreading out, we switched over to a <code>:glabs-heartbeat:</code> emoji reaction, which automatically cross-posts the update to a channel. These posts celebrate <em>anything</em> that moves us forward: shipping new product features, winning bake-offs, launching a marketing campaign, or anything else.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9MFq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127239e3-7c94-40bd-ae19-b27e9ac679b9_489x196.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9MFq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127239e3-7c94-40bd-ae19-b27e9ac679b9_489x196.png 424w, https://substackcdn.com/image/fetch/$s_!9MFq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127239e3-7c94-40bd-ae19-b27e9ac679b9_489x196.png 848w, https://substackcdn.com/image/fetch/$s_!9MFq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127239e3-7c94-40bd-ae19-b27e9ac679b9_489x196.png 1272w, https://substackcdn.com/image/fetch/$s_!9MFq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127239e3-7c94-40bd-ae19-b27e9ac679b9_489x196.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9MFq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127239e3-7c94-40bd-ae19-b27e9ac679b9_489x196.png" width="489" height="196" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/127239e3-7c94-40bd-ae19-b27e9ac679b9_489x196.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:196,&quot;width&quot;:489,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:37290,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://blog.gradient-labs.ai/i/189655756?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127239e3-7c94-40bd-ae19-b27e9ac679b9_489x196.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9MFq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127239e3-7c94-40bd-ae19-b27e9ac679b9_489x196.png 424w, https://substackcdn.com/image/fetch/$s_!9MFq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127239e3-7c94-40bd-ae19-b27e9ac679b9_489x196.png 848w, https://substackcdn.com/image/fetch/$s_!9MFq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127239e3-7c94-40bd-ae19-b27e9ac679b9_489x196.png 1272w, https://substackcdn.com/image/fetch/$s_!9MFq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F127239e3-7c94-40bd-ae19-b27e9ac679b9_489x196.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><figcaption class="image-caption">Momentum is everything</figcaption></figure></div><p>Our planning process is high level and is oriented towards driving focus and momentum. We decide on outcomes we are aiming for, identify the bottlenecks, and set intentional time limits. At the same time, we retain the ability to change course. Some of our most interesting product features have come from the team spotting patterns, having ideas, or taking a day to run an experiment. When outcomes need to be sequenced or mapped out in more detail, we use <em>proposals&#8212;</em> documents akin to RFCs or product specifications.</p><p>From the outside, some of this might appear to be a little bit chaotic. At any one time, we have a set of problems that we are tackling and what we need is to have, validate, and then quickly exclude ideas that <em>don&#8217;t</em> work in order to move the needle forward. Making in-depth plans often stand in the way of fast iteration; deciding on the <em>next</em> step to take is easier than deciding on the next ten.</p><h3>Fluid teams</h3><p>Today, just over 50% of Gradient Labs is Engineering (AI, Backend, Product) and Design. We also have a very special team that we call AI Delivery, with Product &amp; Ops specialists who run the entire lifecycle of landing and expanding our AI agent&#8217;s capabilities with each of our partners. The rest of the company spans Sales, Marketing, and Ops; all of them work deeply with everyone in tech.</p><p>There&#8217;s a blueprint that has been synonymous with startups and scale-ups for a long time: people get organised into cross-functional teams (squads, pods) and teams are clustered thematically into groups (tribes, collectives). This model assumes that you can decide that structure <em>relatively</em> up-front, by knowing what needs to be done. Once you create teams, re-structuring them is not a frictionless exercise, and people start thinking about <em>their</em> team&#8217;s remit.</p><p>We&#8217;ve adopted a more fluid structure:</p><ul><li><p><strong>Strike teams</strong> are cross-functional groups who are working on a top level company priority. The team&#8217;s <strong>continued existence means that the goal isn&#8217;t fully reached yet</strong>. Membership in a strike team is decided based on what the team currently needs to achieve that outcome&#8212;people <strong>are expected to drop out</strong> when no longer needed.</p></li><li><p><strong>Pair projects.</strong> In some cases, we have people huddle on a project to get it over the line. Usually these are discipline-specific: a change that is only AI, product, or backend-related.</p></li><li><p><strong>One person quest.</strong> Every company has had that inevitable moment of receiving a customer request or idea, and then needing to figure out how to slot that into a wider set of priorities that a cross-functional squad is working on. We have countless examples of a single Engineer having an idea, building it, and then seeing it through all the way to customers.</p></li></ul><h3>On demand over recurring meetings</h3><p>When I asked the team for ideas for this blog post, &#8220;meeting free calendar&#8221; was one of the first replies and is highly valued across the entire Engineering team.</p><p>There&#8217;s usually a natural cadence of meetings that tech teams fall into. Stand up, planning, cross-team syncs, retros. In these environments, builders might realistically only get a couple hours of day of pure focus. We do not impose any required meetings. We&#8217;ve found that standing meetings quickly become formulaic and lose their meaning. In the spirit of fast collaboration, meetings happen on demand&#8212;when a thread is becoming too long, when someone is blocked, or when multiple people are running in parallel and want to check in. </p><p>The only standing meeting that we currently have is a weekly company-wide All Hands which ranges from 20 to 45 minutes, and spotlights recent progress, reinforces our current goals, or gives us a forum to share updates.</p><h3>Customers actively contribute to our roadmap</h3><p>When adopting an AI agent, the most natural questions from our partners are around understanding, steering, and extending the AI agent&#8217;s performance. A lot of amazing ideas come from their feedback and the constraints that they are working with.</p><p>It&#8217;s very common at Gradient Labs for customer meetings to have folks from AI Delivery and Engineering involved so that we can unblock them as quickly as possible. Given that we focus on financial services, it&#8217;s also common that new features we build from one customer&#8217;s feedback are immediately useful to others: this means that we can stage our feature rollouts by customer &amp; their interest rather than needing to trade-off against or design around competing requests.</p><h3>Process &amp; tooling, insofar as it helps</h3><p>When joining a company, a natural question to ask is &#8220;what is the process for ___?&#8221; At an early-stage startup, the answer is usually &#8220;we don&#8217;t have one yet.&#8221; Having a process does help in some cases: it brings clarity, and safety. Other times, it stands in the way.</p><p>At Gradient Labs, we&#8217;ve intentionally avoided adding process until the reason for adding one is to help us move faster.</p><ul><li><p>What is our process for raising an incident? If you are thinking about whether or not to raise an incident, just do it.</p></li><li><p>What is our process for tracking bugs? Whatever the current team moves faster on&#8212;sometimes Linear, sometimes a Notion page; sometimes, just squash the bug right now.</p></li><li><p>What is the process for onboarding a new customer? We have the milestones that need to be achieved, not the strict sequence of steps.</p></li></ul><p>All of these are ways-of-working processes; the process &amp; bar we set for the product itself remains very high.</p><h3>Owning the quality bar &amp; not hiding behind the data</h3><p>The truth we face today is that, over time, it is becoming easier to build an AI agent. What is <strong>not</strong> becoming easier is building a <em>great</em> one. Although the entire founding team has a background in Data Science, we are very intentional about not hiding behind &#8220;what the data says.&#8221; After all, an AI agent can deliver the same resolution in many ways: it might be okay, mediocre, frustrating, or amazing, even though the resolution was reached in all cases. The data is an important driver of where to look, but not the ultimate decider on whether things are good enough.</p><p>Coming to a shared understanding of &#8220;great&#8221; is not easy. When we embarked on building our voice agent, the first thing we did was scour the Internet to find any and all agents we could talk to, and asked questions like: &#8220;would I enjoy speaking to this?&#8221; and &#8220;would I buy this?&#8221; When we launched, we reviewed all of the phone calls and iterated heavily. And as we scale, we&#8217;re keeping that ethos, even though the number of conversations we&#8217;re having far exceeds our ability to review them all.</p><h3>Scaling quality</h3><p>We believe that when building AI agents (with AI), the bottleneck has largely moved away from the <em>time it takes to create something</em> and into the <em>time it takes to ensure it works well</em>. We know that every part of our stack, from the support platform connection through to the <a href="https://blog.gradient-labs.ai/p/anatomy-of-an-ai-agent-incident">Temporal cache</a>, has a meaningful impact on the outcomes we achieve. </p><p>And we have seen that nimble, fluid teams that live &amp; breathe a problem while driving it towards the best possible outcome can build products that outperform others.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.gradient-labs.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.gradient-labs.ai/subscribe?"><span>Subscribe now</span></a></p><p></p>]]></content:encoded></item><item><title><![CDATA[Building resilient agentic systems]]></title><description><![CDATA[A guide to the foundations underneath our AI agent]]></description><link>https://blog.gradient-labs.ai/p/building-resilient-agentic-systems</link><guid isPermaLink="false">https://blog.gradient-labs.ai/p/building-resilient-agentic-systems</guid><dc:creator><![CDATA[Devan Kuleindiren]]></dc:creator><pubDate>Mon, 15 Sep 2025 16:33:08 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!tUso!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c65413c-1d21-4667-b8de-6986f2c20c06_4598x1996.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>At Gradient Labs, our AI agent interacts with the customers of financial services companies: <em>high-reliability is non-negotiable</em>. Suppose you get in touch with your bank about an important problem related to your money &#8212; there&#8217;s no excuse for your bank&#8217;s AI agent not to be able to reply!</p><p>Under the hood, <a href="https://blog.gradient-labs.ai/p/llms-at-gradient-labs-the-perfect">we use a blend of different large language models (LLMs)</a> to construct the highest quality answers. LLMs are therefore a critical dependency for our agent, and we need to be resilient to all kinds of failures or constraints in order to provide a reliable experience. This blog post goes into some detail about how we achieve that.</p><h1>AI agents are a new paradigm</h1><p>When building a server which handles a request, such as a mobile phone app calling a bank, the request might return within a few hundred milliseconds. Anything which fails on the path of the request would likely result in a retry of the <em>entire</em> request.</p><p>In agentic systems, where a single reply may be the result of a chain of LLM calls, requests can span much longer durations. Each LLM call costs both user-facing latency and money, so you don&#8217;t want a single failure in that chain to result in the entire request being retried:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tUso!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c65413c-1d21-4667-b8de-6986f2c20c06_4598x1996.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tUso!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c65413c-1d21-4667-b8de-6986f2c20c06_4598x1996.png 424w, https://substackcdn.com/image/fetch/$s_!tUso!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c65413c-1d21-4667-b8de-6986f2c20c06_4598x1996.png 848w, https://substackcdn.com/image/fetch/$s_!tUso!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c65413c-1d21-4667-b8de-6986f2c20c06_4598x1996.png 1272w, https://substackcdn.com/image/fetch/$s_!tUso!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c65413c-1d21-4667-b8de-6986f2c20c06_4598x1996.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tUso!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c65413c-1d21-4667-b8de-6986f2c20c06_4598x1996.png" width="1456" height="632" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1c65413c-1d21-4667-b8de-6986f2c20c06_4598x1996.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:632,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:381157,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://blog.gradient-labs.ai/i/173452007?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c65413c-1d21-4667-b8de-6986f2c20c06_4598x1996.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tUso!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c65413c-1d21-4667-b8de-6986f2c20c06_4598x1996.png 424w, https://substackcdn.com/image/fetch/$s_!tUso!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c65413c-1d21-4667-b8de-6986f2c20c06_4598x1996.png 848w, https://substackcdn.com/image/fetch/$s_!tUso!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c65413c-1d21-4667-b8de-6986f2c20c06_4598x1996.png 1272w, https://substackcdn.com/image/fetch/$s_!tUso!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c65413c-1d21-4667-b8de-6986f2c20c06_4598x1996.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">An illustration of how agentic systems often involve longer-running requests where you don&#8217;t want to retry the entire chain of LLM calls if only one of them fails.</figcaption></figure></div><p>One way to solve for this might be to manually write data to a database at the end of each call, to persist state that captures the progress of your agent. This way, you can always recover from a checkpoint upon failure&#8212;if the database write succeeded. Another way might be to implement `<code>@retry`</code> logic at every step of your agent, which means solving for retry logic while trying to implement the AI agent. At Gradient Labs, <a href="https://temporal.io/resources/case-studies/gradient-labs-uses-ai-agents-to-resolve-complex-customer-issues">we use Temporal</a>, a durable execution system, that provides us with a way to effectively checkpoint progress out of the box.</p><h1>Failing over across providers</h1><p>The earliest design choices we made at Gradient Labs favoured an architecture that enables us to experiment with, evaluate, and adopt the best LLMs for each part of our agent. Right now, <a href="https://blog.gradient-labs.ai/p/llms-at-gradient-labs-the-perfect">we use three major groups of models</a> &#8212; from OpenAI, Anthropic and Google. Each of these groups of models are hosted in multiple places, giving us the ability to fail over from one place to another:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!TNvu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F835cee2e-960e-4e53-9fae-fc1cd083d14b_3622x1382.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TNvu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F835cee2e-960e-4e53-9fae-fc1cd083d14b_3622x1382.png 424w, https://substackcdn.com/image/fetch/$s_!TNvu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F835cee2e-960e-4e53-9fae-fc1cd083d14b_3622x1382.png 848w, https://substackcdn.com/image/fetch/$s_!TNvu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F835cee2e-960e-4e53-9fae-fc1cd083d14b_3622x1382.png 1272w, https://substackcdn.com/image/fetch/$s_!TNvu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F835cee2e-960e-4e53-9fae-fc1cd083d14b_3622x1382.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TNvu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F835cee2e-960e-4e53-9fae-fc1cd083d14b_3622x1382.png" width="1456" height="556" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/835cee2e-960e-4e53-9fae-fc1cd083d14b_3622x1382.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:556,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:278942,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.gradient-labs.ai/i/173452007?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F835cee2e-960e-4e53-9fae-fc1cd083d14b_3622x1382.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!TNvu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F835cee2e-960e-4e53-9fae-fc1cd083d14b_3622x1382.png 424w, https://substackcdn.com/image/fetch/$s_!TNvu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F835cee2e-960e-4e53-9fae-fc1cd083d14b_3622x1382.png 848w, https://substackcdn.com/image/fetch/$s_!TNvu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F835cee2e-960e-4e53-9fae-fc1cd083d14b_3622x1382.png 1272w, https://substackcdn.com/image/fetch/$s_!TNvu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F835cee2e-960e-4e53-9fae-fc1cd083d14b_3622x1382.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">We use <strong>OpenAI</strong> models served by: OpenAI and Azure APIs; <strong>Anthropic</strong> models served by Anthropic, AWS and GCP APIs; and <strong>Google</strong> models served by GCP APIs in different regions.</figcaption></figure></div><p>We take advantage of this to both (a) spread traffic across providers, to increase utilisation of per-provider rate-limits, and (b) fail over from one provider to another when we encounter certain errors, rate limits or latency spikes.</p><p>In our platform, each completion request starts with an ordered list of API provider preferences. For example, if we&#8217;re making a request for GPT 4.1, we might have the preference ordering: (1) OpenAI, (2) Azure. We can configure these preferences on both a global and a per-company basis, and we can also assign them proportionally to how we want to split traffic across the two. If we encounter certain types of errors, then we failover to the next provider.</p><p>The nuance of a failover system is: <strong>when is it right to fail over?</strong> We currently handle  four broad categories:</p><ol><li><p><strong>Successful, invalid responses</strong> &#8212; for example, perhaps we asked the LLM to place its final decision inside <code>&lt;decision&gt;...&lt;/decision&gt;</code> tags, but the generated response doesn&#8217;t include these. We do not need to fail over for these.</p></li><li><p><strong>Errors</strong> &#8212; LLM APIs, much like any other software provider, can return all sorts of errors. We&#8217;ll failover when we hit most 5XX errors.</p></li><li><p><strong>Rate limits</strong> &#8212; LLM APIs impose different rate limits for each model. Increasing these limits, particularly for more recent or experimental models, is not an automated process. If we failover due to being rate limited, then we mark the API provider that we failed-over from as &#8220;unavailable&#8221; in our cache for a short while. This way, we don&#8217;t waste latency on subsequent requests on a resource that&#8217;s already over limits.</p></li><li><p><strong>Latency</strong> &#8212; LLMs can be slow. This is expected to be variable across calls. But we need to look out for scenarios where they&#8217;re globally slower than expected&#8212;this is a symptom that something is wrong. We currently failover if the request exceeds a timeout in the p99+ percentile of latency.</p></li></ol><h1>Failing over across models</h1><p>There are catastrophic, low-likelihood scenarios where the provider failover system is not enough. For example, in the extremely rare case that <a href="https://status.cloud.google.com/incidents/ow5i3PPK96RduMcb1SsW">Google is down</a>, our failovers for completions from Gemini would no longer work. </p><p>In these cases, we can also activate model failover: for each LLM API request, we can configure a different model to use in the event of failure.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!y7C7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d2294fa-f624-4c71-b815-c0817c515a2b_4871x2495.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!y7C7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d2294fa-f624-4c71-b815-c0817c515a2b_4871x2495.png 424w, https://substackcdn.com/image/fetch/$s_!y7C7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d2294fa-f624-4c71-b815-c0817c515a2b_4871x2495.png 848w, https://substackcdn.com/image/fetch/$s_!y7C7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d2294fa-f624-4c71-b815-c0817c515a2b_4871x2495.png 1272w, https://substackcdn.com/image/fetch/$s_!y7C7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d2294fa-f624-4c71-b815-c0817c515a2b_4871x2495.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!y7C7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d2294fa-f624-4c71-b815-c0817c515a2b_4871x2495.png" width="1456" height="746" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0d2294fa-f624-4c71-b815-c0817c515a2b_4871x2495.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:746,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:634800,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.gradient-labs.ai/i/173452007?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d2294fa-f624-4c71-b815-c0817c515a2b_4871x2495.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!y7C7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d2294fa-f624-4c71-b815-c0817c515a2b_4871x2495.png 424w, https://substackcdn.com/image/fetch/$s_!y7C7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d2294fa-f624-4c71-b815-c0817c515a2b_4871x2495.png 848w, https://substackcdn.com/image/fetch/$s_!y7C7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d2294fa-f624-4c71-b815-c0817c515a2b_4871x2495.png 1272w, https://substackcdn.com/image/fetch/$s_!y7C7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d2294fa-f624-4c71-b815-c0817c515a2b_4871x2495.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The main challenge of a model failover is that prompts that work well with one model don&#8217;t necessarily work well with others. However, designing and evaluating multiple prompt-model pairs for components of our agent is already part of our development lifecycle. For several critical components of our system, we have tailored prompts for both the primary and backup models. </p><p>This has a two-fold benefit:</p><ol><li><p>In the event that the entire model group&#8217;s providers are down, our customers are protected, and their customers continue to receive replies from our AI agent.</p></li><li><p>In the event that we get rate-limited for newer and more experimental models, we can failover to older models for which we have higher rate limits.</p></li></ol><h1>Always improving</h1><p>We&#8217;re always thinking about ways in which we can improve our resiliency&#8212;here is can a recent example. We&#8217;re already protected against scenarios where individual LLM API requests takes too long, because we time out and failover to the next provider. This timeout is designed to catch abnormally long requests &#8212; typically in the p99 percentile of latency. What should happen if the <strong>entire</strong> latency distribution shifts? </p><p>We observed this with one of our providers:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rnFE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7921bbe-fc5a-4f28-9f48-9b4273c56794_1385x1145.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rnFE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7921bbe-fc5a-4f28-9f48-9b4273c56794_1385x1145.png 424w, https://substackcdn.com/image/fetch/$s_!rnFE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7921bbe-fc5a-4f28-9f48-9b4273c56794_1385x1145.png 848w, https://substackcdn.com/image/fetch/$s_!rnFE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7921bbe-fc5a-4f28-9f48-9b4273c56794_1385x1145.png 1272w, https://substackcdn.com/image/fetch/$s_!rnFE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7921bbe-fc5a-4f28-9f48-9b4273c56794_1385x1145.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rnFE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7921bbe-fc5a-4f28-9f48-9b4273c56794_1385x1145.png" width="1385" height="1145" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f7921bbe-fc5a-4f28-9f48-9b4273c56794_1385x1145.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1145,&quot;width&quot;:1385,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:309263,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.gradient-labs.ai/i/173452007?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7921bbe-fc5a-4f28-9f48-9b4273c56794_1385x1145.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rnFE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7921bbe-fc5a-4f28-9f48-9b4273c56794_1385x1145.png 424w, https://substackcdn.com/image/fetch/$s_!rnFE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7921bbe-fc5a-4f28-9f48-9b4273c56794_1385x1145.png 848w, https://substackcdn.com/image/fetch/$s_!rnFE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7921bbe-fc5a-4f28-9f48-9b4273c56794_1385x1145.png 1272w, https://substackcdn.com/image/fetch/$s_!rnFE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7921bbe-fc5a-4f28-9f48-9b4273c56794_1385x1145.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">An example of an incident where the p75+ latency meaningfully increased, but stayed within our failover timeouts. This meant that the end-to-end latency of our agent increased, but failover didn&#8217;t kick in.</figcaption></figure></div><p>In this case, the mean latency of a few models spiked, and the p75+ latency jumped to well over 10s. This increased the overall latency of our agent, but didn&#8217;t initiate our failover mechanism. Thankfully, through our latency-based alerts, we were able to identify this fairly quickly and manually invoke the failover mechanism. However, this points to an interesting idea &#8212; can we auto-failover when we observe abnormal shifts in the latency distribution? </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.gradient-labs.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><em>If these sorts of problems excite you, please reach out. <a href="https://jobs.ashbyhq.com/gradient-labs">We&#8217;re hiring</a>! Subscribe below for future updates:</em></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Anatomy of an AI agent incident]]></title><description><![CDATA[A short post on a string of related incidents we had a few months ago, and how we discovered and resolved the issues]]></description><link>https://blog.gradient-labs.ai/p/anatomy-of-an-ai-agent-incident</link><guid isPermaLink="false">https://blog.gradient-labs.ai/p/anatomy-of-an-ai-agent-incident</guid><dc:creator><![CDATA[Neal Lathia]]></dc:creator><pubDate>Mon, 18 Aug 2025 13:55:48 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!8B6Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d7106b-3e5f-44e4-bd17-83921483e217_1928x582.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>As we launch <a href="https://jobs.ashbyhq.com/gradient-labs/4e398d0a-a718-4127-85dc-7ba25bdd3ca5">our first Platform &amp; Security Engineering role</a>, we thought to follow in the footsteps of many great tech companies that have come before and write about a string of incidents that we worked through about six months ago. These were a wild ride for us!</p><h2>It all started with a memory usage alert</h2><p>At Gradient Labs, our platform and AI agent are written in Go and deployed using Cloud Run. Each conversation that our agent participates in <a href="https://temporal.io/resources/case-studies/gradient-labs-uses-ai-agents-to-resolve-complex-customer-issues">is a long-running Temporal workflow</a> which manages the conversation&#8217;s state, timers, and runs child workflows to generate responses. We have alerts across many of our platform and agent metrics, some of which page an on-call Engineer.</p><p>Late one weekend evening, Google Cloud platform alerts fired: the memory usage across our agent&#8217;s containers was abnormally high. This is a somewhat nebulous alert: it doesn&#8217;t mean we&#8217;re down, but it does mean that something is not quite right.</p><p>Our top priority is always to ensure that no customers are left hanging: i.e., that our agent is replying in all its active conversations. We raised an incident. We looked to quickly pinpoint any changes that started this pattern: there was nothing that immediately stood out. Notably, this was difficult to narrow down because, during the day, each deployment that we had been making was zeroing out the problem. And we were also dealing with variable traffic, having multiple trials running at that time. So we bought ourselves some time by redeploying the agent with more memory. The alert was resolved within minutes, but we knew that a deep investigation was required to get to a root cause.</p><p>Diving into the metrics, this looked like a classic <a href="https://en.wikipedia.org/wiki/Memory_leak">memory leak</a> where our agent container kept restarting. The problem was that memory utilisation was growing much faster than before.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8B6Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d7106b-3e5f-44e4-bd17-83921483e217_1928x582.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8B6Z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d7106b-3e5f-44e4-bd17-83921483e217_1928x582.png 424w, https://substackcdn.com/image/fetch/$s_!8B6Z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d7106b-3e5f-44e4-bd17-83921483e217_1928x582.png 848w, https://substackcdn.com/image/fetch/$s_!8B6Z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d7106b-3e5f-44e4-bd17-83921483e217_1928x582.png 1272w, https://substackcdn.com/image/fetch/$s_!8B6Z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d7106b-3e5f-44e4-bd17-83921483e217_1928x582.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8B6Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d7106b-3e5f-44e4-bd17-83921483e217_1928x582.png" width="1456" height="440" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/13d7106b-3e5f-44e4-bd17-83921483e217_1928x582.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:440,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:183011,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://blog.gradient-labs.ai/i/171272223?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d7106b-3e5f-44e4-bd17-83921483e217_1928x582.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8B6Z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d7106b-3e5f-44e4-bd17-83921483e217_1928x582.png 424w, https://substackcdn.com/image/fetch/$s_!8B6Z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d7106b-3e5f-44e4-bd17-83921483e217_1928x582.png 848w, https://substackcdn.com/image/fetch/$s_!8B6Z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d7106b-3e5f-44e4-bd17-83921483e217_1928x582.png 1272w, https://substackcdn.com/image/fetch/$s_!8B6Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13d7106b-3e5f-44e4-bd17-83921483e217_1928x582.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Uh oh! This memory usage doesn&#8217;t look right</figcaption></figure></div><h2>Spoiler: it wasn&#8217;t a memory leak</h2><p>There are several different parts of our AI agent that we <em>expect</em> to be memory intensive, particularly parts that are operating with many (variably sized) documents. We also run different parts of the agent in parallel to speed it up. We revisited all of these to ensure that resources were not being left in memory when no longer in use. None of these turned up anything useful; it seemed that something below the surface was at play. Perhaps with Temporal?</p><p>When researching online, we found an odd <a href="https://community.temporal.io/t/we-now-have-a-memory-leak-problem/12526/13">post on the Temporal forum</a> about an unexplained memory leak, but there wasn&#8217;t a clear answer there either. It seemed likely that if there <em>was</em> a memory leak in the Go Temporal SDK, that we wouldn&#8217;t be the only ones impacted. So we put it to one side, and kept digging.</p><p>The Google Cloud Profiler <a href="https://cloud.google.com/profiler/docs/concepts-flame">flame graphs</a> deltas for our agent's memory usage finally shed some light. Temporal&#8217;s top-level execution functions had the biggest growth over time in exclusive memory: something they were doing was increasing memory usage, and it had nothing to do with any of the functions they called further down the call stack. Among other things, these top-level functions are responsible for adding items to the <a href="https://docs.temporal.io/develop/worker-performance#cache-options">Temporal Workflow cache</a>. This cache stores workflow execution histories so that they don't always need to be retrieved from Temporal Cloud when a workflow resumes. Could this be what is causing the problem? We set out to validate this by running some tests.</p><h2>Validating &amp; fixing the issue</h2><p>To validate whether our problem was indeed related to the workflow cache, we made a sequence of intentional changes:</p><ol><li><p>The first change was to boost the agent&#8217;s memory to 5x what it previously had. Memory usage continued to grow <em>but eventually plateaued</em>. There was some kind of limit that we had reached.</p></li><li><p>We then deployed a change to decrease the worker&#8217;s cache size down by 10x. The container&#8217;s memory continued to grow, but plateaued at a much lower value.</p></li></ol><p>It seemed that we had found our answer: our previous container memory limit was below the cache&#8217;s &#8220;plateau&#8221; value: containers were crashing as the cache was trying to fill up.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rmQf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac7e8288-1bb5-4066-8166-0129bc485cb6_3398x1356.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rmQf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac7e8288-1bb5-4066-8166-0129bc485cb6_3398x1356.png 424w, https://substackcdn.com/image/fetch/$s_!rmQf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac7e8288-1bb5-4066-8166-0129bc485cb6_3398x1356.png 848w, https://substackcdn.com/image/fetch/$s_!rmQf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac7e8288-1bb5-4066-8166-0129bc485cb6_3398x1356.png 1272w, https://substackcdn.com/image/fetch/$s_!rmQf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac7e8288-1bb5-4066-8166-0129bc485cb6_3398x1356.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rmQf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac7e8288-1bb5-4066-8166-0129bc485cb6_3398x1356.png" width="1456" height="581" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ac7e8288-1bb5-4066-8166-0129bc485cb6_3398x1356.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:581,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:375505,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.gradient-labs.ai/i/171272223?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac7e8288-1bb5-4066-8166-0129bc485cb6_3398x1356.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rmQf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac7e8288-1bb5-4066-8166-0129bc485cb6_3398x1356.png 424w, https://substackcdn.com/image/fetch/$s_!rmQf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac7e8288-1bb5-4066-8166-0129bc485cb6_3398x1356.png 848w, https://substackcdn.com/image/fetch/$s_!rmQf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac7e8288-1bb5-4066-8166-0129bc485cb6_3398x1356.png 1272w, https://substackcdn.com/image/fetch/$s_!rmQf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac7e8288-1bb5-4066-8166-0129bc485cb6_3398x1356.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The AI agent&#8217;s container memory usage while we were validating our hypothesis</figcaption></figure></div><p>We closed this out by tuning our worker cache size. This was a trade-off between: how much memory we need to provision for our instances (infrastructure cost) vs how large we could make the cache (which reduces network calls to Temporal Cloud, and thus overall latency). Back in business!</p><h2>But wait... why is the AI agent slowing down?</h2><p>A short while after, as we continued onboarding new customers (and increasing our overall volume of conversations) we spotted that our AI agent&#8217;s mean latency seemed to have increased. This measures the average time that it takes our AI agent to do all of the steps that it needs to do to generate and safeguard its replies&#8212;a slow down here makes for a slightly worse customer experience. </p><p>Usually, this is an early symptom that one of the many LLM model providers that we use might be about to declare an incident. On that day, that was indeed the case, and so we adjusted our LLM fail-over system and the mean latency started going back down.</p><p>The next day, the problem resurfaced. This time, however, there were no reported outages from LLM providers (and no other errors, like rate limits). Curiously, this apparent change in latency seemed to be across the board, spanning agent skills that used different model providers and prompts that were known to regularly run very quickly, for both simple and complex AI agent responses. The problem seemed to be proportional to the volume that we were currently handling, which does fluctuate over the course of the day. </p><p>Digging through our metrics, we identified that the issue was not with the LLM providers themselves: the problem was that the time between <em>scheduling</em> and <em>starting to execute</em> our Temporal activities had grown substantially (sometimes more than 10x), while our rate of executions had dropped. Something was bottlenecked.</p><h2>Fixing a side-effect of the previous fix</h2><p>Opening the Google Cloud dashboard, we quickly found the answer: our agent had scaled <em>itself</em> down to very few instances. By manually editing the minimum instance count, we saw an immediate uptick in activity executions and everything returned to normal. It took us less than an hour to identify and fix the problem.</p><p>How did this happen? Effectively, by auto-scaling our container count down, we had reduced our ability to execute activities. Most of them were scheduled, but then stuck waiting for an available worker to execute them&#8212;and there were far too few to execute them swiftly.</p><p>Cloud Run <a href="https://cloud.google.com/run/docs/about-instance-autoscaling">auto-scales</a>, in both directions, and so originally we had been reliant on this and had set a low, non-zero minimum instance count. Importantly, it auto scales based on incoming HTTP requests, event consumption and CPU utilisation. Since our agent is a Temporal workflow, it had none of these: it polls Temporal Cloud (rather than receiving HTTP requests), it does not consume events, and the CPU utilisation had been fairly low. However, Cloud Run also <a href="https://cloud.google.com/blog/topics/developers-practitioners/lifecycle-container-cloud-run">attempts to gracefully handle</a> cases where containers are crashing, which had stopped ever since we fixed the workflow cache problem &#129318;. Effectively, Cloud Run had been keeping up with our instances crashes. By tuning the cache size, we fixed one problem but inadvertently prevented Cloud Run from scaling: we had throttled ourselves. A quick fix, but an unintended problem!</p><h2>Exceptional customer service, from the platform up</h2><p>Running an AI agent at scale means that we need to finely tune every single layer of our systems: the prompts, the LLM providers, the databases, and all the way through to the containers. Ultimately, the exceptional experience that we give each customer is the result of orchestrating all of these together, seamlessly.</p><p>In the incidents described above, we were all hands on deck to ensure that our AI agent was not abandoning any customers, and to get it back up on its feet as quickly as possible. As we keep rapidly scaling, this is an area that needs full-time attention: if these kinds of problems excite you, <a href="https://jobs.ashbyhq.com/gradient-labs/4e398d0a-a718-4127-85dc-7ba25bdd3ca5">we are hiring</a> for a Platform &amp; Security Engineer.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.gradient-labs.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.gradient-labs.ai/subscribe?"><span>Subscribe now</span></a></p><p></p>]]></content:encoded></item><item><title><![CDATA[We've raised $13M to automate customer operations in financial services]]></title><description><![CDATA[We are thrilled to announce our $13M Series A led by Redpoint Ventures, with participation from Exceptional Capital, Liquid 2, LocalGlobe, Puzzle Ventures, and more]]></description><link>https://blog.gradient-labs.ai/p/weve-raised-13m-to-automate-customer</link><guid isPermaLink="false">https://blog.gradient-labs.ai/p/weve-raised-13m-to-automate-customer</guid><dc:creator><![CDATA[Neal Lathia]]></dc:creator><pubDate>Tue, 08 Jul 2025 14:44:56 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!k_WJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cc4f55e-c635-4658-ab98-c9f4929c2215_2560x1440.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You can find the full announcement on our home page:</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://gradient-labs.ai/blog/series-a-announcement&quot;,&quot;text&quot;:&quot;Read the full announcement&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://gradient-labs.ai/blog/series-a-announcement"><span>Read the full announcement</span></a></p><p>We're incredibly excited about the road ahead. If you want to deliver superb customer experiences that span the entire customer journey, we'd love to partner with you. We&#8217;re only an email away at <a href="mailto:hello@gradient-labs.ai">hello@gradient-labs.ai</a>.</p><p>If you want to be part of a passionate, smart team tackling some of the most complex automation challenges in financial services &#8211; <a href="https://gradient-labs.ai/careers">join us, we&#8217;re hiring</a>! </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!k_WJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cc4f55e-c635-4658-ab98-c9f4929c2215_2560x1440.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!k_WJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cc4f55e-c635-4658-ab98-c9f4929c2215_2560x1440.png 424w, https://substackcdn.com/image/fetch/$s_!k_WJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cc4f55e-c635-4658-ab98-c9f4929c2215_2560x1440.png 848w, https://substackcdn.com/image/fetch/$s_!k_WJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cc4f55e-c635-4658-ab98-c9f4929c2215_2560x1440.png 1272w, https://substackcdn.com/image/fetch/$s_!k_WJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cc4f55e-c635-4658-ab98-c9f4929c2215_2560x1440.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!k_WJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cc4f55e-c635-4658-ab98-c9f4929c2215_2560x1440.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7cc4f55e-c635-4658-ab98-c9f4929c2215_2560x1440.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:212171,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://blog.gradient-labs.ai/i/167806723?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cc4f55e-c635-4658-ab98-c9f4929c2215_2560x1440.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!k_WJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cc4f55e-c635-4658-ab98-c9f4929c2215_2560x1440.png 424w, https://substackcdn.com/image/fetch/$s_!k_WJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cc4f55e-c635-4658-ab98-c9f4929c2215_2560x1440.png 848w, https://substackcdn.com/image/fetch/$s_!k_WJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cc4f55e-c635-4658-ab98-c9f4929c2215_2560x1440.png 1272w, https://substackcdn.com/image/fetch/$s_!k_WJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cc4f55e-c635-4658-ab98-c9f4929c2215_2560x1440.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.gradient-labs.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[LLMs at Gradient Labs: the perfect blend]]></title><description><![CDATA[We don't pick one language model; we blend many together to get the best result.]]></description><link>https://blog.gradient-labs.ai/p/llms-at-gradient-labs-the-perfect</link><guid isPermaLink="false">https://blog.gradient-labs.ai/p/llms-at-gradient-labs-the-perfect</guid><dc:creator><![CDATA[Neal Lathia]]></dc:creator><pubDate>Wed, 16 Apr 2025 13:08:30 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/637142f7-2d2f-49b1-9d5f-87cbde0dd6d3_2624x3936.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the last two months, there have been announcements for several landmark models: <a href="https://openai.com/index/gpt-4-1/">GPT-4.1</a> on April 14th, <a href="https://ai.meta.com/blog/llama-4-multimodal-intelligence/">Llama 4</a> on April 5th, <a href="https://blog.google/technology/google-deepmind/gemini-model-thinking-updates-march-2025">Gemini 2.5</a> on March 25th, and <a href="https://www.anthropic.com/news/claude-3-7-sonnet">Claude 3.7</a> at the end of February. Undoubtedly, there&#8217;s a frenetic amount of work going into training the next generation of foundation models, and everything is changing fast.</p><p>This continuous change is a great reminder that <em>evaluating LLMs is hard</em>. Given <strong>one</strong> model, there&#8217;s a plethora of metrics reported on public evaluation datasets that aim to demonstrate its general performance. Looking across <strong>many</strong> models, there are often slight differences in what benchmarks are used and how they are compared to competitors. The ultimate question, for task-centric AI agents, is: if a model looks good on paper, will it be good for the <em>specific problems</em> that our agent works on?</p><p>At Gradient Labs, we&#8217;ve taken a slightly different path with respect to how we go about model selection&#8212;this post is an overview of what we do.</p><h2>The ultimate trifecta</h2><p>If you zoom out all the way, there are only three variables at play with all foundation models. Assuming a task that requires a single completion, the trade off is between:</p><ol><li><p><strong>Quality</strong>: how &#8220;good&#8221; are the outcomes that the model achieves?</p></li><li><p><strong>Latency</strong>: how quickly can the model achieve a result?</p></li><li><p><strong>Cost</strong>: how many tokens does it need to generate to get to the result, and how are those tokens priced?</p></li></ol><p>Unfortunately, the range of models out there often only gives you two of these &#128542;&#8212;sometimes just one!</p><p>At Gradient Labs, we heavily anchor on the first: quality. Primarily, this is because the industry trend with the other dimensions, over time, has been progressively faster, cheaper models that are &#8220;just as smart.&#8221; End-to-end agent latency also has a strong Engineering angle that is separate from the model choice&#8212;by parallelising different building blocks of the agent, by pre-emptively running some parts before they are needed, and more.</p><p>However, inside the quality dimension there is a lot to unpack:</p><ul><li><p>An individual building block of an agent might be evaluated in completely different ways&#8212;with binary or multi-class classification metrics, ranking metrics, or response quality reviews. In this arena, the choice of metric can&#8217;t be divorced from what that part of the agent is trying to achieve.</p></li><li><p>The end-to-end customer experience when chatting with an AI agent is determined by the effect of <strong>combining</strong> all of the agent&#8217;s blocks together, and so ensuring that rare upstream mistakes do not compound into low-quality downstream responses is critical. This area is not contingent on using the same model throughout the whole agent. There are a suite of tools and product features that we surface for this, ranging from simulations all the way through to advanced customer conversation synthesis (more to come on this front soon!).</p></li></ul><h2>Going all-in &#10060; , maintaining optionality &#9989;</h2><p>At Gradient Labs, picking a <strong>single</strong> model to serve all of an AI agent&#8217;s needs during a time when new models are being announced every month felt overly constraining. It would mean that we would be adopting all of the model&#8217;s strengths, and need to accept all of its limitations. We avoided this because of:</p><ol><li><p><em>The rising tide</em>. Imagine building an agent using GPT-3 end-to-end. By 2025, no matter how good it was, its overall position would have been eroded, by virtue of being committed to a model that has largely been supplanted. We believe that the same is true going forward.</p></li><li><p><em>The risk of migrations</em>. Imagine building end-to-end with Sonnet 3.7, and then waking up one morning to the announcement of Sonnet 4. Being committed to a single model would force us to think about large, uncertain, and risky upgrades where the <em>entire</em> AI agent might need to be migrated onto a new model.</p></li><li><p><em>The risk appetite of our partners</em>. Some of the companies we work with want the latest &amp; greatest live as quickly as possible, others care less about experimental opportunities and more about consistent outcomes. Being flexible enables us to cater for both!</p></li></ol><p>Ultimately, the flexibility that we desired is that of enabling AI Engineers to pick the ideal model for the building block they are working on&#8212;they would know best where it fits in the overall puzzle, and what trifecta variables they want to trade off against.</p><h2>Uniform interface, reliable service &#10024;</h2><p>While AI Engineers are empowered to pick their choice of model, there are several separate problems that they shouldn&#8217;t need to care about:</p><ol><li><p>Rewriting code to use a different model. We have built an internal abstraction that enables changing models by editing one line, rather than needing to juggle different clients.</p></li><li><p>Observability. We log each completion request that is made, whether it succeeded or failed; this happens inside of our internal abstraction and is invisible to AI Engineers.</p></li><li><p>Picking the model&#8217;s provider. While Open AI and Anthropic models are available directly, many are also available via cloud services providers (Azure, AWS, GCP). Retry and fallback behaviour when any of them are experiencing a hiccup, or if we approach our rate limits, sits in the heart of our platform&#8212;far away from the daily work of AI folks.</p></li></ol><h2>The perfect blend &#9749;&#65039;</h2><p>When people chat with our AI agent, their experience is being driven by a blend of models that are each playing to their unique strengths. Today, that is a blend of Sonnet, Gemini, and GPT models. When a new model is released, we (like many!) are very quickly evaluating different parts of the agent to see what can be quickly improved.</p><p>This, combined with a design that focuses on a conversational &amp; diagnostic-oriented approach to resolution is one of the many reasons why we have seen our agent outperform others when going head to head against them. </p><p>We know, however, that there is yet much to build&#8212;subscribe below to hear all of our updates!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.gradient-labs.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.gradient-labs.ai/subscribe?"><span>Subscribe now</span></a></p><p></p>]]></content:encoded></item><item><title><![CDATA[Safe AI agents in high-stakes industries]]></title><description><![CDATA[Our recent presentation at an AI Agents in Finance workshop]]></description><link>https://blog.gradient-labs.ai/p/safe-ai-agents-in-high-stakes-industries</link><guid isPermaLink="false">https://blog.gradient-labs.ai/p/safe-ai-agents-in-high-stakes-industries</guid><dc:creator><![CDATA[Neal Lathia]]></dc:creator><pubDate>Mon, 03 Feb 2025 11:31:24 GMT</pubDate><enclosure url="https://substackcdn.com/image/youtube/w_728,c_limit/nLP358r2Ryc" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In December, the team at <a href="https://www.multiply.ai/">multiply.ai</a> invited us to the workshop they hosted on AI Agents at the Google London office.</p><p>The full presentation was recorded, and is embedded below. Key highlights:</p><ol><li><p>How we design our agentic systems at <a href="https://gradient-labs.ai/">Gradient Labs</a>, with our key principle: &#8220;what would a human do?&#8221; When a person is working on a task, there is a lot that we do not document &amp; take for granted. At Gradient Labs, we bake this implicit expertise into our agent so that it does not need to be instructed down to the last detail.</p></li><li><p>What is the most basic thing that you need to get right? Having an AI agent that knows what to do when it receives (or, critically, doesn&#8217;t receive) signals from the outside world. The Gradient Labs agent handles this seamlessly by being built as a <a href="https://en.wikipedia.org/wiki/Finite-state_machine">finite state machine</a>.</p></li><li><p>Is retrieval-augmented generation enough? The promise of RAG hides two important problems: majority of a company&#8217;s knowledge is undocumented, and it is rare for &#8220;search &amp; reply&#8221; to lead to good outcomes. At Gradient Labs, we&#8217;ve built a suite of agents that can learn from a company&#8217;s historical data.</p></li><li><p>What are AI agent tools? Empowering an AI agent to use tools (APIs) unlocks opportunities for end-to-end automation, but if you wouldn&#8217;t allow an employee to access all of the tools in your company, how should an AI agent do so safely? At Gradient Labs, our agent&#8217;s choices restrict which tools it can or cannot use.</p></li><li><p>How can you prevent both common AI Agent mistakes and industry-specific ones? At Gradient Labs, we guard against both&#8212;no outcome is safer than a wrong one.</p></li></ol><div id="youtube2-nLP358r2Ryc" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;nLP358r2Ryc&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/nLP358r2Ryc?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p>&#128674; If you would like a deeper dive, I gave a more technical version of this presentation at the <a href="https://home.mlops.community/public/videos/llms-and-the-rest-of-the-owl-neal-lathia-agents-in-production">MLOps Agents in Production</a> event.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.gradient-labs.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[AI agents in 2025]]></title><description><![CDATA[AI agents are all the rage right now, but they&#8217;re really just an implementation detail. Chasing them is like skating to where the puck is instead of where it&#8217;s going.]]></description><link>https://blog.gradient-labs.ai/p/ai-agents-in-2025</link><guid isPermaLink="false">https://blog.gradient-labs.ai/p/ai-agents-in-2025</guid><dc:creator><![CDATA[Dimitri Masin]]></dc:creator><pubDate>Fri, 20 Dec 2024 20:25:50 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/ac9b7b05-be78-4d4d-b75d-dc75a8a9a00c_820x467.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>The transitory nature of &#8220;Build-Your-Own&#8221; AI Agents</strong></p><p>We&#8217;re in the thick of the AI agent hype cycle. Companies are trying to build and deploy their own, and startups are promising platforms to do just that. But does anyone really want to manage an army of custom AI agents?</p><p>What companies truly want is an &#8220;API to a brain&#8221;&#8212;a digital employee they can direct. This &#8220;steerable, safe intelligence on tap&#8221; is the real prize.</p><p>From my experience with ML and MLOps, I understand why some think building agents in-house matters. There is a key difference though: with ML, most models had to be company-specific and trained on unique data. Not so with today&#8217;s generative AI&#8212;it&#8217;s general purpose. Like with human employees, the digital employee would be the same for company A and B. Expecting to build and manage your own AI agents is like running a private university just to hire graduates. No one would do that.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.gradient-labs.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Gradient Labs Team! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p><p><strong>Where Will the Puck Be Next December?</strong></p><p>Instead of DIY AI agents, we&#8217;ll see &#8220;API-to-a-brain&#8221; services&#8212;intelligent, contextual, secure endpoints. These will be domain-specific &#8220;brains&#8221; with superhuman skills in areas like engineering, operations, or customer service&#8212;endpoints that you steer rather than armies you must recruit, train, and manage.</p><p>To get there, innovators have discovered that LLMs and data/action layers alone are just two components. True &#8220;steerable intelligence&#8221; requires a lot more. Here are a few examples from the ops domain that we needed to build on our journey there:</p><ul><li><p><strong>Continuous learning algorithms:</strong> Systems must learn like humans, continuously assimilating new information, staying current, and unlearning outdated or incorrect facts. Distilling knowledge autonomously from new information. This goes beyond traditional fine-tuning and requires robust, dynamic knowledge updating.</p></li><li><p><strong>Deeper understanding:</strong> Standard Retrieval-Augmented Generation (RAG) won&#8217;t cut it for genuine comprehension. We need proprietary knowledge graphs and richer context models that let these brains grasp nuanced user requests and handle intricate domain concepts.</p></li><li><p><strong>Reasoning for specialist skills:</strong> as humans do, intelligent systems need to be taught how to handle deception, manage objections gracefully, deal with vulnerable users, or perform domain specific assessments. Which is not trivial given that systems with more reasoning are progressively harder to steer. This is however the most important property.</p></li></ul><p>And there are many more examples across other domains like autonomous research systems or fully autonomous engineers where action taking and raw LLM output are just the tip of the iceberg.</p><p>Conclusion: AI agents are more of an implementation detail and highly transitory. Building your own agents is like running your own universities just to hire future employees from those. Instead, by next December, the puck will have moved towards out-of-the-box, steerable &#8220;brains&#8221; that can deliver real intelligence on demand.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.gradient-labs.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Gradient Labs Team! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[AI Support Agents - Build vs. Buy?]]></title><description><![CDATA[An evergreen question :-)]]></description><link>https://blog.gradient-labs.ai/p/ai-support-agents-build-vs-buy</link><guid isPermaLink="false">https://blog.gradient-labs.ai/p/ai-support-agents-build-vs-buy</guid><dc:creator><![CDATA[Dimitri Masin]]></dc:creator><pubDate>Wed, 27 Nov 2024 12:28:12 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!s7rb!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93fcda01-b003-463e-8fe0-7d3470c79452_800x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Recently, several prospective clients have asked for my thoughts on building versus buying AI support agents. My typical response is, "You probably shouldn't listen to anyone who is trying to sell it! However, I'm happy to share some objective thoughts that might help :-)"</p><p>Companies considering building their own AI support agents generally fall into two categories:</p><ol><li><p>Group A: Companies that have been working on AI support agents for over six months with a significant investment in personnel (at least 5-10 people) and have generally made substantial progress.</p></li><li><p>Group B: Companies that want to start building soon (or have just begun 1-2 months ago) or have invested in 2-3 people for the project.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.gradient-labs.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Gradient Labs Team! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div></li></ol><p><strong>Perhaps surprisingly, it's usually the Group A that wants to work with us, even though they've already made good progress.</strong> They've had enough time to realize how challenging it is to do it well and that, over time, there's no strategic advantage to building it in-house as tools become readily available to solve the problem out of the box. As an analogy, I don't think anyone would try to replicate Intercom, Zendesk, or Salesforce in-house these days (it&#8217;s quite obvious in hindsight). It&#8217;s much better to focus on efforts which are specific to your company instead. </p><p>For Group B, I usually offer the following advice based on the most frequent mistakes I&#8217;ve seen to help them succeed:</p><ol><li><p>Treat it as a strategic priority and allocate a team of at least 5-10 people full-time to building it. Don't treat it as a side project!</p></li><li><p>Progress will come as a step change. It takes only 1-2 months to get something that works 70-80% of the time (which isn't useful in production). It then takes 9-12 more months to achieve something that works 90% of the time. Depending on your quality standards, you might not see live results for a long time.</p></li><li><p>Give your team enough space to create that step change. You can't expect gradual progress every month. Also there is no general blueprint for high quality results that your team can just copy. Some failed attempts will inevitably happen.</p></li><li><p>While it's tempting to think of this as another platform-building project, you need more than just engineering expertise. You need someone who deeply understands customer support (a domain expert), is willing to read thousands of conversations to improve and test their work, can instruct LLMs and create sophisticated chains of LLM calls. Let's call this person an "unfussy unicorn AI engineer". You can't approach this project with a pure engineering or classical machine learning mindset, as LLMs behave very differently. </p></li><li><p>Finally, set your team an informed target. To give you a benchmark: the best tools out there can achieve 80% handling time reduction for customer ops work like customer conversations plus back-office processes that underpin those conversations. Make sure you have a plan on how to get there, otherwise you might spend a year building something trivial and delay the crucial business impact.</p></li></ol><p>If you're considering building an AI support agent in-house, please reach out. I'm happy to offer a free 30-minute advice session.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.gradient-labs.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Gradient Labs Team! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Getting to a ‘thank you’ with an AI agent]]></title><description><![CDATA[Creating a natural and helpful conversation with an AI agent requires more than just numbers.]]></description><link>https://blog.gradient-labs.ai/p/getting-to-a-thank-you-with-an-ai</link><guid isPermaLink="false">https://blog.gradient-labs.ai/p/getting-to-a-thank-you-with-an-ai</guid><dc:creator><![CDATA[Neal Lathia]]></dc:creator><pubDate>Wed, 11 Sep 2024 13:34:51 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/aa1194b5-689a-4d44-ba1b-5d8627eb74d0_618x206.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>The world is full of metrics</h2><p>Every launch of a next-generation foundation model is always accompanied by a plethora of metrics: how well the new LLM does, compared to its peers, on a series of tasks that, together, embody a notion of &#8216;performance.&#8217; Other than by direct comparisons (with leaderboards like LMSys), this is the best way that researchers currently have to calibrate how one LLM should rank compared to another.</p><p>The customer support automation arena is not dissimilar. Each automation service is often described in terms of volume, deflection, resolution, and the average customer satisfaction scores it achieves. Together, these capture support automation &#8216;performance&#8217; from a business-oriented perspective, and outside of a direct comparison at least enable a high-level distinction of sorts across multiple vendors.</p><h2>Each support conversation is a unique moment</h2><p>High-level metrics will always hide the low-level, case-by-case, experiences. One facet that remains elusive in how we measure things&#8212;either at the LLM or support automation level&#8212;is a concept of &#8220;human level&#8221; interaction. That is, given two completions, bots, or agents that spit out some text, both of which are <em>technically</em> correct or even semantically similar, how can we tell that one is a more natural, fluent, and seamless response to give over the other? Perhaps both of them would have lead to a deflected customer, but (in light of how important customer support is to a company&#8217;s brand) how can we make it a better experience?</p><p>At Gradient Labs, we&#8217;ve been thinking deeply about these questions, less so from the perspective of creating new numbers but more from the point of view of shaping a better experience for our design partner&#8217;s customers. Primarily, we do so by reading a huge number of customer support chats&#8212;both between customers and human agents, and when customers talk to our AI agent. Our ongoing discussions about these currently bring us to three insights, which we describe below.</p><h2>Today&#8217;s chatbots often make customers act robotically</h2><p>A wide range of customer support automation could be described as &#8220;best effort.&#8221; These systems will answer every single customer query by throwing some kind of information at the customer and forcing them to wade through it. They might have workflows that customers must follow to the letter in order to get anywhere, or screw up many times before an escape hatch is offered. Some even encode what seems like a level of keyword matching (&#8220;you must type &#8216;talk to a human&#8217; to be transferred&#8221;).</p><p>Interestingly, <strong>customer</strong> replies in these settings strike us as very robotic. &#8220;Yes.&#8221; &#8220;No.&#8221; &#8220;Talk to a human.&#8221; It&#8217;s as if the customers are bending <em>their</em> communication style to try and speak in the limited language understood by the bot. It can work, for simple cases: as soon as any nuance appears, or even if the customer wants a clarification, these tend to fall over. But, ultimately, having customers talk in a specific, unnatural way seems to be a symptom of people trying to find their way around poor automation.</p><p>Having seen these in action, these systems will, by definition, have a high response rate and will likely have a high deflection rate&#8212;many customers don&#8217;t figure out how to speak robotically enough to resolve their own problem, and so they give up.</p><h2>Tools to speed up support staff make human agents sound robotic</h2><p>A method that we use frequently at Gradient Labs is to compare AI and human replies, side by side. Our initial opinion was that the human response should be considered a &#8220;gold standard&#8221; for what the AI could achieve. However, we ironically found that (in larger organisations) replies from human agents can also not result in a fluid, natural conversation.</p><p>One reason for this is that support staff performance is typically evaluated in ways that implicitly encourages transactional behaviour. If Mike and Alice must take on X support chats per hour, the easiest way to achieve their targets is to reach for the best matching canned response in each turn. This can work, in simpler cases&#8212;where pre-written responses are good enough&#8212;but as soon as there is any nuance or ambiguity in customers&#8217; intents, things go astray.</p><p>At its extreme, we know of cases where human agents have been accused by customers of being bots, when in practice nothing more than canned responses were being sent.</p><h2>Getting to a &#8220;thank you&#8221;</h2><p>There are a lot of qualities that we attend to when making our AI agent more natural-sounding. This goes beyond the standard expectations of AI agents, like making sure that informational replies come from documented sources. It includes more qualitative aspects: replies shouldn&#8217;t be unnecessarily verbose, shouldn&#8217;t ask too many questions at once, shouldn&#8217;t ask about things that have already been said (but sometimes should ask for confirmation about them), should only be apologetic when it&#8217;s relevant, and many more. And one way that we see our AI agent get it right is when customers go so far as saying &#8220;thank you&#8221; for the help they have received.</p><p>Importantly, this is not about obfuscating that the customer is talking to an AI agent or masquerading it as a human&#8212;this is about making the AI agent so easy to talk with that it feels natural to thank it. It&#8217;s somewhat tricky to describe without speaking about the details, but we&#8217;ll close with two anecdotes of this in action.</p><p>Our AI agent had a chat with a customer that was about a fairly complex topic&#8212;understanding which statement month a particular transaction should appear on. While diagnosing the issue, the customer mentioned it is their first month with the service, in the context of not having a billing statement history. Our AI agent&#8217;s next reply acknowledged that by welcoming them to the company as part of its answer to the customer&#8217;s actual question and then worked with them to a resolution. And it ended in a thank you:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2ZPK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57f05e51-1735-4109-b0b2-a1c3b7d92905_618x206.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2ZPK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57f05e51-1735-4109-b0b2-a1c3b7d92905_618x206.png 424w, https://substackcdn.com/image/fetch/$s_!2ZPK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57f05e51-1735-4109-b0b2-a1c3b7d92905_618x206.png 848w, https://substackcdn.com/image/fetch/$s_!2ZPK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57f05e51-1735-4109-b0b2-a1c3b7d92905_618x206.png 1272w, https://substackcdn.com/image/fetch/$s_!2ZPK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57f05e51-1735-4109-b0b2-a1c3b7d92905_618x206.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2ZPK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57f05e51-1735-4109-b0b2-a1c3b7d92905_618x206.png" width="618" height="206" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/57f05e51-1735-4109-b0b2-a1c3b7d92905_618x206.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:206,&quot;width&quot;:618,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:14249,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2ZPK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57f05e51-1735-4109-b0b2-a1c3b7d92905_618x206.png 424w, https://substackcdn.com/image/fetch/$s_!2ZPK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57f05e51-1735-4109-b0b2-a1c3b7d92905_618x206.png 848w, https://substackcdn.com/image/fetch/$s_!2ZPK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57f05e51-1735-4109-b0b2-a1c3b7d92905_618x206.png 1272w, https://substackcdn.com/image/fetch/$s_!2ZPK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57f05e51-1735-4109-b0b2-a1c3b7d92905_618x206.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>In a separate instance, a customer chatted to our AI agent about a delayed payment. The AI agent clarified details about the payment and then not only used relevant sources to create a reply, but intermingled the context given previously in the conversation with the right knowledge to give the customer a tailored response about about when that payment should be visible. It did not reach for a canned-style response &#8220;all payments take 1-2 days&#8221; or just a directly say &#8220;Thursday&#8221; without explanation, it said something akin to &#8220;our payments typically take 1-2 days to clear, which means Thursday in your case.&#8221; It invited the customer to reach back out if that didn&#8217;t come to fruition. And, again, it ended with a thank you:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Kvqv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5716cf39-4c6f-481f-a5a9-5bc4585a9d2d_740x242.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Kvqv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5716cf39-4c6f-481f-a5a9-5bc4585a9d2d_740x242.png 424w, https://substackcdn.com/image/fetch/$s_!Kvqv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5716cf39-4c6f-481f-a5a9-5bc4585a9d2d_740x242.png 848w, https://substackcdn.com/image/fetch/$s_!Kvqv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5716cf39-4c6f-481f-a5a9-5bc4585a9d2d_740x242.png 1272w, https://substackcdn.com/image/fetch/$s_!Kvqv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5716cf39-4c6f-481f-a5a9-5bc4585a9d2d_740x242.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Kvqv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5716cf39-4c6f-481f-a5a9-5bc4585a9d2d_740x242.png" width="740" height="242" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5716cf39-4c6f-481f-a5a9-5bc4585a9d2d_740x242.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:242,&quot;width&quot;:740,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:18873,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Kvqv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5716cf39-4c6f-481f-a5a9-5bc4585a9d2d_740x242.png 424w, https://substackcdn.com/image/fetch/$s_!Kvqv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5716cf39-4c6f-481f-a5a9-5bc4585a9d2d_740x242.png 848w, https://substackcdn.com/image/fetch/$s_!Kvqv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5716cf39-4c6f-481f-a5a9-5bc4585a9d2d_740x242.png 1272w, https://substackcdn.com/image/fetch/$s_!Kvqv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5716cf39-4c6f-481f-a5a9-5bc4585a9d2d_740x242.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Meeting metrics with amazing experiences</h2><p>The discussion above does not mean that we&#8217;re doing away with metrics&#8212;after all, we&#8217;re a technical team and need to summarise our overall progress in a way we can share &#128200;. But every support conversation is a unique moment for a customer; their reach-out is much more than a number to them. Creating a fluid, helpful, and easy conversation with an AI agent needs much more than numbers, and making it feel natural to thank the AI is one way that we&#8217;re seeing it coming into fruition.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.gradient-labs.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.gradient-labs.ai/subscribe?"><span>Subscribe now</span></a></p><p></p>]]></content:encoded></item><item><title><![CDATA[Making customer support automation as simple as writing a document]]></title><description><![CDATA[Our vision on automation of procedural work in customer ops]]></description><link>https://blog.gradient-labs.ai/p/making-customer-support-automation</link><guid isPermaLink="false">https://blog.gradient-labs.ai/p/making-customer-support-automation</guid><dc:creator><![CDATA[Dimitri Masin]]></dc:creator><pubDate>Tue, 23 Jul 2024 06:45:02 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F514e61e2-3d3d-4b17-9324-fc8096f57496_1828x784.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Imagine automating a complex customer support process by simply describing it in plain English and running it as cheaply as machine code, without needing to hire people for months or roll out new processes for weeks. You might not have to wait much longer!</p><p>We believe that over the next 5 years, there will be the first bank, food delivery service, or travel agency with most of its customer ops work done fully autonomously. This will unlock an unprecedented ability to scale and the agility. This new breed of companies will have a fundamental advantage when it comes to cost and quality. </p><p>Let's first consider why this was not possible until now and what has changed.</p><p></p><p><strong>Today, repetitive work gets done manually or automated with workflows</strong></p><p>There are two fundamental ways to complete repetitive customer support tasks in a company: through humans or machines.</p><ul><li><p>Humans need to be hired, trained, and given Standard Operating Procedures (SOP) to follow.</p></li><li><p>Machines currently only execute deterministic tasks/flows that can be expressed as code.</p></li></ul><p>Workflow automation tooling has been widely adopted by many forward-thinking businesses in an attempt to make automation through code simpler and more accessible. Some of these tools have a graphical interface to enable non-technical staff to contribute to process automation.</p><p>However, this approach has largely failed to replace a huge proportion of the manual, repetitive labor in customer ops organisations.</p><p></p><p><strong>Let's consider a simple example to better understand the limits of current workflow automation approaches</strong></p><p>"I can't login" is a great example that applies to almost all businesses that offer a digital account&#8212; it is along the same lines of "I can't signup," "Why was my transaction declined?" or "I can't find my deposit." Customers are reporting a problem which may have a variety of causes and a variety of solutions. In the average enterprise setting, more than 50% of support queries are the types of issues that require a non-linear set of steps to resolve (aka &#8220;Troubleshooting issues&#8220;).</p><p>A human customer support agent would receive guidance that might look something like this (simplified version for illustration purposes):</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!idZ_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd17bf175-9e3c-41fc-95cf-757e9a81de6e_1172x482.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!idZ_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd17bf175-9e3c-41fc-95cf-757e9a81de6e_1172x482.png 424w, https://substackcdn.com/image/fetch/$s_!idZ_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd17bf175-9e3c-41fc-95cf-757e9a81de6e_1172x482.png 848w, https://substackcdn.com/image/fetch/$s_!idZ_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd17bf175-9e3c-41fc-95cf-757e9a81de6e_1172x482.png 1272w, https://substackcdn.com/image/fetch/$s_!idZ_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd17bf175-9e3c-41fc-95cf-757e9a81de6e_1172x482.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!idZ_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd17bf175-9e3c-41fc-95cf-757e9a81de6e_1172x482.png" width="1172" height="482" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d17bf175-9e3c-41fc-95cf-757e9a81de6e_1172x482.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:482,&quot;width&quot;:1172,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:115221,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!idZ_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd17bf175-9e3c-41fc-95cf-757e9a81de6e_1172x482.png 424w, https://substackcdn.com/image/fetch/$s_!idZ_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd17bf175-9e3c-41fc-95cf-757e9a81de6e_1172x482.png 848w, https://substackcdn.com/image/fetch/$s_!idZ_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd17bf175-9e3c-41fc-95cf-757e9a81de6e_1172x482.png 1272w, https://substackcdn.com/image/fetch/$s_!idZ_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd17bf175-9e3c-41fc-95cf-757e9a81de6e_1172x482.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Standard Operating Procedure that covers Login Issues</figcaption></figure></div><p>It's fast to write, easy to understand, and simple to edit by a domain expert. Let's now look at the same procedure represented as a deterministic dialog workflow where a customer can interact with a bot:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CS46!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F514e61e2-3d3d-4b17-9324-fc8096f57496_1828x784.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CS46!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F514e61e2-3d3d-4b17-9324-fc8096f57496_1828x784.png 424w, https://substackcdn.com/image/fetch/$s_!CS46!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F514e61e2-3d3d-4b17-9324-fc8096f57496_1828x784.png 848w, https://substackcdn.com/image/fetch/$s_!CS46!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F514e61e2-3d3d-4b17-9324-fc8096f57496_1828x784.png 1272w, https://substackcdn.com/image/fetch/$s_!CS46!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F514e61e2-3d3d-4b17-9324-fc8096f57496_1828x784.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CS46!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F514e61e2-3d3d-4b17-9324-fc8096f57496_1828x784.png" width="1456" height="624" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/514e61e2-3d3d-4b17-9324-fc8096f57496_1828x784.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:624,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:179510,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!CS46!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F514e61e2-3d3d-4b17-9324-fc8096f57496_1828x784.png 424w, https://substackcdn.com/image/fetch/$s_!CS46!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F514e61e2-3d3d-4b17-9324-fc8096f57496_1828x784.png 848w, https://substackcdn.com/image/fetch/$s_!CS46!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F514e61e2-3d3d-4b17-9324-fc8096f57496_1828x784.png 1272w, https://substackcdn.com/image/fetch/$s_!CS46!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F514e61e2-3d3d-4b17-9324-fc8096f57496_1828x784.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Simplified login troubleshooting workflow</figcaption></figure></div><p>For simplicity, we have skipped most of the paths in that tree, however, modelling all the relevant scenarios and edge cases mentioned in the SOP above would require 60-80 workflow elements in a carefully arranged order. And that's a trivial example.</p><p></p><p><strong>Procedural AI agents provide a vastly superior customer experience</strong></p><p>For workflows to help customers to resolve their issues, customers need to correctly pick the triage tree entries that will lead them to the right resolution path. While this can work well in a simple linear workflow, it often leads to frustrating experiences where customers need to navigate the triage tree back and forth to find the relevant entries. I&#8217;m sure we've all been there and given up occasionally. &#128522;</p><p>Procedure-following AI agents provide a more fluid and enjoyable experience similar to talking to a human. At the current rate of progress, it's also easy to imagine that experience becoming superhuman in 2-3 years. AI agents will be able to figure out the straightest path possible to the resolution, and everything will happen in real-time.</p><p>Beyond the experience of executing a single workflow or SOP, what's really important for the customer experience is how those are triggered and the ability to narrow down on really relevant issues. To use the login issue example above, if the customer says, "I can't login and see a red banner in the app," should they really be shown the whole login issues workflow with all the irrelevant choices where an intelligent operator would jump straight to offering a solution? Unlike AI agent, workflows are generally not able to rely on conversational context.</p><p></p><p><strong>Workflows are complex to create, maintain, and test</strong></p><p>Anyone who has had to model even a moderately complex process through workflows knows how laborious and complicated it is. The writer needs to painstakingly enumerate all the possible paths in the tree and make sure there are no loops. Once created, the burden doesn't stop there; try keeping up with business changes if there are hundreds of connected boxes in front of you and you need to adjust exactly the right ones.</p><p>SOPs, on the other hand, are much more scalable because they are written with intelligent operators in mind. These operators can fill in the gaps, make common-sense assumptions, and hold relevant company and product context in their memory, which the SOP itself does not need to be explicit about. We have found that even smaller enterprises will usually quickly grow to having <em>hundreds</em> of SOPs documenting different customer support procedures.</p><p></p><p><strong>Workflow tooling is too technical for domain experts (and too visual for engineers)</strong></p><p>Despite the promise of low or no-code tools, ops staff often cannot operate workflows by themselves&#8212;they need to call in Engineers to configure the workflow to do anything meaningful. Conversely, engineers&#8217; regularly feed back that they prefer to use code rather than draw boxes on the screen or copy &amp; paste API endpoints into a form. Hence, the ideal user profile for workflow creation and maintenance is rare in organisations.</p><p></p><p><strong>The solution? Procedural AI agents</strong></p><p>At Gradient Labs, we&#8217;re building AI agents that automate manual, repetitive work. As part of this, we&#8217;re doing away with the concept of box &amp; arrow workflows altogether. Instead, we&#8217;re developing an engine for AI agents to safely follow SOPs that are written in plain English. Drawing from the lessons above, we&#8217;re aiming for:</p><ul><li><p>Customers to get a faster, more fluid, and enjoyable experience, similar to talking to a human;</p></li><li><p>Ops domain experts to be empowered to own the logic of automation in an accessible way, similar to instructing a colleague, and</p></li><li><p>Engineers to be able to give the AI agent relevant data and actions in a similar way that they ship code to production</p></li></ul><p>Put together AI agents that can follow procedures (SOPs) have the potential to unlock meaningful automation that was never feasible before. Based on our estimates, it's possible to automate 70-80% of today's manual customer ops work, and most likely even more as the technology advances over the years to come. The key is to combine the simple yet expressive authoring of SOPs with the ability to execute those fully autonomously through AI agents.</p><p></p><p>If you are equally excited about defining the future of automation, either by becoming a part of our team or as a potential customer, please don't hesitate to reach out. &#128522;</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://gradient-labs.notion.site/Careers-Gradient-Labs-e2b70580480e4e6dbe0895873bc2fb00&quot;,&quot;text&quot;:&quot;Join us&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://gradient-labs.notion.site/Careers-Gradient-Labs-e2b70580480e4e6dbe0895873bc2fb00"><span>Join us</span></a></p>]]></content:encoded></item><item><title><![CDATA[Building agentic workflows]]></title><description><![CDATA[How we're navigating the abstract process of designing and building AI agents]]></description><link>https://blog.gradient-labs.ai/p/building-agentic-workflows</link><guid isPermaLink="false">https://blog.gradient-labs.ai/p/building-agentic-workflows</guid><dc:creator><![CDATA[Neal Lathia]]></dc:creator><pubDate>Mon, 24 Jun 2024 15:01:45 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!bupe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12d9ff06-4a3b-47ed-a38b-dcd1db1eddbb_1268x642.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>At Gradient Labs, we&#8217;re building a suite of AI agents that automate manual, repetitive work&#8212;starting with customer service. There are two major areas to this: the platform that enables AI agents to operate (which we &#129417; <a href="https://blog.gradient-labs.ai/p/drawing-the-rest-of-the-owl">previously wrote about</a>), and the AI agents themselves.</p><p>We&#8217;re always soaking up as many blog posts about AI agents as we can find: recently, we&#8217;ve seen that a lot of them have been focusing on the criteria to <em>qualify software as an AI agent</em>&#8212; is it just code that makes more than one LLM call, or perhaps something else? As Andrew Ng <a href="https://info.deeplearning.ai/apples-gen-ai-strategy-stabilitys-copyright-clear-audio-generator-international-safety-agreements-llms-play-doctor-1">wrote</a>, perhaps the technical definition of &#8220;agent&#8221; doesn&#8217;t matter as much as the capabilities and impact that can be achieved via agentic systems, and so instead of thinking about <em>what</em> agents are, we&#8217;re back to the age-old questions of <em>organising a group of people</em> to build a novel type of system, in safe and scalable way&#8212; starting from its design and going all the way through to where we write what code.</p><h2>&#8220;What would a human do?&#8221;</h2><p>Humans are really good at reasoning <em>by instinct</em> when working on abstract tasks. For example, if you were a support agent and a customer asked &#8220;hey, can you change my flight?&#8221; then you may <em>instinctively</em> redirect them elsewhere if you work at food delivery company&#8212; you know, without having been told, that the question is out of bounds. Or, if you did happen to work at a travel company, you might <em>instinctively</em> know to ask the customer clarifying questions if they have no bookings in the system instead of saying yes but then not knowing what to change.</p><p>LLMs, on the other hand, while increasingly powerful (as <a href="https://arxiv.org/abs/2312.01044">zero-shot classifiers</a>, as <a href="https://arxiv.org/abs/2402.02716">planners</a>, and as summarisers, and <a href="https://arxiv.org/abs/2304.03442">beyond</a>), tend to do better when given <a href="https://arxiv.org/abs/2401.14423">clear,</a> <a href="https://trigaten.github.io/Prompt_Survey_Site/">explicit</a> instructions rather than being given overly abstract tasks. It&#8217;s currently infeasible to expect LLMs to &#8220;instinctively&#8221; do the right thing within a realistic setting. That means that a starting point when designing an agentic system is to try and map out, in broad brushstrokes, what these implicit instincts that humans have might be. For example, given a question from a customer, humans might implicitly answer a range of questions: is it clear? Is it relevant? Is it ambiguous? Is it threatening? Is it a greeting or a farewell? Does it sound vulnerable? Each one of those questions can be encoded as a discrete, explicit task for an LLM to tackle.</p><p>From the perspective of someone <em>building</em> an agentic system, it&#8217;s then much easier to evaluate and reason about individual components, rather than treating the &#8220;AI&#8221; as an impenetrable black box. For us, from a technical perspective, each of these skills is a <a href="https://docs.temporal.io/activities">Temporal Activity</a> so that it can be automatically retried when it fails.</p><p>After building a family of skills, the exercise becomes one of composing skills together and getting them to be executed effectively, where they can be interleaved with business logic to suit different companies and conversational scenarios. To do that, we build at two levels of abstraction: the task level (as a state machine), and the LLM level (as chains of skills).</p><h2>Tasks as state machines</h2><p>Imagine an extremely simplistic representation of a conversation between me and you. There could be three states:</p><ul><li><p><em>I&#8217;m listening &#8212;</em> a state where you speak, and all I need to do is to keep up with what you&#8217;re saying (and not get distracted &#128563;&nbsp;)</p></li><li><p><em>I&#8217;m talking &#8212;</em> a state where I need to figure out what to say, and then say it (hoping to say something relevant &#128519;&nbsp;)</p></li><li><p>The end state, where the conversation has finished after you say goodbye &#128075;&#127997;</p></li></ul><p>The states and a minimal set of transitions could look like this:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bupe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12d9ff06-4a3b-47ed-a38b-dcd1db1eddbb_1268x642.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bupe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12d9ff06-4a3b-47ed-a38b-dcd1db1eddbb_1268x642.png 424w, https://substackcdn.com/image/fetch/$s_!bupe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12d9ff06-4a3b-47ed-a38b-dcd1db1eddbb_1268x642.png 848w, https://substackcdn.com/image/fetch/$s_!bupe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12d9ff06-4a3b-47ed-a38b-dcd1db1eddbb_1268x642.png 1272w, https://substackcdn.com/image/fetch/$s_!bupe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12d9ff06-4a3b-47ed-a38b-dcd1db1eddbb_1268x642.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bupe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12d9ff06-4a3b-47ed-a38b-dcd1db1eddbb_1268x642.png" width="1268" height="642" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/12d9ff06-4a3b-47ed-a38b-dcd1db1eddbb_1268x642.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:642,&quot;width&quot;:1268,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:83026,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bupe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12d9ff06-4a3b-47ed-a38b-dcd1db1eddbb_1268x642.png 424w, https://substackcdn.com/image/fetch/$s_!bupe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12d9ff06-4a3b-47ed-a38b-dcd1db1eddbb_1268x642.png 848w, https://substackcdn.com/image/fetch/$s_!bupe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12d9ff06-4a3b-47ed-a38b-dcd1db1eddbb_1268x642.png 1272w, https://substackcdn.com/image/fetch/$s_!bupe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12d9ff06-4a3b-47ed-a38b-dcd1db1eddbb_1268x642.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>Agentic workflows can also be formulated as (much more) complex state machines. This enables us to reason about the messy world of dialog, catering for things like stopping any work if a human agent steps in, reaching back out to customers who seem to have stopped responding, invoking tools, waiting for a human-in-the-loop to approve an action, and beyond.</p><p>From our point of view, as builders: state machines are a well-established pattern that facilitates reasoning about high-level behaviour of our agent while staying away from the non-deterministic LLMs that sit under the hood. We represent each conversation in our platform as a <a href="https://docs.temporal.io/workflows">Temporal Workflow</a>, where states can receive <a href="https://docs.temporal.io/encyclopedia/application-message-passing#signals">signals</a> when external events occur that require the workflow to interrupt whatever it is currently doing and move into a different state.</p><h3>We&#8217;ve stayed away from multi-agent collaborating, for now</h3><p>A popular topic that we&#8217;ve noted in papers and blog posts is about <a href="https://github.com/geekan/MetaGPT">multi-agent systems</a>. One way these are built is by decomposing the work required to perform a task into different personas. For example, generating software (which is one of the most popular topics in the literature these days!) could be broken down into the &#8220;product manager&#8221; persona, the &#8220;software engineer&#8221; persona, the &#8220;quality tester&#8221; persona, and so on.</p><p>At the end of the day, this is still LLM calls that are stacked into a hierarchy&#8212; just organised in a slightly different way. However, from a builder&#8217;s perspective, mapping agentic workflows <em>back</em> into the roles that humans developed to do the same tasks (as opposed to the skills that are used to accomplish that task) <em>feels</em> like an anti-pattern&#8212;but we might be wrong. Is it the product manager or software engineer who is in charge of clarifying ambiguous requirements?</p><p>At this early stage, this is a level of ambiguity and complexity that we have naturally veered away from and our agentic workflows are assumed to be able to <a href="https://openreview.net/forum?id=CbsJ53LdKc">impersonate</a> all of the skills they need to automate the entirety of the task they are being designed to handle. So that means that we spin up a new agent when we have a new high-level task to automate (say, a content editor).</p><h2>The agent: planning, reasoning, executing</h2><p>Looking back at that simplistic state machine, it might still look pretty vague. What does the &#8220;I&#8217;m talking&#8221; state actually translate into? This is the part of our system that most closely resembles the emerging arena of <a href="https://www.deeplearning.ai/the-batch/how-agents-can-improve-llm-performance/">agentic design patterns</a>:</p><ul><li><p>The planner inspects the current conversation and the available chains to pick the best chain and back out of ineligible conversations;</p></li><li><p>The best chain is executed first (falling back to other options);</p></li><li><p>Each chain might have a series of classification, search, reasoning, and completion steps &#8212; and emits one or more <em>events</em> (such as &#8220;I decided X&#8221; or &#8220;I classified this as Y&#8221;) and <em>operations</em> (i.e. &#8220;say X&#8221; or &#8220;call tool Y&#8221; or &#8220;hand this conversation off to Z&#8221;).</p></li><li><p>Before these operations are acted on, they are checked &#8212; with guardrails and other consistency checks to make sure the agent rarely does contradictory or undesired things.</p></li></ul><p>From a builder&#8217;s perspective, this ends up as coding up a large, non-deterministic <a href="https://en.wikipedia.org/wiki/Directed_acyclic_graph">directed acyclic graph</a>. By starting at the top (the planner) and inspecting the events we can trace all of the decisions that the workflow has made to reach its conclusion.</p><p>One of the neat things about this structure is that we don&#8217;t need to reason about higher-level questions (such as &#8220;what if the customer writes in again midway through planning?&#8221;) while we implement these skills. Equally, we don&#8217;t need to reason about lower-level questions (such as &#8220;what if this LLM call is rate limited?&#8221;) because we can just error and let Temporal take care of retries. Most importantly: we can run this agent as both a live-agent, responding to customers, and a simulated-agent&#8212; just asking it &#8220;what would you do next here?&#8221; &#8212; which unlocks our entire approach to evaluation.</p><h2>Putting it together</h2><p>As we continue to grow, finding a way to structure our agentic workflows is enabling us to map the parts of the agents that we build back into the disciplines in our team, such that each person is playing to their strengths, the level of abstraction they want to work with, and their domain expertise. Having the structure above has&#8212; to date, one year in&#8212; really helped to cement all things from our high-level design approach (&#8221;what would a human do?&#8221;) through to the lowest details (how we structure our code bases). </p><p>Have you taken a similar approach, or have you found a different path that works for you? We&#8217;d love to chat about it!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.gradient-labs.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.gradient-labs.ai/subscribe?"><span>Subscribe now</span></a></p><p></p>]]></content:encoded></item><item><title><![CDATA[Going beyond RAG for customer support conversations]]></title><description><![CDATA[Chasing our ambition for superhuman quality support]]></description><link>https://blog.gradient-labs.ai/p/going-beyond-rag-for-customer-support</link><guid isPermaLink="false">https://blog.gradient-labs.ai/p/going-beyond-rag-for-customer-support</guid><dc:creator><![CDATA[Dimitri Masin]]></dc:creator><pubDate>Mon, 10 Jun 2024 13:24:50 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/cba38be6-3e65-4d6e-9e4d-bd1bc160da0f_4800x2512.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In a <a href="https://blog.gradient-labs.ai/p/are-ai-agents-just-rag-in-disguise">recent post</a>, we discussed how Retrieval Augmented Generation (RAG) is just one piece of the puzzle in building customer support AI agents. Today, we'll a dive a bit deeper into these issues&#8212;at Gradient Labs, we want to empower our customers to deliver <em>superhuman</em> AI support experiences to their end users.</p><p>The key insight? Real world support conversations are a lot messier than what RAG can usefully handle.</p><h3><strong>Human support agents seek to understand intent</strong></h3><p>RAG agents rely on semantic similarity search to ground their answers in truth. While this helps to avoid hallucinations, they often provide only "best effort" replies as long as enough semantically similar content is found. In effect, a lot of RAG is tuned for a <em>single</em> question and reply rather than a long-form conversation.</p><p>Human agents, however, are expected to <em>understand</em> the true, specific intent behind a customer&#8217;s query. They have a non-fuzzy world model of the company&#8217;s products, processes, and related user activities, which then allows them to pattern match customer&#8217;s question to that world model in a more structured and precise way.  For instance, if a customer says, &#8220;Why can&#8217;t I pay?&#8221;, it&#8217;s easy for a human to reason about what&#8217;s missing in that query and to instinctively ask for clarification about the missing, implied, information in order to help effectively. </p><h3><strong>Taking customer queries at face value is inaccurate</strong></h3><p>Customers can make statements that are technically inaccurate, like saying, &#8220;My card is broken,&#8221; when they mean a transaction was declined. Or they might say, &#8220;Somebody took my money,&#8221; when they simply forgot about a prior transaction. In extreme cases, customers might try to be deceitful, particularly in fraud scenarios.</p><p>RAG approaches take these statements at face value, often resulting in irrelevant or harmful responses.</p><h3><strong>Implicit knowledge from human agent&#8217;s experience is invaluable</strong></h3><p>Even the best-maintained knowledge bases have gaps and can become outdated&#8212;permanently, when a product changes, or temporarily, when a marketing campaign is being run for a day.</p><p>Human agents rely heavily on their shared experience from handling numerous cases, from their training, and from company-wide announcements that may not be documented. Experienced human agents can quickly deduce common patterns, like symptom X usually leading to outcome Y, even if X can theoretically arise from other causes. Standard RAG agents lack this practical shortcutting ability and tend to perform poorly in troubleshooting scenarios. </p><p>While the underlying documents could be updated with a lot of effort to include such information, there are also other approaches, as outlined in a <a href="https://research.google/blog/amie-a-research-ai-system-for-diagnostic-medical-reasoning-and-conversations/">research paper</a> from Google on medical diagnosis. We&#8217;ve found that AI agents can extract a lot of value from reading historical conversations and building their own facts. One needs to be particularly careful with this approach, however, in order not extract wrong or irrelevant information.</p><h3><strong>Complex scenarios</strong></h3><p>Customers often describe complex situations with partially irrelevant details where human agents first identify &#8220;the crux of the issue&#8221; before responding. For example: &#8220;I was travelling abroad last week and paid my hotel with my card. They charged &#163;1000 and said &#163;300 would be refunded. I had an additional restaurant bill of &#163;100, but they refunded only &#163;150.&#8221; </p><p>We have seen first hand that standard RAG agent approaches do not reply anything helpful in such situations and can cause confusion and frustration. While the retrieved documents might provide the relevant context on what to expect with hotel card reservations, RAG agents will not try to apply appropriate reasoning techniques by default. To solve such cases they need to recognise such cases explicitly and switch to a different &#8220;reasoning mode&#8221; internally. To a human agent on the other hand it&#8217;s immediately obvious that the customer was expecting a refund of &#163;200 but has received only &#163;150.</p><h3><strong>Putting it all together</strong></h3><p>Real-world customer support involves multi-turn conversations, unlike the single-turn question-answer pairs typical of RAG. These conversations progress through multiple phases. They usually begin by understanding the &#8220;real&#8221; customer intent, which might involve asking clarifying questions to grasp the situation correctly before providing an answer. Even after providing an answer, the conversation often continues, with customers seeking further clarification or adding more details. The multi-turn agent must navigate these phases fluently to deliver a magical support experience, akin to the best human agents.</p><p>Until we address these challenges, AI-driven conversations will feel <em>deceptively</em> good but will be riddled with issues due to a lack of real context understanding. </p><p>We envision a future with superhuman quality support experiences. If you&#8217;re excited about that vision and the challenges ahead that we&#8217;ve outlined, we&#8217;d <a href="https://gradient-labs.notion.site/Careers-Gradient-Labs-e2b70580480e4e6dbe0895873bc2fb00">love to hear from you</a>!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.gradient-labs.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.gradient-labs.ai/subscribe?"><span>Subscribe now</span></a></p><p></p>]]></content:encoded></item><item><title><![CDATA[Are AI agents just RAG in disguise? 🙈]]></title><description><![CDATA[Spoiler alert: no.]]></description><link>https://blog.gradient-labs.ai/p/are-ai-agents-just-rag-in-disguise</link><guid isPermaLink="false">https://blog.gradient-labs.ai/p/are-ai-agents-just-rag-in-disguise</guid><dc:creator><![CDATA[Danai Antoniou]]></dc:creator><pubDate>Mon, 13 May 2024 15:07:43 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!s7rb!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93fcda01-b003-463e-8fe0-7d3470c79452_800x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Typical AI agents demos are awash with examples of bots that answer simple questions. These types of bots, when applied in a customer support setting, act as first line of help for companies that are scaling: customers can get quick <em>best-effort</em> answers, and companies can be a little less inundated. In 2024, the main approach that is in vogue to build this type of capability is <em>Retrieval Augmented Generation</em>, or <a href="https://arxiv.org/abs/2005.11401">RAG</a>, with large language models.</p><p>At <a href="https://gradient-labs.notion.site/Careers-Gradient-Labs-e2b70580480e4e6dbe0895873bc2fb00">Gradient Labs</a>, we are building an operating system of AI agents that automate manual, repetitive work&#8212;starting with customer service. We therefore could not escape investigating RAG in depth as we started out and are often asked whether this is the main technological approach that we are working on.</p><h3><strong>RAG is a more general solution to existing methods</strong></h3><p>The history of the tech that underlies question-answering in customer service has been one of progressive automation. Fifteen years ago, &#8220;bots&#8221; were likely nothing more than manually curated flowcharts under the hood. Ten years ago, they were probably starting to be powered by basic, custom machine learning classifiers. Five years ago (when we <a href="https://www.slideshare.net/neal.lathia/using-language-models-to-supercharge-monzos-customer-support">built a bot called Monzo Helper</a>), the latest systems were powered by the first wave of pre-trained models like <a href="https://arxiv.org/abs/1810.04805">BERT</a>. And now, the headline-grabbing approach is RAG with LLMs.</p><p>The crux of the approach is to inject relevant search results (<em>retrieval-augmented</em>) as input context for LLMs to produce (<em>generate</em>) answers. <a href="https://arxiv.org/abs/2312.10997v3">A lot has been written</a> about how RAG succeeds and fails, and there&#8217;s a <a href="https://datamachina.substack.com/p/data-machina-235">growing literature</a> of practical resources on how to get more out of it. In effect, RAG promises to be a huge leap towards a <em>general</em> solution for question-answering: index documents into your vector store of choice, link it up with your favourite LLM, and you&#8217;re off to the races.</p><h3><strong>RAG is a thin slice of the customer support problem space</strong></h3><p>We originally thought that RAG was the no-brainer starting point for working with our design partners. But, for some of them, RAG would not automate a meaningful amount of their work. We&#8217;re now, broadly, dividing the companies we work with across several intersecting groups:</p><ul><li><p><strong>General information</strong>: companies with broad, diverse, complex, or multi-featured digital products tend to have customer demand that is dominated by questions seeking information (&#8220;how do I&#8230;?&#8221;)</p></li><li><p><strong>Personal information: </strong>there are companies with inbound demand that is dominated by requests about the customers&#8217; personal situation&#8212; their account, their booking, their transaction, their order<em> </em>(&#8220;what is the status of my&#8230;?&#8221;) </p></li><li><p><strong>Procedural:</strong> there is a large segment of companies where agent&#8217;s work is dictated by procedures which are characterised by a combination of investigative and action-taking work&#8212;refunds, upgrades, cancellations, modifications and more (&#8220;can you&#8230;?&#8221;)</p></li></ul><p>Many companies have a blend of all three, with the balance tipped one direction or another based on what the core business is. For example, tech companies that offer or mediate services in the real world are often more characterised by procedural inbound than information-seeking queries. For the category of businesses that get little to no <em>general</em> information-seeking questions, standard RAG would have very little impact. For companies that are predominantly asked about personal information, standard RAG would lead to frustrating and long-winded customer experiences.</p><p>And so a wider set of capabilities needs to be built. Tool use and procedure orchestration and execution are front runners here, as well as the meta-capabilities of knowing <em>when</em> to use which approach to solve a specific kind of query.</p><h3><strong>RAG has dangerous, niche failure modes</strong></h3><p>Okay, so there&#8217;s still a slice of the market where RAG could be useful. But how well is it working out? There&#8217;s a growing list of public cases where bots (that <em>might</em> be using some form of RAG under the hood?) <a href="https://www.bbc.com/travel/article/20240222-air-canada-chatbot-misinformation-what-travellers-should-know">write answers that are wrong</a>. Understanding, diagnosing, and mitigating these errors is a nuanced exercise that requires looking at the entire stack of RAG components.</p><p>At the highest level, it is immediately clear that the quality of the document corpus that is available to run RAG over is critical, since RAG aims to generate answers from that input. Mostly, however, documents are written <em>for human consumption</em>&#8212;either publicly, as articles that get published online, or privately, in internal company knowledge bases. Chunking and indexing documents in a vector store and hoping for the best readily results in generating answers where customers are told to get in touch (which is <em>literally</em> what they are already doing) or disclosing information that is meant to be internal-only, which could lead to <a href="https://en.wikipedia.org/wiki/Proceeds_of_Crime_Act_2002#Part_7">breaking the law</a> in regulated environments. And this does not even touch on the problem that a lot of company corpora are not only outdated but also largely incomplete.</p><p>Consider a more nuanced example: a customer writes into a multinational fintech asking &#8220;how do I open an account?&#8221; A RAG system with all of the usual bells and whistles may find a document on opening accounts, and generate a reply enumerating the required steps. At a first glance, this may look great! But, digging deeper, what if that customer was writing in from a country <em>where that company does not operate</em>? Suddenly the answer is not just incorrect, it is misleading. In this case, the &#8216;right&#8217; thing for the AI agent to do would have been to discover, diagnose, and reason about facts that are <em>absent</em> in the originating query&#8212;perhaps more akin to the design thinking that is applied in the <a href="https://research.google/blog/amie-a-research-ai-system-for-diagnostic-medical-reasoning-and-conversations/">context of medical diagnosis</a>&#8212;capability that goes well beyond out-of-the-box RAG.</p><p>The &#8216;right&#8217; answer, in other cases, may be no answer at all. Consider a customer who is asking an informational query but exhibiting the hallmark signs of financial distress or <a href="https://www.fca.org.uk/publications/finalised-guidance/guidance-firms-fair-treatment-vulnerable-customers">vulnerability</a>. The right thing to do is to identify vulnerability as the <em>overarching</em> problem and redirect the customer to the right team, not answer their informational query.</p><h3><strong>Squaring the circle</strong></h3><p>There is no doubt that multi-turn question-answering is an important quality of a <em>fully capable AI agent</em>, albeit smaller in many cases than is commonly believed. RAG is also on its way towards becoming a commodity SaaS technology itself&#8212;but the experiments we ran here also urge caution to treating RAG&#8217;s standard formulation as a magical solution. The research literature on this topic is growing, and we&#8217;re following it as closely as we can&#8212;pulling promising ideas and testing them out as we iterate and refine. </p><p>But it is only one piece of the wider picture: AI agents that automate manual, repetitive work will need to go well beyond the scope of today&#8217;s RAG. To following along on our journey, subscribe below!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.gradient-labs.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.gradient-labs.ai/subscribe?"><span>Subscribe now</span></a></p><p></p>]]></content:encoded></item><item><title><![CDATA[Drawing the Rest of the Owl 🦉]]></title><description><![CDATA[Backend Engineering at Gradient Labs &#129404;]]></description><link>https://blog.gradient-labs.ai/p/drawing-the-rest-of-the-owl</link><guid isPermaLink="false">https://blog.gradient-labs.ai/p/drawing-the-rest-of-the-owl</guid><dc:creator><![CDATA[Dan Upton]]></dc:creator><pubDate>Fri, 03 May 2024 09:24:30 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!s7rb!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93fcda01-b003-463e-8fe0-7d3470c79452_800x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>We are building an operating system of AI agents that automate manual, repetitive work&#8212;starting with customer service.</em></p><p>A natural starting point for building AI agents is to think about prompting large language models (LLMs). But what else needs to happen? The software engineering practices of taking agents into production and turning their output into automated work are complex and not well trodden. And handling LLMs is only <em>one slice</em> of what otherwise needs to become an end-to-end system that integrates with companies that operate with a host of diverse systems.</p><p>The entire arena beyond LLM prompting is what we, at Gradient Labs, are affectionally calling&nbsp;<a href="https://knowyourmeme.com/memes/how-to-draw-an-owl">&#8220;the rest of the owl.&#8221;</a> Or, more simply: <em>our backend platform</em>.</p><p><strong>The core of our backend platform now has five areas</strong></p><p>The crux of our backend platform is similar to what we have used in the context of building banks and infrastructure automation software: Go services.</p><ul><li><p><strong>External-facing</strong> <strong>services.</strong> AI agents need to respond to and interact with the outside world. These services bridge between it and our platform. They connect us to a growing range of support platforms and enable companies to integrate directly <a href="https://api-docs.gradient-labs.ai/">with our API</a>.</p></li><li><p>There are a growing range of <strong>resources</strong> (conversations, documents, procedures, tasks) that form the core of our platform. Each one lives in its own service, with a&nbsp;<a href="https://martinfowler.com/bliki/BoundedContext.html">bounded context</a>.</p></li><li><p><strong>A <a href="https://en.wikipedia.org/wiki/Finite-state_machine">finite-state machine</a></strong> that models conversations and is responsible for triggering our first AI agent, dispatching actions, and handling failures.</p></li><li><p>The <strong>agents</strong> themselves, which we currently deploy separately in order to enable more rapid experimentation, and</p></li><li><p>Finally, an <strong>orchestrator</strong> over many of today&#8217;s popular language model APIs, like Open AI&#8217;s GPTs and Anthropic&#8217;s Claude(s).</p></li></ul><p><strong>Our stack is both familiar and new</strong></p><p>Deciding on which technology to use is an exercise in budgeting&nbsp;<a href="https://mcfunley.com/choose-boring-technology">innovation tokens</a>&#8212;we love to try new tools, but we're building AI agents, not infrastructure, so it's important to pick the ones that give us the greatest leverage. There are two that now have a cornerstone role in our backend platform:</p><p><a href="http://Encore.dev">Encore.dev</a> is the backend engine that we use to ship our Go services backed by Postgres databases and Pub/Sub to our own cloud provider account. Its code-first approach means we don&#8217;t need to think about provisioning and maintaining anything under the hood; Encore manages everything from environments through to deployments. We even do our similarity-search using Postgres, which is natively supported by Encore, and <a href="https://github.com/pgvector/pgvector">pgvector</a>. Most serendipitously, Encore gave us a lot of <em>convention and structure</em>, out of the box&#8212;which we would otherwise have had to create.</p><p><strong><a href="http://Temporal.io">Temporal.io</a></strong> is our choice of toolkit for tackling a range of issues that plague distributed systems. Requests partially fail or time out, providers get overwhelmed and fall over, autoscalers abruptly terminate instances, and&#8212;especially for companies like us&#8212;LLMs get rate-limited or return a garbage completions. We are now crafting our way of intersecting Encore APIs with Temporal workflows, activities, and signals to structure our long-running, highly parallel processes for resilience and fault-tolerance.</p><p>Beyond these, we&#8217;ve also adopted <a href="https://incident.io/">Incident.io</a>, <a href="https://vercel.com/">Vercel</a>, Google&#8217;s BigQuery, and more as we expand our platform. But this is just the start! We are 2,831 pull requests into this journey, and this post was just coarse brush strokes of what we&#8217;re building and there is much more to come.</p><p>To hear from us again, please make sure that you&#8217;ve subscribed below!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.gradient-labs.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.gradient-labs.ai/subscribe?"><span>Subscribe now</span></a></p><p></p>]]></content:encoded></item><item><title><![CDATA[👋 We’re Gradient Labs]]></title><description><![CDATA[And here's what we're up to &#10024;]]></description><link>https://blog.gradient-labs.ai/p/were-gradient-labs</link><guid isPermaLink="false">https://blog.gradient-labs.ai/p/were-gradient-labs</guid><dc:creator><![CDATA[Neal Lathia]]></dc:creator><pubDate>Fri, 26 Apr 2024 12:54:45 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!s7rb!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93fcda01-b003-463e-8fe0-7d3470c79452_800x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hello! We are <a href="https://gradient-labs.ai/">Gradient Labs</a>, a London-based AI startup founded in mid-2023.</p><p><em>We are building an operating system of AI agents that automate manual, repetitive work.</em></p><p>We are starting with customer support. Having worked within Ops at companies experiencing exponential growth, this is an area that is close to our hearts. It is painful to scale while ensuring that quality remains high; it is challenging to automate&#8212;particularly in regulated, risk-averse environments&#8212;because question-answering bots only skim the surface of the problem.</p><p>We do not believe in AI as a co-pilot: true, scalable, high quality automation will come from spending time supervising, evaluating, and course-correcting the work of AI agents, rather than being nudged by AI recommendations. So the practices that are common today need to be redefined: giving companies deep insight and control of the quality, observability and safety of work that is automated is at the core of what we&#8217;re building alongside the AI agents themselves.</p><p>As of April 2024, we&#8217;re working with eight design partners that span fintech, insure tech, online marketplaces, food delivery, travel, and crypto. Many of them are household names in their home countries. We&#8217;re also grateful to be funded by <a href="https://localglobe.vc/">Local Globe</a> and many wonderful angel investors who are former colleagues, friends, and family.</p><p>The current idea for this blog is to publish short, specific posts about the AI, Engineering and Product problems and ideas that we are grappling with. Think of it as a small window into what is happening behind the scenes of a sub-10 person startup that is on the verge of going live for the first time. Or, think of it as what you&#8217;d hear us talk about if you randomly joined us for a 30 minute coffee. If that sounds like your thing, subscribe to receive our updates below.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.gradient-labs.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.gradient-labs.ai/subscribe?"><span>Subscribe now</span></a></p><p></p>]]></content:encoded></item></channel></rss>