And then same thing with the iteration, you can basically, you know, cycle back between nodes and nodes. So for example, this orchestrator goes to a code executor loop or it goes to synthesizer once it's done. And then like there's some safety in there, being that when we use this vmprec context, you know, it's pretty much sandbox. We don't allow it to test the file system, network or spawn any other separate processing. So again, here is that a graph-to-jargon memory, we have the orchestrator. The orchestrator basically will call the code executor. The code executor is going to basically decide if it needs to, you know, get back into the main orchestrator. If orchestrator needs more information, it will spawn more code executors and it'll basically go if we run on max term. So here's one thing to mention is that we want to set a limit on how many times we'll go through the cycle, but we couldn't run into an infinite loop. So either it's going to have enough information to basically move on to synthesize results and give an answer or if we're detecting an infinite loop, we're going to break out of it and then synthesize what we have and then break out of it.
Okay. So here I'm looking at my terminal and then here we're going to have two examples and we'll show the code in this and briefly what I'm going to do right now is I'm going to run npm run naive. This is basically a simple script that's going to load a very large document or a template with a very large document inside of it. So let's take that doc for a second. So this is this. So imagine it's like some big library of all of your tech documentation and you're trying to figure out, you know, what are some things that are deprecated that you're trying to, you know, need to do for migration, but for whatever reason the document is so large, right, that you could probably barely, I can't even barely load the preview because there's so much text. And let's say I want to say hey, you know, claud or codex, in this case it's going to be signed, um, 4.5, we're going to say load this document in your context, I'm going to ask some questions about it to help me put some migration. So cool, let's run it and then, oh no, what happens? We run into an issue. The prompt is too long, right, because our number of tokens exceeds the maximum. So we can't do anything here, we're dead in the water, like what can we do at this point in time? So what we can do is we can basically run another version that uses our RLM that's going to basically spawn so many sub-agents. What I'm going to do now is just run it and just like look at the logs. We'll also look at another tool called Langsmith that allows us to like see the actual trace. You see right now it actually loads our configuration, right, we give it the query, we have Langsmith basically like tracing and tracking every action our large language model is doing, it keeps track of the cost and other information that may be useful. So right now we have the orchestrator generating the code, we have our sandbox, we see here that we got eight sections that we partitioned for analysis, we're now analyzing looking for breaking changes, and then what we're doing here is we have these calls to this sub-RLM method, which basically is going to take that code, take our existing context, and then just like pass in a prompt to it. We're going to say what are the breaking changes, give us back some information, and then now we see at the end of the day, we're able to parse through that large text and get back some actual results, right. So we actually were able to parse through this and didn't take that, didn't take that long. If we look over here and we go into Langsmith, we'll be able to see, and I'm just going to close this out, we'll be able to see like what happened. We can trace through. The orchestrator kicked off, we see how many tokens that he used, we can tell what the model was, we can tell how long we executed for, and we can tell what node it went to, so now it's our code executor, and we see that we spawned about eight, I want to say eight of these smaller RLMs that have this own context, right, and it has its own prompt that we're passing into it. So what we see here, the main orchestrator asks it, what are the breaking changes in this text? It gives this text to analyze, right, and then it goes through, parses it, that's its input, it gives back some output, and you can see the metadata associated with the call.
Comments