Section Insights
Introduction to LangSmith Engine
What is the purpose of the LangSmith Engine?
The LangSmith Engine is designed to enhance agent observability and facilitate the improvement loop for agents built on the LangChain platform. It addresses common issues encountered during agent development and evaluation.
- LangSmith Engine aims to improve agent performance through better observability.
- The development process revealed recurring issues that needed addressing.
- Customers often face challenges with manual trace analysis, leading to micro-regressions.
Functionality of the Engine
How does the Engine improve agent evaluation?
The Engine clusters error traces into actionable issues, generates fixes, and enhances evaluation suites for both online and offline assessments. It has evolved significantly based on customer feedback.
- Engine automates the identification and resolution of agent issues.
- It has been refined through collaboration with early customers.
- The initial version was rudimentary but effective in surfacing issues.
Technical Architecture of the Engine
What is the architecture behind the Engine's functionality?
The Engine operates on a multi-tenant orchestration system that processes traces from various agents, allowing for efficient issue identification and fix generation. It separates issue identification from the fixing process for better clarity.
- The Engine uses a distributed task queue for efficient processing.
- Traces provide valuable insights into agent performance in real-world scenarios.
- Separation of issue identification and fixes enhances the clarity of the evaluation process.
Customer Feedback and Customization
How does Engine adapt to different customer needs?
Engine learns from customer interactions, allowing it to prioritize issues based on user feedback and adjust its focus according to what matters most to each team. This customization enhances its effectiveness.
- Engine adapts its functionality based on specific customer feedback.
- Different teams have varying priorities regarding agent performance issues.
- The agent overview acts as a memory file to tailor the Engine's responses.
Evaluating Engine's Performance
How do we assess the effectiveness of the Engine?
The effectiveness of Engine is evaluated through rigorous assessments and user feedback. Continuous monitoring of performance metrics and customer insights helps ensure it meets evolving needs.
- Regular evaluations are crucial for understanding Engine's performance over time.
- User feedback is a key indicator of the Engine's effectiveness.
- Prompt engineering remains important in capturing customer needs.
Transcript
0:05 Hey, everybody. We are really excited about the announcement and the launch of LangSmith Engine. We really see this, as Harrison said in his keynote, as the future of agent observability and of evaluation and of spinning this agent improvement loop. And what we want to do today is walk you through the process by which we landed on what is now Engine — this agent that runs on LangSmith. To start: here at LangChain, we're the Agent Engineering Platform.
0:38 So as you might imagine, we love to build agents. And we'd like to think that we're pretty good at it. Internally, we have built a ton of them, including a go-to-market agent. This go-to-market agent does account research for our go-to-market team. It does account outreach for our customers as well. And as we were building and improving this agent, we saw a ton of different problems that we would run into over and over. The first being: even as we were carefully and meticulously monitoring and observing what our agent was doing in the wild, we would still get the inevitable message from our go-to-market team saying, "Hey, something is broken.
1:15 This didn't work as it should have," even though we had been monitoring very closely. And for each one of those issues that would be brought up to us, the fix was oftentimes very straightforward, but tons of these very small fixes started to add up, they'd get deprioritized, et cetera. And with each one of these fixes, the process of creating good evals to ensure that there aren't regressions is very tedious. And so oftentimes we would find ourselves encountering these micro-regressions.
1:40 And these are problems that, as I talk to customers, I see all the time — our customers are building agents as well. They are looking through their traces in a very manual way, which is extremely error-prone. They are finding that a lot of these small fixes that they need for their agent to perform well are not getting prioritized because there are just so many minor ones. And like Harrison said in his keynote, this feels like a game of whack-a-mole.
2:06 I'm gonna fix one problem over here and another is gonna spring up because this process of creating good evals is very difficult. And so what we wanted to build was an agent that would do this for us and resolve these different problems for us — something that would find our issues automatically, something that would fix those issues, and something that would add testing to prevent regressions in the future. And ideally, something that would be doing this all the time so that our team could be focusing on expanding the functionality of the agent instead of fixing these irritating bugs and errors.
2:38 And what I'm excited to walk you through is what we landed on with LangSmith Engine. I want to show you what that looks like in the UI. LangSmith Engine will identify errors from your traces in your tracing project, and it will present them in this prioritized inbox on the left. Each issue has a description and a timeline of its occurrence, so I can see if this is something new or something that's been going on for a long time.
3:02 And if I want to dive deeper into any of these offending traces, I can click into them right here on the page and see exactly what might have occurred with a customer. And so I can gut-check: is this a real issue and something I need to fix? Engine goes beyond diagnosing problems and actually works to fix those problems as well. So here you can see there's an adjustment to my prompt that's being proposed, as well as an adjustment to one of my agent files.
3:27 And if I want to open a PR right here on the page, I can do so very easily. The process of finding the important problems is also very difficult. And so Engine creates custom online evaluators that are tailored to this exact problem, so that if it recurs in any way, you can catch it. The last part of this process that is so painful is the creation of dataset examples for your offline evals. Engine also makes this much easier by taking the errored inputs that you've seen in production and creating a version of ground truth from each one of those examples.
4:01 So you can see here I have the various inputs that I've seen in production, the wrong outputs that have been generated for a customer by our earlier version of the agent, and ideally what we'd like to see. And this is created via assertions. And so we can add this to a dataset or edit it in the annotation queue. If we have any concerns, we can edit what that ground truth looks like. So really excited about the way that this connects and strings together all the different components of that agent engineering loop.
4:28 Engine is an agent, like we've talked about. It pulls these different error traces, clusters them into issues for you. These are issues that you can act on very easily — it generates fixes for you, and then works to improve your evaluation suite as well, whether that's your online evals or whether that's your offline evals. Now, the version of Engine that you just saw and that we're describing is working with a handful of our customers today. We have about 15 customers that are really great and are helping us improve this version of Engine — from Clay to Vanta to Campfire.
5:03 They have given us really great feedback that Engine is changing not just the way that they interact with LangSmith, but the way that they are engineering their agents entirely, and it's facilitating that process so much. But the product that they're using and that we just walked through is not what we first started with. I want to talk to you about the earliest version of Engine. If Engine is like this motor — this powerhouse of that agent improvement loop — the first version was kind of like a wind-up toy.
5:31 What we created was something that would take our LangSmith traces, automatically send them to a coding agent, which would spin up a PR and run on a GitHub Action continuously. It was a little hacky, but it worked. And we started to surface different issues from our traces on our internal agents. The very first PR that was created by this early version of Engine was a real problem — a tool call that was failing silently in one of our agents.
5:58 Engine added some error handling for that. Not a huge fix by any means, but it was a real problem that was addressed by this agent. We were excited about that, but even more excited about the subsequent fixes that we saw. Here's another one, for one of our internal agents that is an asynchronous coding agent that can be invoked via Slack. Engine picked up that a lot of our users were requesting that the agent review the PR comments for the PRs that had been created by this agent.
6:28 And OpenSWE — that's the name of our coding agent — would respond: I don't have that functionality, I can't help you with this. Engine picked up on these users getting unsatisfactory responses and created a PR to extend the functionality of the agent. And this is where we started to get really excited, feeling like this is not just going to find issues, but is going to improve our agent in all these different dimensions. Obviously this first version of Engine needed some work.
6:57 One of the very first problems we recognized with Engine was that it was too good at finding problems — it would oftentimes find problems that weren't real. There's a Soviet-era quote: "Show me the man and I'll show you the crime." This is exactly what Engine was doing — finding crimes in all sorts of traces where there weren't any. What we quickly realized was that the process of finding and identifying real and meaningful issues and distilling those into actionable buckets that we could work on was the most important part of the process.
7:36 The generation of the right fix and the creation of evals afterward was definitely connected to the identification of meaningful errors. And so a lot of our structural and architectural thinking was centered around this: how can we find good and meaningful errors? Jumping into more of the architecture — I want to highlight something that I think is really remarkable: to power Engine and this agent, we are using all sorts of LangChain products — whether that's our deep agents framework that Viv works on, or whether that's our newly announced LangSmith Sandboxes. These are all powering this agent under the hood. Now, getting more into the weeds, LangSmith Engine is triggered from a whole set of different sources. An agent can kick it off ad hoc, but by default, it runs on a schedule.
8:24 Whenever it's kicked off and triggered, that hits our LangSmith backend. That feeds into this multi-tenant orchestration with this distributed task queue that we have on our LangSmith backend. And that all feeds into a single LangSmith deployment that serves all of the different tenants. All of the agents that we have being improved by Engine are all on this single LangSmith deployment, where we have these deep agents running and improving based on those traces. These deep agents are pulling in traces and the source code of the agents that we're running into a LangSmith Sandbox — one for each run.
8:59 And this process that you can see here is really just the process of identification of issues. We decided early on that because of the massive context required to look through and investigate these different traces, it was better for us to split out the functionality — the identification of issues from the actual fixes to those issues. And so you can see here there's this section for fixes — it looks very similar to the graph you're seeing, and it's just this version specifically meant to create fixes and attach those to the various issues that we find.
9:33 So once this set of issues is defined and each issue has a defined fix, we surface that to the user in the UI. And all of this — I'll note — all of this is being traced via LangSmith, and this is what we're using to understand how our agent is performing. Now, I've mentioned that Engine ingests traces of our users. I want to drive home the point that traces are far and away the most valuable input that Engine operates with.
10:02 The code of your agent is valuable, obviously, but it doesn't do a great job of telling you how your agent will perform in the wild. There's a massive amount of non-determinism when building with agents. And so the traces really are the window to the agent's soul — how it will perform in the wild. That is what powers Engine and all of its functionality. We don't ingest the entirety of every single trace being sent to LangSmith to power Engine. Instead, we send it a condensed and summarized version of your traces. The agent has the ability to grab and investigate and look through those traces more closely, looking for patterns that it thinks are interesting or might hold some kind of error.
10:47 We also rely on our customers' source code. This can optionally be connected into Engine so that we can more accurately diagnose fixes, as well as create PRs to very quickly address the problems that Engine will surface. But like I said, the traces are really what inform so much of what powers Engine. When it comes to the actual fixes that are proposed, sometimes these are small fixes. Sometimes it's a minor prompt adjustment.
11:17 Sometimes that's an adjustment to your skills file or your agent's markdown file. And many times it's an adjustment to the actual code of the agent's structure. What I'm really excited about is not just the actual code adjustment, but this contribution back into your evaluation suite — whether that's creating online evaluators to catch those problems that keep occurring, or creating these regression examples as we talked through during that demo. That process of taking an input you've seen in production with a bad or unsatisfactory output and creating a ground truth reference output is very tedious today.
11:49 And so I'm really excited about the way Engine proposes what ground truth might or should look like for those different inputs. And then lastly, we want Engine to work really well for our customers and for the different priorities that they have. When we launched the first more formal version of Engine to that group of customers I mentioned earlier, we saw an important learning: what's a high-priority issue for one of our customers and one of their teams using Engine might be very uninteresting to another team.
12:20 We had a customer reach out to me early on saying, "This is working great. You guys are finding really important places where my agent is hallucinating or leaking sensitive data. Please stop showing me issues related to our context being bloated. We don't care. Our agent is working great." On the other hand, we'd have customers saying, "This is awesome. You're pointing out places where our cost is too high, our latency is way too high. Please stop showing us places where our agent is hallucinating a little bit.
12:48 It's doing fine." And so what we learned is that for Engine to work well, Engine needed to work differently for the different teams that we were serving. And so with that in mind, we've allowed for Engine to learn from our customers' behaviors. So whether that is changing the priority of an issue that is surfaced, whether that is ignoring an issue altogether and providing reasoning for why this doesn't matter to you, or providing any other kind of natural language feedback — all of that feeds into what we call the agent overview, which is kind of like a memory file for Engine to understand what you care about and how your agent works.
13:24 We're really excited about the process that we've undergone to improve Engine and make this better for our customers. We've been observing it very closely, and we've been evaluating it very closely. And to talk about the process of evaluating Engine, I will pass it off to Viv. Thank you, thank you. Shout out to Ben. Big shout out to Ben. Amazing. So like Ben mentioned, Engine today did not look like Engine four weeks ago. And the question that I really care about is: how do we know that Engine is working?
13:57 How do we know it's working today? How do we know it was working four weeks ago? And how do we know it's going to work two months from now? The answer to that question is, of course, evals. It's always evals, actually. So like Ben mentioned, Engine does three main things. It identifies issue traces from a huge corpus of data. It generates fixes. And — a little bit of eval-ception — it creates evals. And for all of those things, we need evals.
14:25 So we need evals for Engine to create evals for you — basically. How do we actually get those evals? Well, the main way that we source them is from internal traces. So like Ben mentioned, we turned Engine on for a background coding agent, OpenSWE, or for a GTM agent. That gave us real user data — we were the users — for how is Engine doing? How can we improve it? And that kicked off this feedback cycle of saying: okay, Engine's not that great here, but let's take those traces and turn them into evals.
14:56 Dogfooding is a really good way, if you are your own users, to bootstrap evals. The other approach is synthetic data — asking an LLM to generate what a good eval looks like. I include human review here in particular because LLMs are really smart, but they're actually very bad at this task — generating a good eval. They need a lot of rubrics and a lot of guidance and a lot of human review to determine: okay, this is a good eval, this is not.
15:24 And the third approach is community evals — we love the open community of evals. But what we found is that the best eval for our agent is one that's bespoke for our agent. So we use community evals to gut-check our evals, but we don't always use them directly to measure Engine. Great, so we're getting evals from somewhere — but how do we actually build a diverse and well-rounded eval suite? A trace can be short, it can be long, it can be from the finance domain, it can be from the medical domain.
15:56 We want to have evals that basically capture that entire suite of data. The other thing is scenario-based tasks. I might just want to measure how good Engine is at calling a specific tool. The best way to do that is by making a targeted task that just measures that. And I just said targeted task — then I say end-to-end evals. Because really, what we found is the best way to measure Engine is by putting in a representative set of traces and seeing the entire loop end-to-end.
16:27 And that allows us to do sub-piece optimization. Like I said: let's just focus on this tool. Let's just focus on this prompt. Let's just focus on the skill that we vibe-coded, right? Let's focus on those pieces. And how do those evals actually inform our decisions? Today, every month we see a new model drop. There's 5.5, there's 4.7, there's 4.6, there's 4.5. The fact that you all understand what those numbers mean is wild. But every month, we have to look at what models we're picking.
16:58 That can be based on performance, cost, latency — and all of these are feedback signals that Engine takes in and can offer up as suggestions to our customers. The other thing is: context engineering still matters a ton. How should we design the tools? We don't want to put 30 tools into Engine. We designed Engine to be autonomous and gave it a minimal set of tools that it can orchestrate itself. And the last thing — I saw a blog post claiming prompt engineering is dead.
17:25 Viv and I did not find this to be true. Prompt engineering is still very much alive. And sometimes the best way to encode what your customers care about is by writing very detailed, painstaking prompts. And that's one thing we found in our evals. And I just talked about doing this whole rigorous process — I designed this eval, I took feedback from this person. But now I'm talking about just vibes, basically. Because I think there is a part of agent measurement that can't fully be captured by evals all the time, especially very early in our journey when we did not have evals for Engine.
18:01 A big part of that was dogfooding the product, using it over and over again, and getting feedback that way. And the first principle here is: trust user feedback. This is huge for us. If a customer says, "Hey, Engine's kind of out of whack," and our evals say that it's not out of whack, it's probably out of whack. And we need to update our eval suite to measure this. Now, this last slide is kind of the thing I'm most excited about as someone who loves this research space.
18:30 It's the first sparks we're seeing of this self-improving agent loop. This is Engine — which is an agent — improving Engine. Engine produces traces just like any other agent. And we can take those traces, feed them back into a version of Engine and say: how should we improve Engine? Your context management isn't good. Use a different model. I'm finding these issues. And that's one thing I'm really excited about. We'll have a bunch more to share soon.
18:59 But I will kick it back to Ben to bring us home. Just to summarize, a couple of the key learnings from this process. For us, defining that very crucial point of finding important and meaningful issues was really, really valuable for creating a good product with Engine. That definition of the most crucial point in the flow is an important thing to nail as you're building an agent. The other thing is: while we were building Engine, we were very closely monitoring and understanding how our agent was performing under different scenarios.
19:30 And that was all possible by using tools that we provide at LangChain, especially our observability tools. And I made this comment earlier about the preferences of users that we allow and accommodate for in Engine. The truth is that Engine was surfacing real, accurate issues to our customers. And even the accurate issues weren't always meaningful to them because they were misaligned with their priorities. And so accommodating that — making sure that user preferences are respected by Engine — was a small fix, but made a huge difference. It made Engine not just an okay, functioning product, but something that really makes a huge difference for our customers.
20:05 And then lastly, as Viv has talked about, this process of creating evals is super important for making a good agent. High-quality evals are ultimately going to lead to high-quality agents. We are really excited about the future of LangSmith Engine. We really feel like this is the future of LangSmith and the way that our customers are going to more easily have observability and create fixes and create their evaluations. And we're excited for that loop to spin faster and for it to spin more autonomously over time.
20:33 And we really can't wait for you to try it out. Thank you.
Summary
- LangSmith Engine serves as a solution for common issues faced during agent development, such as micro-regressions and tedious evaluation processes.
- It automatically identifies errors from agent traces, clusters them into actionable issues, and proposes fixes, significantly reducing manual oversight.
- The tool generates custom online evaluators and creates ground truth datasets from production errors to improve evaluation accuracy.
- Engine adapts to user preferences, allowing for tailored prioritization of issues based on individual customer needs.
- The development of Engine involved iterative feedback from internal use and customer interactions, emphasizing the importance of user feedback in refining the product.
- The architecture of Engine leverages various LangChain products, ensuring a robust and efficient backend for processing agent data.
- The evaluation process for Engine is ongoing, utilizing internal traces, synthetic data, and community contributions to ensure comprehensive performance assessment.
- Future developments aim to enhance Engine's self-improvement capabilities, allowing it to learn from its own outputs and further optimize agent performance.
Questions Answered
What is the purpose of the LangSmith Engine?
The LangSmith Engine is designed to enhance agent observability and facilitate the improvement loop for agents built on the LangChain platform. It addresses common issues encountered during agent development and evaluation.
How does the Engine improve agent evaluation?
The Engine clusters error traces into actionable issues, generates fixes, and enhances evaluation suites for both online and offline assessments. It has evolved significantly based on customer feedback.
What is the architecture behind the Engine's functionality?
The Engine operates on a multi-tenant orchestration system that processes traces from various agents, allowing for efficient issue identification and fix generation. It separates issue identification from the fixing process for better clarity.
How does Engine adapt to different customer needs?
Engine learns from customer interactions, allowing it to prioritize issues based on user feedback and adjust its focus according to what matters most to each team. This customization enhances its effectiveness.
How do we assess the effectiveness of the Engine?
The effectiveness of Engine is evaluated through rigorous assessments and user feedback. Continuous monitoring of performance metrics and customer insights helps ensure it meets evolving needs.