[00:00] Harnesses. I think this is a very important topic. A lot of you are thinking through building your own harnesses right now. [00:06] I'm very excited to introduce Harrison. I first noticed Harrison on Twitter in 2022, back in the GPT-3 era. [00:14] And Harrison was one of the first people thinking about, okay, we have these models. How can we build an entire harness around them so that they're not just autocomplete tasks, [00:25] but that they start acting as virtual collaborators or agents? And Harrison, the ecosystem has grown so much since 2022. [00:34] And I've seen you also grow a lot in terms of how you think about building agents, building harnesses, how to eval them, et cetera. [00:41] So I'm very excited to have you talk today. I think the talks will be both about harnesses and evals. [00:46] And then format again will be 15 minutes or so of presentation content, 15 minutes of Q&A. Thanks for joining us, Harrison. [00:54] Cool. My name is Harrison, co-founder and CEO of LinkedIn. [01:01] I want to talk about evals and harnesses in the context of kind of owning your own intelligence. [01:08] So when we talk about intelligence, we're normally talking about agents. What exactly makes up an agent? [01:13] At LinkedIn, we think there's kind of like three main parts. There's a harness that orchestrates a model and some context. [01:19] And if you're talking about owning your intelligence in general, you probably want to own all three parts of these. [01:24] And so owning the model, I'm not going to talk too much about. [01:27] Lynn was here from Fireworks and talking about open-weight models and owning that. [01:31] A big part of this is also the ability to switch models. [01:34] There used to be this concept of kind of being like cloud agnostic and being able to switch clouds back in the day. [01:40] Same thing exists, but for models, you want to be able to switch to avoid lock-in, [01:43] but also to just use the best model when it's available. [01:46] Context, you want to own all the context that your agent uses, whether that is memory, [01:52] whether that is semantic knowledge, whether that is previous conversations. [01:56] These can help personalize and guide the agent as it goes along. [01:59] And then the last bit's the harness, and that's what I really want to focus on. [02:02] So how do you really own your harness? What does that even mean? [02:05] What's the main job of the harness? [02:07] The main job of the harness is to bring context to the model at the right point in time. [02:11] And so it does all the orchestration around the fixed context, the dynamic context. [02:17] It brings it into the context window of the model, shows it something, gets some response, [02:21] and then does something with that. [02:24] And so agents need to do all these different things in order to accomplish their jobs. [02:29] There's a ton of domain-specific stuff that they need to do as well, [02:32] but they need to interact with external systems. [02:34] These external systems, when you interact with them, they emit more context [02:37] that can get fed back into the agent, into the loop. [02:39] And so the harness is the thing that really orchestrates all of this together. [02:43] Agents, they're kind of like simplest. [02:46] When everyone talks about agents, what they really talk about [02:48] is just an LLM running in a loop calling tools. [02:51] And this is a really simple but really general architecture. [02:55] Some request comes in. [02:56] The LLM makes some generation. [03:00] That generation may include a tool to call. [03:02] If it does, you invoke those tools, and you pass that observation back to the LLM. [03:06] And this is the core architecture behind pretty much every agent out there today. [03:12] But they're all different in slightly different ways. [03:14] And so on the left here, this is kind of like the base core loop. [03:19] But there's a bunch of different things that you can do in your particular harness [03:23] at different stages. [03:25] And so this is over here. [03:27] So we build LangChain, which is a really, really base minimal harness. [03:31] And that's LangChain over here. [03:32] And then this is DeepAgents. [03:33] DeepAgents is kind of like our model agnostic [03:36] and more general purpose version of Cloud Code. [03:39] And so it does more things. [03:40] It connects to file systems. [03:42] It has skills. [03:43] DeepAgents, it's built on top of this really simple harness. [03:47] But we customize it by using these levers over here. [03:50] So you can run particular code snippets before the agent's invoked, [03:54] before each model call. [03:56] You can kind of like wrap these model calls. [03:58] You can wrap the tool calls. [04:00] And you can customize this core simple loop in a lot of really powerful ways [04:06] just by using kind of like small what we call kind of like middleware constructs. [04:10] There's other ways to customize the harness as well. [04:12] But this is kind of emerged as there's a concept of hooks and plug-ins [04:16] and a lot of the coding agents as well. [04:18] And that's essentially what they're doing. [04:19] They're taking this base loop that's running, [04:21] and they're adding little hooks or plug-ins at various points [04:24] to let you customize it. [04:25] And so a lot of the stuff that you can do and you can customize, [04:28] this is all done by that concept of middleware, [04:32] by just modifying that core loop. [04:34] So the agent's still running in a loop. [04:36] It's still doing that same simple architecture. [04:38] But through that, you can give it access to a sandbox. [04:40] You can give it access to a file system. [04:42] You can give it access to subagents. [04:44] You can give it access to memory. [04:46] You can have summarizations or summarization. [04:48] If we go back to this thing, [04:50] summarization would come in before the model. [04:52] Before the model's invoked, you check if the context is too long, [04:55] and then you summarize it. [04:56] And so that you can add into this core loop through this concept of middleware. [05:00] Same with context offloading, [05:02] which is a way of basically taking large tool calls and dumping them. [05:05] That kind of wraps the tool call. [05:07] And so the point is, there's this really simple general architecture of an agent. [05:13] All of these more advanced agent harnesses are basically doing that loop [05:16] but adding in a bunch of stuff while still running this core loop. [05:20] And so as you think about building or customizing your own harness, [05:25] these are the different places that you can insert things into. [05:28] You can add your own summarization step. [05:30] You can add your own handling of particular tool calls. [05:33] And that's one way that you can customize [05:35] the agent to your particular domain [05:38] and the harness to your particular domain. [05:40] The other way that you can customize the harnesses that the agent runs in [05:44] is by having a more explicit cognitive architecture. [05:47] This used to be the way that a lot of people would build agents in 2023, 2024 [05:53] because the models weren't good enough to run in a loop. [05:55] And so in order to get it to do particular things, [05:58] you would have these very bespoke cognitive architectures. [06:01] And so this one over here is for a deep research example [06:07] where it would generate some sub-questions, fan them out, [06:10] and then go and execute them. [06:11] And then this one over here is for a code review bot. [06:13] And you can see that there's these very bespoke steps. [06:17] A lot of this has gone into the harness now. [06:20] And by the harness, I mean it's still this core loop. [06:23] These might be added as particular modifications to that core loop. [06:27] But for a lot of really particular flows, [06:31] we do see people still using cognitive architectures like these [06:35] to really guide it in particular ways. [06:37] One thing that we recommend to people is to start with a general harness. [06:40] That's the easiest to get started. [06:42] It's going to be quickest of time to value. [06:44] And then as you narrow in on the use case that you want to be excellent at, [06:48] you can start to add more of these gates and checks around it [06:52] to guide it into particular ways. [06:55] One question that we get a lot is when to kind of think about [06:59] building your own harness versus using an off-the-shelf harness. [07:02] A lot of the off-the-shelf harnesses work with particular models. [07:07] So the off-the-shelf harnesses include things like [07:10] Cloud Code or Cloud Agent SDK, which works with anthropic models, [07:13] CodeX, which works with open AI models. [07:15] I think this is a big open question in the industry. [07:18] My answer generally is, [07:20] the more in-distribution you are of what the models are trained on, [07:23] then the better the off-the-shelf harness will be. [07:26] As soon as you start to move further and further out of distribution, [07:29] then you'll probably want to tune your harness in some way. [07:33] There's different ways to tune the harness as well. [07:36] So the models may be in-distribution on particular things [07:39] that you are doing on an out-of-distribution task. [07:42] So what I mean by that is if you think about something like legal AI, [07:46] which Gabe just talked about, [07:48] and I think he mentioned how they have their own harness, [07:51] there are things that are in legal AI [07:53] that are still in-distribution of the main models. [07:57] So, for example, editing files is something [08:00] that the main models have all been RLed on, [08:02] and they've actually all been RLed in very particular ways. [08:05] So open AI and Cloud models edit files in different ways in their harnesses, [08:11] and as a result, their models are actually best at editing files in different ways. [08:15] Now, the models themselves are out of distribution [08:18] on this larger task of legal AI, [08:21] but they're in-distribution on this task of editing files. [08:24] So if you think about building a harness that works there, [08:27] you'll probably want a custom harness, [08:29] but you'll want it to use the edit file tool that is in-distribution [08:33] for the model that you're using. [08:37] So one of the things we do in Deep Agents, for example, [08:39] so Deep Agents is our customizable harness, [08:41] we actually have this concept of model profiles, [08:44] where for things that are in distribution of models, [08:46] like editing files, we basically switch between different edit file implementations [08:51] depending on which model is being used. [08:53] And so I think that's an example of customizing the overall harness [08:56] when it's out of distribution for a task, [08:58] but keeping smaller in-distribution parts [09:01] as close to the model layer as possible. [09:04] The second big part of what I want to talk about [09:07] is evals and observability, [09:09] and so I think as you're experimenting with all parts of an agent, [09:12] whether it's the model or the harness or the context, [09:15] you're going to want to know what's going on inside of this system, [09:19] and you're going to want to be able to evaluate it. [09:21] And so these are useful tools that you can use, again, [09:24] not just for custom harnesses, but also for custom models. [09:28] So there was a great Twitter article that Satya wrote two weeks ago [09:33] where he talked about a lot of these concepts, [09:35] and there's three quotes in particular that kind of stood out for me. [09:38] One, create your private evals, [09:40] because eval defines what good looks like inside the organization. [09:43] Two, retain ownership of your organization's memory, [09:46] traces, feedback, that bold is mine, [09:49] decisions and institutional context. [09:51] And then three, you create your own continuous learning loop, [09:54] hill climbing machine that will allow your AI investments [09:57] to compound the value of your firm. [09:59] And so I think these speak to the importance of evals and observability [10:03] and the learning loop that they power [10:05] in really owning your intelligence and compounding it. [10:08] So how exactly do they do that? [10:10] So evals. [10:12] Gabe was here talking about how they built benchmarks for the legal domain. [10:16] I think every company, when they're building a mission-critical agent, [10:20] they will build benchmarks for that agent. [10:22] You can use it to define and catch regressions, [10:25] or you can hill climb on that benchmark, [10:27] again, either by adjusting the harness or adjusting the model. [10:30] One of the things that we see becoming the industry standard [10:33] for defining these benchmarks is Harbor. [10:35] Harbor is an open source eval runner. [10:37] It's created by the makers of Terminal Bench 2, [10:40] which is one of the industry standard benchmarks [10:42] for benchmarking coding agents, [10:44] and it's become pretty popular for a variety of domains. [10:47] What it lets you do... [10:48] So this is Frontier Bench, which is another coding benchmark. [10:52] You get this nice benchmark, [10:53] and you can compare different agent harnesses, [10:56] different models, different reasoning efforts, [10:58] and you can get this nice benchmark [11:00] and you can see how all these different harnesses [11:02] and all these different models do on your task. [11:04] And so having a benchmark for your task [11:06] will become really, really important [11:07] when you're trying to define it. [11:10] What exactly is Harbor? [11:11] It's pretty simple. [11:12] At a high level, it consists of agent... [11:15] You run an agent against a dataset. [11:17] A dataset has a bunch of different tasks. [11:20] Generally, they're run in sandboxes [11:21] because they are a lot of these different tasks, [11:24] and you might want to parallelize them. [11:26] And as we talk about in a little bit, [11:28] each task has its own kind of environment. [11:31] So this is what a Harbor task looks like. [11:33] So on the right, you can see that it has an environment. [11:35] This is where you define the environment that the agent runs, [11:37] and a lot of these longer-running, more stateful agents [11:39] need to interact with their environment. [11:41] And so you basically spin up a sandbox, [11:43] give it its own environment that's defined in a Dockerfile [11:46] and run it there. [11:47] There's then a solution, which is basically... [11:50] This is a kind of golden solution [11:52] that you use to sanity check it, [11:53] so it's not that interesting. [11:54] Tests is more interesting. [11:55] This is basically the verifier for the agent run. [11:59] The test scripts can do anything. [12:01] They can run code. [12:03] They can run unit tests. [12:04] They can run another LLM as a judge. [12:05] They can run an agent as a judge. [12:07] You basically define how the agent is scored in this test. [12:10] And then instruction.md is the prompt that the agent is given. [12:13] And that's kind of like the core of Harbor. [12:16] You define these tasks, which are bundled up things [12:19] that can be run in a sandbox, [12:20] and then you run a bunch of them against agents. [12:22] And agents, again, consist of models and harnesses, [12:24] and you score how they do. [12:26] When you do all of that, what do you get? [12:30] You get some nice results that you can compare. [12:32] So this is LengSmith, the platform that we build [12:34] for evals and observability. [12:36] So you can see here a bunch of different experiments. [12:38] We have a great integration with Harbor. [12:40] You can see the feedback scores. [12:42] In this case, it's a single reward function. [12:44] You can also track latency and tokens. [12:46] So when you're benchmarking agents, [12:47] you probably don't just care about accuracy. [12:50] You also probably care about latency and cost. [12:53] And so you'll want to track all of those. [12:55] And then for a particular experiment that you run, [12:57] these would be the different tasks [12:59] that are in a Harbor dataset. [13:04] Talking a little bit about observability, [13:06] observability sounds basic, but I think it's really important [13:08] and really underrated for agents, actually. [13:10] So when agents mess up, they mess up because an LLM call goes wrong. [13:13] Why might it go wrong? [13:14] It might go wrong for one of two reasons. [13:16] One, the model's not good enough. [13:17] Two, the context that the LLM received isn't good enough. [13:20] And so I actually think it's the second one [13:22] that more often than not causes issues. [13:24] And so having really good observability [13:26] into what is going into the context window of the model, [13:30] and then how that context is accumulated, [13:32] what steps were run, what tools were run, [13:34] how does that context get there, [13:36] all of that is really important for debugging your agent [13:39] when it goes wrong. [13:42] So this is one view of observability that we have. [13:45] This is intended to be a more user-friendly view [13:48] where we actually represent it. [13:49] This is similar to what you might see in kind of like Cloud Code. [13:52] We kind of hide some of the tool calls, [13:54] so you can see seven tool calls up there. [13:56] And so we try to make it really easy to kind of skim through this. [13:59] Most agent paths these days come in the form of trajectories. [14:03] Trajectories are basically, you can think of them [14:05] as the list of messages that you see kind of like Cloud Code running. [14:09] So when you run Cloud Code or another agent, [14:11] you type in a human message. [14:12] It then makes a bunch of tool calls. [14:14] Those are all messages under the hood, [14:16] and then it responds, [14:17] and then you type in another human message. [14:19] That's kind of like this message trajectory [14:21] that is becoming more and more of a central part of these agents. [14:24] But that's not enough to fully debug it. [14:26] And so we also have this full kind of like trace, [14:29] and you can click into particular things [14:31] and see exactly what goes on inside the model. [14:33] And this type of observability is pretty important [14:35] for knowing what's going on. [14:39] Evals and observability really let you set up this data flywheel [14:42] and compound the intelligence as you start to use the agent, [14:46] as your users start to use the agent, [14:48] and you start to get feedback. [14:50] So this is a slide that one of our team members [14:54] presented at SWIX's AI Engineering Fair [14:57] actually around a recipe for continuously improving agents. [15:01] At a high level, it's really simple. [15:03] You build an agent, you start running it, [15:05] you collect lots of traces, [15:06] you then curate the trace data, [15:08] and then you run experiments on that data that you curate. [15:10] And so it's really simple, [15:12] but of course there's a lot of complexity under the hood. [15:15] So one thing that's really important for this is feedback, [15:18] getting feedback either from the environment [15:21] or from a synthetic source. [15:23] So from the environment, [15:24] one thing that I think is really underestimated [15:26] in agent design is actually UX design [15:28] of how you present the agent to your users. [15:30] If you present it in a really intelligent way, [15:32] you can actually end up getting a lot of feedback from them. [15:34] They may not click thumbs up or thumbs down explicitly, [15:37] no one really is doing that, [15:38] but if you design the UX in a clever way, [15:40] you can get some of that feedback. [15:42] The other thing you can do [15:43] is you can start to get synthetic feedback. [15:46] So you can run what we call online evaluators [15:49] over these traces to judge things. [15:52] So Gabe was talking about an experiment that we did with Harvey [15:55] where we significantly reduced the cost [15:58] of some of these LLMs as a judge-type thing. [16:01] So if you imagine running Opus over every single trace [16:04] that comes into your system, [16:05] that's going to rack up a big bill. [16:06] And so you want a really cheap and fast way of doing this. [16:08] So we've fine-tuned some SLMs for actually doing this, [16:11] but you can of course use off-the-shelf models [16:13] with custom prompting to do it, [16:14] or you can just use code if some of the things [16:16] that you want to test are simple enough. [16:20] So this is the full part of it, [16:23] the curating the trace data feedback is a big part there. [16:26] And then the other thing is when you use that data [16:30] to update what happens, [16:31] you can update any part of the agent [16:34] with this kind of like system. [16:36] So you can update the harness by doing harness engineering. [16:39] You can update the model by doing fine-tuning on that. [16:42] You can update the context by doing memory. [16:45] And so the part that we think most about at Langchain [16:49] is the harness engineering part of that. [16:51] And so I want to show a really quick demo of one of the things [16:54] that we added to help with that. [16:55] But I think trajectory is talking next [16:57] on some fine-tuning that can be done. [16:59] And so it's a very similar process where you run the agent, [17:02] get some traces, use that data in some way to improve the system. [17:06] What is the system? [17:07] It's these three pieces, [17:08] and each of them can be updated in some way. [17:11] And so, yeah, this is the full end-to-end flow [17:17] that you might want to do. [17:18] One of the things that we think about [17:20] is how can you automate this as much as possible? [17:23] Because this is tricky and takes a lot of time. [17:25] And so that's one of the things that we've been thinking about [17:28] for the past few months. [17:29] I want to do a quick demo of what we call Langsmith Engine, [17:32] which is basically an agent that sits on top of your traces [17:36] and does all this work. [17:37] So if we look at what that work was, [17:39] you've got these traces. [17:40] The work from there is curating the traces [17:43] and running some experiments and suggesting fixes [17:45] to one of the three things. [17:46] And as I mentioned, [17:47] we mostly focus on the harness engineering bit. [17:50] So in the demo, I want to show what this looks like [17:54] and how it represents that. [17:56] So hopefully this will work. [17:57] If not, it's not that big of a deal. [17:59] Perfect. [18:00] Okay, so this is Langsmith. [18:01] This is a bunch of traces we have coming in. [18:03] We have this tab called Engine over here. [18:06] This is an agent. [18:07] It runs in the background. [18:09] It creates what we call kind of like issue boards. [18:11] So this is the part of curating data it will look for. [18:13] It will basically, under the hood, [18:15] it's a coding agent that has access to our Langsmith CLI. [18:18] The Langsmith CLI, you can filter traces for feedback [18:21] and other things like that. [18:23] So we give it a nice big prompt and some subagents [18:25] that help it basically go out and explore this data [18:27] and identify issues and see what common things are. [18:30] And then it will create these issues right here. [18:32] And so here, it's created an issue. [18:35] It gives a description of it. [18:36] It links to the traces [18:38] so I can go see some supporting evidence. [18:40] And then down here, [18:41] I guess this is very simple changes to the prompts. [18:45] But here, it's updating part of the context in this case. [18:49] Here, it's also updating some instructions. [18:52] And we can see here that it's adding some code [18:55] to go into the harness as well. [18:57] And so this is something we launched in the past few months [19:01] and I think speaks to this data flywheel, [19:04] which again is a very simple thing. [19:06] Run agent, get traces, see patterns, fix. [19:10] And this is our attempt at automating it. [19:15] I'm happy to take any questions on harnesses or evals. [19:20] This is great, by the way. [19:21] I really appreciate the whole presentation. [19:23] Engine itself is an agent, right? [19:26] Yeah. [19:27] That's given a prompt and go search over things. [19:29] Have you run engine on engine? [19:31] We have it running, yeah. [19:32] So engine also hooks up to Slack [19:34] and sends it kind of like reports about itself. [19:37] And yeah, that's how we dog food it. [19:41] We also created what we call issue bench for engine, [19:46] which again is like a harbor formatted benchmark, basically, [19:52] that we're constantly benchmarking different models [19:54] and different harnesses on. [19:56] And so I think Gabe talked about this a little bit, [19:59] but one of the benefits of having a benchmark [20:01] is you can benchmark it on a bunch of different harnesses [20:04] and see what they're good and bad at. [20:07] I think a few weeks ago, we ran our own kind of like deep agents [20:10] and then codecs and then clod code on this. [20:13] And we saw that codecs was doing a really interesting thing [20:16] where it would write itself a bunch of small scripts [20:18] to run against these traces, [20:20] and it was doing that really aggressively [20:21] and actually allowing it to perform really well. [20:23] So we did a sprint to do what we call the kind of like [20:26] codecsification of engine [20:28] and basically take that learning [20:30] and bring it into kind of like the core engine harness. [20:33] And so I think that's another benefit of having a benchmark [20:36] is you can just run a bunch of different things on it [20:38] and see how they actually perform [20:39] and then bring those things back into your core [20:41] kind of like agent harness. [20:43] Super cool talk. [20:46] To which extent do you think that like harnesses [20:49] will converge into one thing [20:51] and users will be educated to do that [20:53] and the models will be best for that [20:54] versus diversifying here, [20:56] every company has their own way of doing things, [20:59] optimized for them? [21:01] Yeah, yeah, really good question, [21:03] one that we think a lot about [21:04] and I chatted with, you know, from factory [21:07] who also kind of like thinks a lot about this [21:09] and I think there's some stuff we talked about this. [21:13] I think there's, I think the model, [21:20] I don't know is the honest answer. [21:22] I think some things that I've seen [21:25] is that the general purpose harnesses [21:27] have gotten good enough to work for a lot of basic tasks [21:32] at least when you're getting started. [21:33] So I would recommend getting started [21:35] with like an off the shelf harness, [21:36] whether it's deep agents or codecs [21:38] or cloud code or something like that [21:39] because I think the models are now good enough [21:41] and the things that we've learned [21:42] about what makes these models good, [21:44] access to file systems, sub-agents, things like that, [21:47] those are kind of like good enough. [21:50] I think we often see that the more out of distribution [21:55] you get, the more you're going to want to customize [21:57] the harness and it's a scale, right? [21:59] So at the extreme end of a scale, [22:04] you might want to build a complete kind of [22:05] like cognitive architecture that is really focused on things. [22:09] Another reason you might want to do that, by the way, [22:11] is kind of like for predictability and control [22:13] and so we have a lot of customers in financial services [22:15] where they need kind of like predictability [22:18] and so we show them something like deep agents [22:20] and they're like, whoa, whoa, whoa, [22:22] that's way too scary an agent for us. [22:24] We want like more of this kind of like custom [22:26] cognitive architecture where we can really control things. [22:29] But then on the other end, you know, [22:31] you could just use it off the shelf harness [22:32] and there's things in the middle, like hooks [22:34] or middleware that you can use to kind of, [22:35] so it's a spectrum as well. [22:37] The more out of distribution you get, [22:38] the more custom harness you're going to want to have. [22:41] And then there's other like weird things [22:42] where like, again, like I think both OpenAI [22:46] and Anthropic are getting really good at coding [22:48] but they've landed on different ways [22:50] to kind of like edit files that are like, you know, [22:54] that are like actually pretty different. [22:56] You know, I think they have some benchmark [22:59] and I think he was, he thought that one way was just better [23:02] than the other way, just like strictly superior. [23:05] And so that's like like, so I think the model labs [23:09] will kind of converge and that they all seem to be [23:11] kind of like really good at coding. [23:13] The harnesses will converge to kind of like [23:15] being really good at coding [23:16] if they keep on going down that path. [23:17] But at the same time, [23:18] there are these like really small differences [23:20] and I don't really know how to explain those either. [23:22] And right now I think those show up most concretely [23:25] in small things, but you could imagine [23:28] what if one lab really goes down kind of like bio [23:31] and those harnesses become really good [23:33] at kind of like bio agent things. [23:35] Then the harnesses themselves start to diverge [23:38] and so I don't know is the answer, [23:41] it's a fast moving space. [23:42] That's why evals and observability are important [23:44] and I think we, yeah, to measure all of that. [23:48] Cool, awesome, thank you guys. [23:51] Thank you.