Video: The Runtime Behind Production Long-Horizon Agents | Duration: 2204s | Summary: The Runtime Behind Production Long-Horizon Agents | Chapters: Welcome and Introduction (55.945s), Agent Harness Fundamentals (165.035s), Production Requirements (584.385s), Production Runtime Features (942.715s), Q&A and Closing (2002.535s)
Transcript for "The Runtime Behind Production Long-Horizon Agents":
Hey, folks. Super excited to to talk today about, the run time behind production deep agents. We'll give it a couple minutes. I think, some more folks are probably joining here. Just in case folks are wondering, we are gonna record the session today, and you can drop any questions that you have, mid session in the in the chat slash q and a box. Yeah. We'll we'll share the recordings later. I'll just give it a couple more minutes here for folks to join. Yeah. Excited for the Boston Linkchain event. We're excited to have people. It's it's, tech week here in Boston, so there's lots of good events. I think Anthropic is throwing one tomorrow on dev tools. Lots of good stuff. Alright. Probably give it can get started here. Looks like we got a ton of folks. So nice to meet everyone. I'm Sydney. I'm an engineer at Linkchain, and, yeah, today gonna talk about the runtime behind production deep agents. So as I just mentioned, my name is Sydney. I'm an open source software engineer at Langchain. I previously worked at Pydantic also on open source AI dev tooling. So, yeah, I've spent a lot of time in the open source agent framework space. So before we talk about the runtime powering production agents, I wanna cover a couple of basics, that are gonna kind of set the foundation for, this this powerful runtime that we offer. So first, starting off, what is an agent? An agent is pretty simple system. It's a model calling tools in a loop until it completes a task and returns a final result. So you can see that diagram on the right here will kind of come back to that as the core agent loop throughout this webinar. I'm gonna define kind of another buzzword that has been very popular in the agent building space recently, which is a harness. And so the easiest way to think about this is you can define an agent as a model plus a harness. So the harness is everything around the model that, helps an agent perform tasks. So that includes things like skills, memory, the base system prompt, sub agents and their tools, etcetera, tools, and then any additional context. So what is the job of a harness? It's to get the model the right context at the right time for a given task. The effectiveness of an agent is basically a direct function of the context relevance or the context quality. And so the harness exists around the model to get it the right context. So now diving kind of into our open source stack, what is DeepAgents? It DeepAgents is an open source library that provides a customizable agent harness that we say is purpose built for complex real world tasks. We used to say long running, but this can also just be kind of long context tasks. I'm gonna dive into kind of the infrastructure, behind a deep agent, also called the anatomy of a harness. And then we'll kind of dive into the run time that's powering, this harness. So there's four key components of a deep agent harness. I'll call them kind of capabilities. Starting with execution environment, this is primarily based on the file system. The file system is kind of the backbone of a deep agent, and it enables context management and these other capabilities. If you want to kind of power up your agent, you can also attach a sandbox or code interpreter, and that allows the agent to write code and execute code, and kind of solve problems in more creative ways. One example where this is relevant is, like, if you have a coding agent, you probably want it to be able to run tests, and execute code in that manner. So the second, kind of capability of a deep agent is a suite of utilities that help with context management. This is probably the most important capability, just because, as I mentioned, the job of a harness is to get the model the right context at the right time. So we have built in, tooling like summarization and context offloading to prevent context overflow for long running tasks. And then we also have skills and memory built in so that you can get your agent kind of specialized context. And then we also have prompt caching built in under the hood. And this means that your, you know, long context, long running agents, are still cost effective. I'll just touch briefly on these next two. So delegation is a pattern that allows you to distribute work across sub agents or organize, you know, large workflows with planning and to dos. That's like a to do list tool. You might be familiar, you know, if you're using Cloud Code, you see those, you know, to dos kind of gradually getting checked off as the agent does work. And then the final capability is steering, which we enable with first class human in the loop support. And what that looks like is, you know, being able to get human feedback on an agent run mid flight, So maybe before a sensitive tool call or, if the agent needs feedback from a human in the loop to continue appropriately, it can do that as well. So that is the anatomy of an agent harness. Looks like I don't see any any questions yet. But to so to build an agent, you need a harness. We just talked about that harness anatomy. To deploy it, you need a really robust runtime. And so that's what I'm gonna talk about for the rest of our webinar today is the runtime powering deep agents. So agents that you take to production, fail in ways that traditional applications, do not. So they are subject to super long runs with indefinite pauses for those, human in the loop cycles. Multi agent workflows can be incredibly complex. Any crashes or transient failures need to be handled really gracefully for sensitive operations. Agents are often subject to bursty traffic. So example for example, if you have a, you know, customer support bot and your, parts of your site are down or something, it might receive increased traffic. Security concerns are really important for agents. So what data is accessible to the agent, editable by the agent, you know, isolated across users, etcetera. Persistent state needs to be maintained across runs. And finally, there's kind of any unpredictable human behavior needs to be handled appropriately. And so these, these circumstances make it really hard to deploy, long running agents reliably. And so that's why we've invested heavily in a runtime that enables that. So here's kind of a, like, table of contents for the rest of the talk today, which is mapping production requirements to runtime capabilities that DeepAgents and Linksmith deployment together offer. So I won't go through the whole list here, but, slide by slide, we'll kinda make our way through. I did see one question. I'll go ahead and answer. So the question is, any plans on implementing semantic caching for tool calls? I'm actually not sure what semantic caching means here. If you wanna elaborate a little bit, I might be able to answer more later. Cool. So the first production requirement for a long running, long context agent is reliability. This is definitely one of the most important ones. So, DeepAgents is built on top of lang graph, which is our agent runtime at langchain. It's open source. And durable execution is kind of the central pillar of lang graph. And what that means is that at every agent step, we write a checkpoint that documents what the agent can see at that point, so the agent state. And you can see on the diagram here, that's like c one and c two. Those are agent steps, and then we're checkpointing those into a persistence layer. And so that means if there's any sort of crash or transient failure, you can resume at some indefinite point later on another worker, perhaps, and have the exact snapshot of agent state available for you. This also means that you can, or durable execution, again, is the the foundation for all of these other production, requirements and the the needs that we meet. So human in the loop isn't possible without durable execution. Forking and time travel and kind of experimenting with different agent paths, isn't possible either. So durable execution is kind of the foundation for for reliability here. The second feature that we build in is memory. And so memory is really important not only for having agents that are effective, but for having agents that improve over time. And so deep agents and the agent runtime build in two forms of memory. One sort of colloquially, thinking about how human memory works, we call short term memory, and the other is long term memory. And so short term memory works with that durable execution system, where we persist message history into, our Postgres persistence layer. And so the short term memory consists of the message history for a given conversation. So, you know, the initiating human message, AI message and tool calls, etcetera. And that, like, short term context is very important in enabling, an agent to or a model to do a good job for the given task. If it doesn't have the most recent message history, it's it's very hard for it to do its job. And then long term memory is this kind of cross conversational memory, which allows for agents to get better out over time. So, for example, if I was using an email assistant and I expressed preferences about emails to certain coworkers, maybe, for example, if I'm emailing my boss, I'd like to use a more formal tone. Those memories can be persisted across turns, and over time, my email agent is gonna become more and more useful to me. And memory is is basically a primitive that you need to have built into an agent runtime. A very popular, runtime capability that we offer is guardrails via middleware. And so if you remember that initial kind of diagram for the agent loop that we looked at, it was a model calling tools in a loop, until it completed a task. And we still have that core agent loop here, but it's kind of enhanced with these middleware hooks. And so you can see we have hooks before and after the agent runs, before and after the model, and also directly around the model and tool calls. And what middleware enables is for you to inject, bespoke logic at any point. It can be deterministic code, etcetera, to make sure that your agent is running according to your policies and your use case. So maybe that looks like PII reduction in the first step or, tool call limits. The guardrails can really take many forms, and middleware is our kind of ultra flexible primitive for, allowing that. I saw one question in the chat was shared memory among FMs. I'm not sure what FMs is. And then also just following up on the semantic caching question. We don't have plans for semantic caching for tool calls in the short term. I'm wondering if this came up with the mention of prompt caching. But, yeah, I would be curious to learn more. I'll I'll definitely look into this. We we haven't seen many feature requests for it, though. Gotcha. So, FMs was LLMs. The question is shared memory among LLMs. I guess I would say that sometimes memories can be shared across agents. Often, they're scoped to users. That's kind of the most typical entity that we see for memory scoping. But the three that we just stored a bunch of documentation on are, kind of user scope, agent scope, and then org org scope memory. I would also consider skills to fall under the umbrella of memory because they can be learned and improved over time. And so that might be something that's, like, org scoped. Great. So moving on to another capability that, we offer in our, production ready runtime. So this is support for multitenancy, and there's kind of three off layers that enable this with Lynx Smith deployment. So the first is end users need to be authenticated in order to access a deployed agent. The second is, in order for the agent to access third party services on a user's behalf, we introduced this concept of agent auth. And then the third layer is we have built in RBAC. So it's like administrative, control of who has, you know, edit and, privileged access to the agent. Looks like we got another question about guardrails. So what are guardrails covered in lane chain and lane graph? So we actually have tons of prebuilt middleware. One example is the PII middleware, and that plugs in at different, steps in that middleware diagram. But we have lots of docs on our prebuilt middleware. Alright. So another runtime capability that, we offer is human oversight, also called human in the loop. And I mentioned this as kind of a steering primitive. And so what happens here is that if the agent drafts an action, let's say something sensitive like, you know, maybe booking a flight or some sort of other financial transaction, you can kind of interrupt mid mid run and surface payload to a human that is then responsible for resuming the, workflow with either an approval, a response, or rejection, or an edit to that sensitive action. And this, again, is powered by durable execution. So this interrupt can hang for an indefinite indefinite amount of time. And then whenever the agent resumes, it has the full state that, it paused with. Human oversight is is very important. We kind of built human in the loop into the lang graph ecosystem very early on, realizing that agents are incredibly powerful, but you do need a human in the loop at key times or your agents, you know, can't really be trusted to run. Great. So, another really cool feature that is enabled with Lynx Smith deployment and the agent server is real time interaction. So one thing that I mentioned that was hard for deployed agents was kind of unpredictable user behavior. And so this agent server builds in different patterns for how to handle what we call double texting. So the agent is already running, and then you receive a human message mid flight. What do you do with that message? And so we have four modes here. The one you see on the left, enqueue, is you sort of wait for the following AI message to then queue the human message. Reject is, you know, you kind of outright reject, the incoming human message. Interrupt to actually stop the agent operation and inject the human message there. And then finally, roll back as you, like, undo the previous steps and continue from the queued human message. And so these are all relevant for different applications. One example is, like, coding agents often by default will use the enqueue strategy, but you can, like, manually interrupt, with the escape key. Alright. So observability is a first class primitive for deployed deep agents. And this is incredibly important. If you don't have, kind of this observability primitive built in, it's really hard to improve and monitor your agents. So we talk about this kind of continuous improvement loop here where you build and, you you build your agent, and then you can observe and debug preproduction. You run evals, eventually deploy, and then you'll want to, you know, kind of continue observing in production, and use online evals with, annotations and human review to continue to, like, build and iterate and improve on your agent. I'll also note that at Interrupt, we released, engine, which is an agent that's built to ingest agent traces and then propose improvements to agents based on those traces. And so I think that's really where the direction of, observability and improvement is going for agents is that, like, automated, you know, agents building agents pattern. But this is a really exciting cycle and something that wasn't really powerful. I would say even, wasn't really possible, like, six months ago. So code execution for agents, is getting really hot right now. And the reason is because it unlocks, as I mentioned earlier, creative problem solving for agents. And so what I mean by that is if your agent is able to write code to explore data and, test solutions, etcetera, it's much more powerful than if it was just kind of given a fixed set of tools that it could use. This almost reminds me of, like, when people started giving, agents tools to execute SQL, like, the idea that the agent could or the model could write SQL, and then we would execute that against a database was much more flexible, than, you know, just having tools with preset queries or things like that. So code execution is incredibly powerful. DeepAgents enables support for any, sandbox integration. So Daytona, RunLoop, Linksmith also has a sandbox offering, and it's really important that sandboxes run code securely. And so you see the Lynx Smith sandbox auth proxy pattern here on the slides, which is that an agent, you know, runs on a host, which might have workspace secrets. You don't necessarily want those in the sandbox, but they can be kind of securely injected. And then the sandbox code can use an auth proxy to access external APIs securely. I'll also note we just rolled out a, REPL, kind of experimental code interpreter, which is a lighter weight version of a sandbox in deep agents. We're, we're pretty close to the end, so I'm just gonna continue through, and then I'll answer some more questions at the end. So I don't have a a pretty diagram on this slide, but I think integrations are one of the most powerful things that Linksmith deployment offers for agents. So automatically built in, you have MCP and a to a endpoints, and then also webhooks. So when your agent finishes running, you can, trigger things in Slack or other integrations, and you can also, you know, trigger your agents, via external services. And the reason that integrations are so important is often they're what get people using your agents. For example, our internal coding agent, OpenSuite, can be triggered in Slack threads with full Slack context. And so a lot of our kind of conceptual discussions happen in Slack, and then we can trigger, code development from there. Another capability offered by the, Lynx Smith deployment runtime is scheduled jobs. And so you can use Cron to schedule jobs for your agent. This is great for things like, kind of all across the board. That could be health checks, memory consolidation in the background, just kind of ambient agents that run on a schedule, like maybe issue triage or email triage, things like that. I won't dive too deep into the nitty gritty details here, but we have lots of different, cron run patterns so you can have stateful or stateless, cron. And to conclude, we wanna make it really easy for people to take deep agents to production. And so we currently have a private beta product called manage deep agents, which is the fastest path from that open source harness that we talked about, deep agents, to, using the production runtime and deploying with Lynx Smith deployment. You can use deep agents deploy to, kind of use some basic configuration for, you know, model, prompt, tools, skills, and take your agent to production in in minutes. Awesome. So looks like we have some more, questions. I can go over some of those. Okay. It looks like we tackled some of these already. Is agency part of the road map for deep agents? Again, I'm I'm not sure what that agency acronym means. You guys have a lot of a lot of good acronyms today. Maybe we can yeah. Okay. Any of the hosted API models, running link chain. So one of the best parts about link chain is that it's provider agnostic. So you can use major model providers. So, you know, think models like Cloud, Gemini, GPT models, but you can also use open source models. And we're seeing open source models get more and more powerful, and, cost less and less. So I actually think that open models are are close to a very exciting threshold. Alright. How could we describe the core differentiations between the lang chain and deep agent implementation of durable execution versus other durable execution implementations, for example, temporals? This is a fantastic question. The main differentiator that I would outline here is that lang graph is built, to be kind of agent first. And so a couple examples of that, streaming is really a first class primitive in lang graph, and so is, human in the loop. We talked about that a lot, kind of the indefinite, human in the loop patterns. And, so temporal and other durable execution engines, are very powerful for, like, general purpose, workflows that you need durable execution for, but they don't treat some of those, primitives as as first class, which makes it a little bit harder to build agents on top of. Awesome. So Jack asked, I noticed the pursue goal appear in the codex, Mac app this week. Are goals built into deep agents in a concrete way, in addition to skills? Fantastic question. This is kind of a a hint into our road map. So I just got off a call reviewing our new API for goals in DeepAgents. I think it should land tomorrow. So, yes, very short term is my answer here. Goals are really cool. So the idea here for folks who aren't familiar is you can set up an agent, you know, with an explicit goal. For example, like, make sure all tests are passing, and we'll actually run a specialized sub agent after the main agent loop that confirms that that, goal has been achieved. And so this is a way to, like, really keep your agents on track and make sure that they, achieve a final task before returning. Yeah. Great question. Yeah. Arbitrarily long agents, here we come indeed. Okay. So the semantic caching for tool calls, I'm not sure exactly. I need to I need to read more on that, article you posted. But, definitely, we are investing heavily in kind of provider agnostic caching, and, like, making sure our caching is working really well under the hood because we do see people building longer and longer running agents. Okay. Broader scope are the, top 10 agentic deployments vulnerabilities addressed. I'm not sure about these specific agentic deployment vulnerabilities. We work pretty hard on on security and things, though. Yeah. Happy to happy to learn more. I think we I think we covered this one. How do the secrets get injected? So this is for the, the sandbox auth pattern. We actually wrote a great deep dive blog post on sandboxes that we can, post after the fact, but I'll I'll share that resource for more of the details of, kind of the auth handling for sandboxes. What guardrails are covered in lang sheet and lang graph? We covered this a little bit. So we do have some built in ones like PII redaction and then, also some more, like, fault tolerance guardrails. And then, also, we have, some kind of, like, control flow guardrails, so, like, model call limits, tool call limits, etcetera. And a lot of that is in our, kind of pre built middleware stack. Okay. Great question. What are some capabilities provided to tackle prompt Jackson for sensitive data? So I would actually also recommend, guardrails, via middleware here. And so you can have a before agent guardrail that runs and, you know, does some preventative work for tackling, like, prompt injection. And then I also just shared, our built in middleware, page. See if we have any more questions. These have been good questions. Also, I'm sharing our detailed blog post on auth proxy stuff. Awesome. So looks like we don't have any more questions. Thank you all for for your questions. These were it's a good list. Yeah. Feel free to oh, it looks like maybe we have one more. I'll I'll wait on the one last question here. But, yeah, in terms of deployments, getting started, with managed deep agents is the easiest entry point here. And then deep agents, the kind of open source harness powering all of this, is available. Can pip install deep agents? We have Python and TypeScript, packages. And if you have any any issues or anything like that, we have an open forum and then also, issues pages, and we welcome contributions. The recording will be available for this session. Very common question. Yes. Okay. And then the last question is, do basically, does the managed platform address concerns around prompt injection, tool misuse, and other vulnerabilities? So you can add that via middleware, and then all of that middleware runs, on the managed platform, and runs with that those, like, durable execution things built in. Thanks, folks. Really appreciated your your questions, and, we are excited for more webinars in the future.