Build Autonomous Loops for Your AI Agents
- Published:
- Length: 36:32
- Channel: Eugene Vyborov
- Video: https://www.youtube.com/watch?v=q3YvFYtuhec
- YouTube video id: q3YvFYtuhec
Description on YouTube
June 11 Workshop on building advanced agent loops with Trinity. Free agent builder workshops every Thursday: https://www.ability.ai/workshops Most AI agent tutorials show you how to run simple tasks that stop when you close your laptop. True autonomy requires a different approach: loop engineering. This pattern allows your agents to run complex, multi-step jobs remotely, 24/7, with built-in guardrails to prevent errors and runaway costs. In this workshop, you'll learn the fundamental patterns of loop engineering and how to deploy autonomous loops on the Trinity platform, enabling your agents to work through entire backlogs of tasks without your direct supervision. In this video, I cover: - The core logic of a "Playbook": a reusable skill built on Read State, Do Work, Verify, and Write State. - The key difference between a "Loop" (for finite work buckets) and a "Schedule" (for continuous tasks). - How to set crucial termination conditions to prevent runaway agents: max runs, stop signals, timeouts, and cost ceilings. - The main advantage of Trinity loops: running jobs remotely in a clean context, even after you close your laptop. - A practical demo of triggering a remote loop for one agent to call another in a multi-agent workflow. By mastering loops, you shift from prompting agents for one-off tasks to engineering truly autonomous systems. This is the next step in building scalable agentic workflows. --- TIMESTAMPS: 0:00 - Introduction: The Power of Agent Loops 1:15 - What is the Trinity Agent Platform? 5:55 - The Core Concept of Loop Engineering 9:30 - Guardrails: How to Safely Terminate a Loop 10:40 - Loops vs. Schedules: Which to Use? 13:45 - Why Remote Loops Are Superior to Local Loops 20:05 - Practical Demo: Running an Autonomous "Think" Loop 34:10 - Advanced Demo: Triggering Multi-Agent Loops --- Connect with me: Twitter/X: https://x.com/evyborov LinkedIn: https://www.linkedin.com/in/eugenevyborov/ Substack: https://eugenevyborov.substack.com/ Try Trinity (free, open source): Platform: https://trinity.ability.ai GitHub: https://github.com/Abilityai/trinity Docs: https://docs.ability.ai
Full transcript
[0:00]Loops just make it easier for the ad hoc tasks that I just need to do right now and move on to something else. So, you can see this repetitive columns. This is this loop actually running. You can see some of them happening before that and then there's another loop with an a different agent. Whole point of this exercise with Trinity, and I will show you how that works in Trinity, is to be able to run those loops on a remote machine and independently of what you're doing. So, that at 3:00 a.m. this thing was doing what you told it to do in the kind of bounded fashion.
[0:37]>> [music] >> Okay, guys. Let's go. So, today I want to talk about a very exciting topic, something that is quite loud out there on the marketplace and a lot of people, agent engineers, and people using agents are talking about this topic. And for good reason actually, because it opens up new possibilities of working with agentic systems. And it's a mental construct that actually helps you better understand how agents could be used and apply them in completely new use case
[1:11]use cases never probably tried before. And the topic is loop engineering, as you may have guessed from the title of this workshop. And I want to start it first of all with, as always, a recap of what Trinity is, because we're going to be talking about this in the context of uh Trinity as a system. And this little diagram explains it schematically, but I will also go back to Trinity in a second and show you uh a couple of things. Just again, for you to be in context of what's happening. So, Trinity is a sovereign
[1:45]infrastructure and orchestration layer for autonomous AI agents. This is a mouthful, but to explain that this is basically a platform that you install within your infrastructure on your servers behind your VPN. It's not a SaaS solution. And it runs your agents. Usually, those are cloud code-based agents, and those agents are sandboxed in the Docker containers. They are exchanging messages with each other. They have permissions layer. They have very advanced MCP layer for external connections. But more importantly, it provides you the guardrails as a system and
[2:19]the kind of governance that is usually, you know, met in the enterprise level systems. It allows you to see what's happening. It allows you to version your agents and make sure that you can roll back to any versions that you need to. It gives you human-in-the-loop loop capabilities, full observability, audit trailing, self-healing capabilities, credential management, and a lot of things like that. It's very easy to get started. And also, those agents that you've built and that are possibly collaborating with each other and doing some intelligent work,
[2:52]they are first of all stateful, meaning that they are getting smarter over time. They're getting gaining experience and gaining value for you and for your company. And they can be exposed for the external use. And this external use could be either by yourself, your colleagues, your company, or even your clients. And those exposure channels could be anything from, you know, just a web to cloud, to Slack, to WhatsApp, to Telegram, and even from the recent versions through the telephony. Uh now, let me briefly switch to the Trinity
[3:24]itself and show you how that looks like and what it is. And as I mentioned, this is just one of the instances that we run. Each box over here is a Docker container. Each box over here is a GitHub repository as well. And those agents are each of them is executing their particular not objective, but rather area of responsibility. And they are collaborating with each other when it's necessary in order to, you know, achieve your objectives. Now, we have multitude of of instances running. Like this is another one running pretty complex multi-agent system. This is yet another one that is
[3:57]running some of my kind of personal agents. And on this timeline view over here, you can see the actual executions and data exchanges between those agents and the loops, MCP calls, user sessions, etc., etc. If you click on an agent, you end up on this overview page that shows you the activity trends of the agent and the context consumption and execution rates and things like that. Of course, if we dive a little deeper in terms of the other functionality, there's a chat, there's a more detailed dashboard for each agent. And each agent actually has an opportunity to create a
[4:32]dashboard for itself and it will be custom to this particular agent. So, for Cornelius, for example, which is again the agent we're going to be talking about today for the most part, this dashboard looks like this. Then, of course, we have schedules and we have loops as well. And those loops is something that we're going to be looking at today and talking about today. As you can see, one of them is running. There's a bunch of them that have been completed. And there's also playbook management, credential management, even payments, as well as sharing capabilities that allows you to expose this agent through the public
[5:03]links or through the Telegram, WhatsApp, Slack, whatever it is you prefer to use. What I find more kind of even more interesting within the system or is the permission layer and overall controls around what users can access and see and also what agents can access and see. Like, what other agents they can talk to and in what circumstances and things like that. For example, there's relatively new operations section that has an ability for agents to communicate back and ask for approvals or bring up
[5:36]the problems that they have. Uh there's also executions dashboard that shows what has been happening across the platform. And those loops is something that you see over here happening. Like, this little kind of bars. And actually, there's one loop happening right now as we have already seen. But before we dive into practical examples, which we will, I want to go through a little presentation explaining the concept of loops. So, first of all, it it it got quite popular on the marketplace because it's a convenient tool to use. And people are saying that they're basically no no longer writing individual sort of
[6:10]prompts nor designing prompts, but rather designing loops because those loops allow to allow agents to execute sets of tasks in a controllable fashion. And as you can see from examples over here, Anthropic themselves are very actively using those loops in the development. Everybody who is working with agents on an advanced level is using that. And the basic logic of this whole thing is that the pattern I want to explain on these couple of slides. So, let me start with the playbook. So, a playbook is a concept that we use sort of internally. It's an advanced version
[6:42]of a skill in Cloud Code, which is basically a fixed set of instructions for an agent to do something. For example, go and check your email or analyze some information on or go and create a piece of content. Whatever it is, usually we package it into a playbook so that we can then reuse it within the context of this agent. And the the typical playbook logically consists of these four steps. So, it first of all reads the state. And as I mentioned in Trinity, the state is stored in just basic files in the Git
[7:16]repository. So, all it needs to do is to read the files that, you know, it it it needs to read in order to begin the job. And sometimes it's not only files, but also some external data sources where it can read some information. Then it does the piece of work. Basically, executes whatever it is it needs to execute. And then it verifies this work. And usually this is a separate step that we implement with the help of checklists. It's a very helpful kind of mental model. It's like in the aviation they have checklists and over here for agents
[7:49]we also have checklists where they just signing off on certain stuff that we need them to make sure to sign off upon. And then they write state, meaning that they save the results of their work into files and maybe even commit it to the GitHub repository. Now, once this playbook is created, it can be executed in the chat, in the local cloud code, or in Trinity. It can run on schedule and it can run in a loop and that's exactly what we're going to be talking about. Let me go back to Cornelius one more time. And if I go to playbooks, as you can see this
[8:21]particular agent has a ton of different playbooks already embedded into that. And when we design schedules, we design them around those playbooks. Sometimes they can be free form text, but most of the time this are the calls of this individual playbooks so that we have a repeatable process. And so, I hope that one is clear. This is like playbooks. Playbooks are just boxes of logic that agent needs to execute that you can reuse. Now, once you have this playbook or once you have this piece of logic, what you
[8:53]can do is you can basically loop over that. And you can have agent execute the same logic over and over again in the clean context. And so basically imagine there is the first run. The agent reads something, does the work, verifies, and writes. Then it passes over to the next run and it you know, the same happens and then the same happens and then the same happens. And if you are from software engineering, you're probably familiar with that because this is like any other loop that you can find there. In case of agents, it can be designed as a while
[9:27]loop or for loop or any other type of loop really because it's flexible enough. And yes, as you can see over here, there is an exchange of the state with the files in the workspace or Git or some other systems even. And then when the loop is running, we can configure this loop to be terminated based on the number of signals that are coming from there. And actually that part is kind of the core of the loop logic. So we can say the maximum number of runs that this agent can run the loop for and that's pretty simple. It's like four loops with
[10:00]the maximum number of runs. Then we have stop signal and that's something kind of new because the stop signal can be called at any time by the logic of the agent themselves. Basically, depending on the task in the middle of the task execution, agent can decide, "Look, I I am done with this stuff with this particular item. So I'm going to just return this flag." And that is going to stop the loop. There is a timeout. Basically, run it but no longer than 2 hours. Do whatever you like but no longer than 2 hours. And there's also a cost ceiling limitation
[10:33]which is very important because we have seen cases on the marketplace when people spend thousands upon thousands of dollars just simply because they forgot about that and agent kind of went doing stuff for a long while. So now I want you to look at this kind of patterns if you'd like because some people are asking, "Okay, so how is loop really different from the schedule?" Because essentially a schedule is something that executes, say, you know, every Tuesday at 10:00 a.m. or every 2 hours non-stop. And there is a a bit of a different logic on when you apply
[11:08]those two. So I I came up with this little bucket analogy. So basically, if you have a bucket of work, you have a list of things that need to be done, a backlog if you'd like. And this backlog is constantly refilling because of the logic of an agent. That is more like a schedule type of a pattern. That's where you kind of, "Okay, this this needs to happen all the time. So we need to create a schedule and set it up and it will be running for as long as we want. In the loop case, one situation where I'm using it the most is when I again
[11:40]have the bucket of work that I have something that needs to be done, but limited in terms of what needs to be processed. So, simply put, it's going to work on this bucket until it's done. And also the second distinction over here is that this bucket can be one-off. It can be unique to a particular task or objective that you are working upon, whereas schedule is something that you want to keep running for a long while. And again, one more hopefully helpful now analogy is when we're using sort of schedules, we're talking about the
[12:15]independent runs between each other and the stable state. Actually, when we're talking about loops over here. One situation is when we have a a stable state, which means that the files are >> [clears throat] >> not changing, but we're just working on the more work that is coming in. And then we have the loops where we're working on the incremental state and convergent runs, where basically there is a logic of finishing a particular piece of work. I will show you each of these individual patterns on its own. Now, loops are not perfect. They can
[12:48]fail, and here is a couple of reasons that they can fail. So, first of all, the doom loop, as you can see, is when the tool output reenters context. So, the same calls loop fresh again and again, and basically runs for forever. That's why we need all these termination state, where we are saying that don't run for more than X or whatever. And then there is a research and practical research saying that if we have too long of a trajectory, so basically if we have an autonomous task that is split on stages in this loop, but it's too complex, it basically says
[13:23]that it tends to degrade at the long trajectory. So, we need to be careful that it kind of doesn't diverge into all sorts of different directions. Agents still need some control over this part. They do tend to diverge a little bit. And then, of course, the runaway effect, especially with the budget, and that's why we need a high kind of ceiling control in terms of how much it can spend in terms of money or in terms of tokens or actually in terms of time and number of iterations. Those things are kind of
[13:56]replaceable. Now, the interesting part is, okay, where do the loops run? So, I want to switch for just a second to Claude code and show you something. Because where you may have seen loops already is inside the Claude code. Because recently recently they introduced this loop concept that is based on the not on the Trinity loop. I'm talking about the regular loop based on the Claude code where you can just basically say what you want it to execute and with what, let's say, 5 minutes, say something.
[14:31]Unfortunately, it's running the Trinity loop instead and because it's the same name. Actually, I haven't run into this problem before because it kind of replaces the name. Maybe I will have to rename the Trinity one so it didn't conflict. But, yeah, I hope it makes sense because what it does, it this loop thing, is it runs the looped iterations, but over here on your local Claude code rather than anywhere remotely. Let's go back to the presentation. Over here.
[15:03]What it means is once you close the laptop, the loop is gone. The second is that if you're running it locally, it fills up your context. It's not running every loop in the clean context. Actually, maybe there is a mode to do that in clean context, but as far as I used it, and I use it quite a lot, local one, it continues to do that in the same context. But, you know, clean context loops are a bit better, I would say. And yeah, of course, the whole point of this exercise with Trinity, and I will show you how that works in Trinity, is
[15:36]to be able to run those loops on a remote machine and independently of what you're doing. So, that, you know, at 3:00 a.m. this thing was doing what you told it to do in a kind of bounded fashion. So, you told it what to do for a number of iterations or for some period of time and it keeps doing that until it's either done or it reaches the termination stage, which is number of iterations, budget, or duration. And so, we introduced recently this Trinity loop primitive that basically, it's a couple of MCP tools of Trinity itself. It's as simple as that, really.
[16:10]But, again, the idea is whenever you talk to an agent on Trinity through the MCP, you can call a method for looping something with this a particular agent. You can specify what is the maximum number of runs. You can specify what is the condition for stopping. In the process of actually executing this, executing the loop, the agents are going to be in the context of the previous execution. So, there's a capability to pass over the previous response so that you can pass over part of the context as well as the number of the execution. Now, let's
[16:43]go to a bit of a bit of a practical side. So, as I mentioned, those playbooks or skills that are packaged in this kind of boxes of logic, these are the intent contracts. These are the pieces of work that you want agent to be doing remotely and autonomously while, you know, you're sleeping or doing something else. And yeah, basically, you can configure it to be as detailed as possible in order to validate that actual state that it saves or the logic that it does is sound. So, it becomes less of a non-deterministic kind of vibing and
[17:18]more specific checklist of execution. And yeah, this one is very important actually because that's the basis of how I'm going to be showing you how to use that. So, if you remember, if you're here not for the first time, for Trinity we have this docs website and this docs website is actually quite detailed, but it also has this plugins section. What we did is we developed a bunch of not a bunch, just three or four plugins that are available on the abilities plugin marketplace. That is something that can be installed inside your own cloud code
[17:52]with super simple commands like this, plugin marketplace add, and that's it. Even with user interface itself as we can see over here, you can just say plugins and then you can search them by name. Over here, I already have it installed and sometimes we update it, so I just call update just to have all the recent skills. But as you can see, it has a number of installed a number of plugins over there. The one that is important for us at this kind of session is the Trinity plugin. Because this Trinity plugin is what
[18:24]includes this looping mechanism. And really this is just a skill. There's nothing more, it's nothing more than a skill, but this skill is aware of the MCP methods and commands inside of Trinity. So, it basically it gives the local cloud code agent a durable way to run loops on the counterpart remotely. And that's the model under which I'm working all the time. I usually, since those agents are synchronized through the GitHub, I usually run a local copy of an agent and a remote copy of an agent.
[18:57]Like in this specific case, on the right-hand side you can see the local copy of Cornelius and on the left-hand side you can see the same exact Cornelius but running on the remote. And they are synchronized with the GitHub calls. So, what this plugin really gives us is an ability to run the loops from the local one on the remote one while you sleep if you'd like. Right. So, I want to show you examples of how to work with loops based on Cornelius agent. Cornelius is also our
[19:31]open-source agent that is second brain type of agent, knowledge-based type of agent that is also open-source if you'd like to find that it's on GitHub. Cornelius Cornelius sitting over here once the GitHub works. So, you can build your own knowledge bases out of this >> [clears throat] >> and deploy them to Trinity and use them. And actually, you know, the more I work with Cornelius and Trinity, the more I see that you know, we're integrating them more and more. So, this concept of
[20:03]the knowledge-based based agent basically participating in every implementation we do on Trinity as the cornerstone component, as something to build around to you know, make the system intelligent overall. And we will go into practice. So, as an example, over here I already run the Trinity loop. Take a look over here on the top. The reason I I I did that beforehand is because it just, you know, takes the time for for the loop to execute, so it makes sense to run it before and show you the results and then
[20:36]we will do some runs as well. So, you can see this repetitive columns. This is this loop actually running. You can see some of them happening before that and then there's another loop with an a different agent that is happening. And as you can see, this is just a sequence of executions. Now, for this particular agent, for Cornelius, I created this think about it skill or playbook that basically I mean, it's it's a super straightforward playbook that just has this agent think about a particular given topic for some time until it reaches a certain conclusion
[21:09]and then terminate. I told it here that look, I want you to run it as you can see it's almost free form text. So, the only thing is not free form is the actual playbook to make sure that it does call it. And then I give it a free form text on the topic in this case risk profile of the SpaceX PO. And then I'm saying okay, make it 30 seconds apart with max 10 iterations and exit when you're done. And this exit when you're done basically is the call for an agent to decide that okay, I'm done thinking. I'm kind of considered this thing from every
[21:41]perspective. So, that's exactly what I'm going to do. So, what happened as the result of execution of this loop is basically exactly that. It run eight out of 10 times and the remote agent converged and the returned this done signal and basically returned us the information. Now, let's try something else. Actually, I'll show you how to do something simple first just to demonstrate that it works. Again, we're just saying loop and then I'm going to say I don't know, just test loop
[22:14]up to 10 times with 1 minute break but terminate at I don't know execution two. So, really it's a free form kind of thing. But I want you to see what is happening and how how that works over here. So, first of all, what it's going to do hopefully once it gets there I should have switched to a faster model actually now just to show you. But whatever, let's leave it to what it is.
[22:46]What it's going to do is just saying okay, I'm going to start the remote agent. And we can instantly see that on the left hand side, this is the first execution that is happening. What's what's going on right now is that this agent basically called Trinity with the use of the MCP server. And what it also does, it also starts the local looping in order to monitor this remote execution. This is optional, you can kind of disconnect it, turn it off. But the logic is that just for to keep you aware, it also starts the local loop or
[23:19]launches this loop thing. This is actually the challenge over here. The local loop is not executable by model. So, it started a sleeper to wake up and check on the progress. And yeah, as you can see the loop is started. We can see it over here. We can go back to the actual agent, open the loops section, and see this loop execution running over here. And we can also take a look at the other ones. And this is the one that was thinking about this basics IPO, and it went through a number of
[23:53]iterations. We can see the cost of those iterations, which is important if you're using API directly rather than subscription, duration, and the final result of of this execution of this loop. So, I want to show you how I actually use this thing in practice. Because that one is quite important. So, in Cornelius itself, which is this knowledge base, I have a skill called incubation loop. I talked about this incubation loop in one of the previous videos, but the idea over here is that you give it a topic.
[24:26]It's like more advanced version of this thinking that I was showing you. It's more advanced because it uses actually Bayesian logic. It uses some self-criticism logic. It uses different ways of looking into things in order to understand. So, this is not like a toy skill to show, but this is the actual skill that I use to analyze various things. Uh we can start and we probably should start the same topic over here on the loop. And it will, you know, do this analysis for a long while until it converges on a certain response.
[24:59]And this is what happened over here. Let's take a look at the execution details. And yes, we can see that this is the last iteration that converged a particular opinion on the topic that we specified. So, let's do it once more just because I'm curious and we're going to do loop yourself. You don't have to say [clears throat] that, but the thing is through the MCP server, actually, depending on the key that is configured in the MCP server, we do have ability to run loops for a
[25:32]number of agents rather than for just this agent. So, by default, if I don't specify anything, it's going to run it for this agent, but I can also specify a different agent to run the loop for. So, let's do incubation loop for the topic of risk analysis of these basics IPO. Let's say up to 10 iterations and finish when converged.
[26:07]In the incubation loop itself, there is a logic of convergence, which happens when after additional research and additional thinking, uh there is no more headway that this agent can do in terms of changing its understanding of the topic. It usually takes five, six steps and I know that it's definitely going to finish within 10 steps. So, that's why I'm running this thing. Actually, if I go to schedules, if I'm not mistaken, I do run incubation loop. Yes, I do run incubation loop over here on an hourly basis anyway, and it's an important
[26:42]pattern over here that I want to consider. So, see, this one isn't the one that I launch launched just now on the right is an ad hoc, meaning that I came up with something that I want to work through and I sent this agent to work and forget about that until it basically finishes. I can achieve the same right now with the design of the schedules. When So, this incubation loop is running hourly, it looks at a particular file that is a thinking registry, which basically has a knowledge base of topics to look at. So,
[27:17]another thing I can do is I can just update this list of topics and synchronize the agents and we're going to be done cuz it's going to be doing and running that until it finishes. The difference really is that this one is more controllable and it's rather an instrument for me to do certain stuff that is taking like longer executions for agents rather than leave it be there for a long while until I come back and validate the results. So, again, if we go back to loops, we can see that this loop just started. The previous one that we tested like
[27:51]literally only now just finished. It was just a basic test loop. And yeah, this is this is the basic logic. Now, if we think a little more of a different use cases where loops can be used, I would say, let me show you a couple more agents. Yeah, I run a different version of Cornelius. This is called Cornelius M, which is the Moldbug version. This agent runs on Moldbug and, you know, this influencer within the system. It has some karma, some comments and stuff like that. And what I did just before
[28:26]this workshop is I took this agent, let me put it over here on top, and I took this agent and I started the loop to hunt for comments where the insights of an agent can be useful. I told it, "Okay, you have 20 iterations with like a minute break and, you know, go have fun." And so, what you can see is happening is again the same exact stuff. It's basically monitoring locally what is going on with with the loop. It doesn't have to be the case, but we can see that it's running over here on the left. We can see, you know, what is the progress
[28:58]of that one and when it is going to converge. I don't think it's actually going to run out of the topics to comment upon because again, it's a vast knowledge base behind that. So, it will always find stuff to talk about. But yeah, that's another sort of example when you have some sort of agent that is collaborating with something externally. So, if we talk about software development, basically any process, like if I need to validate pull requests or I need to work on like small issues develop development where I can leave my
[29:31]agent do that without the need to monitor it all the time. And I have a very specific procedure outlined that, you know, tells it what needs to be done. Then I easily launch it in a loop and clear up the backlog. I launch it in a loop and I review all the pull requests. Or I launch it in a loop and make sure that, you know, the documentation is updated. Basically any kind of repetitive process where you can imagine having a backlog of things of similar things to do with the skill that can do those things is well executable in the in this loop approach.
[30:06]Really it feels to me that we're going back to like it's you know, looping is a basic software engineering concept. It's one of the first things that you are taught as a software engineer when you start this process. And now we finally found a way for that to scale our agentic development workflows. I think it's invaluable tool. Like I have agents running on schedules for for ages now. Like these these guys are doing all sorts of stuff on their own. But often times I had to jump through the hoops in order to make the schedule work the way
[30:41]I want it to. And loops just make it easier and especially make it easier for the ad hoc tasks that I just need to do right now and move on to something else after that. So yeah, playbooks as in, you know, this callable skills is something you can use if you already have a procedure and the procedure is packaged into this skill, but you don't have to. You can just do free-form kind of thing to an agent to research something, monitor something, understand
[31:13]something, etc. I guess one more example I can show you is so there is a Cleon a family of agents that are running on another instance. This agent on the right is this Cleon agent that kind of oversees and controls this thing. What I do over here quite regularly is I run a loop of the monitor state. Monitor is basically like checking the situation on the orchestration side of the system, finding potential issues, bringing them up or resolving them and things like
[31:46]that. And I'm running this kind of monitoring on on the loop. And for the most part I was running that from my local machine from the loop embedded in the cloud code, but now it's different because I can run it remotely on the remote machine and don't have to keep my cloud code open or do anything about it. Because as you understand, like I started this loop over here for remote Cornelius, for example, I can close this right now and the loop keeps running and when it's done I will, you know, come back and see the results. So that's basically the enabler for the
[32:20]true autonomy within those agents. Yeah, so I think I'm going to wrap up on that and if you guys have any questions, I would love to answer because the topic is quite interesting. So the question is what happens if a run fails halfway? Does the loop keep going or on a broken state or stop? The loop stops. That's the hard configuration right now. However, I think we will soon add additional configuration that allows it to keep going. My thinking is that actually stopping is the right behavior
[32:54]because you know, if the expectation is that two different use cases. If you expect the state to change between loops and the next steps depend on the previous step, then you definitely need to fail. If you expect that it doesn't really matter if it failed processing this bucket item, but it will pick it up on the next execution, then you can set it up to kind of self-recover and keep going. Okay, another question. How much does a typical overnight loop like Cornelius one actually cost? That's a great
[33:27]question because the one I cannot answer properly and I'll tell you why. The reason is that Trinity is running on subscriptions, and not on direct API calls. So, subscription multiple subscriptions can be configured inside the settings. So, I have several subscriptions configured over here and uh the platform is switching between those subscriptions when it is hitting the limit. Simply, as long as it stays within the allocated subscriptions and you know, recovers from the failures
[34:00]there, I'm fine. That's one of the beauties of of this approach. All right. Well, I hope you guys enjoyed it and found it useful. Oh, one more question. Can this loops run on a multi-agent workflows reliably and can you set a sleep timer between iterations by prompting? Yes and yes. So, look, once some message ends up in Let's actually run this experiment. Once the message ends up in in a remote Trinity, it can call agents that it has access to. So, for that we need to configure that in
[34:33]the permissions. For example, I can enable a permission to access Corbin for for Cornelius and that means that it will be able to run it. And when you call this loops by design, you need to kind of configure the period in between the calls. When I did the mold book one, if you remember, I specifically told it that, you know, make like some some break between those executions. As you can see, the break is happening over here. Let's test how that works with actually executing. So, let's start the loop and send
[35:07]a test message to Corbin five times with 30-second break. We can continue on specifying the exit criteria and stuff like that, but essentially each agent on Trinity has access to the MCP server and those MCP servers are allowing access to other agents that it has permission to. So, if everything works out well, which I think it will, but let's see. We will see call coming from over here
[35:41]from Cornelius to Corbin with some sort of test message and coming back. Yeah, there you go. So, you see the local version called the remote version of Cornelius and remote version called the remote version of Corbin over here, got response and kind of stopped until the next execution. So, that's exactly how it's supposed to supposed to work. All right, guys. Thank you very much for joining today. I hope it made sense and follow follow me on YouTube. If you're
[36:14]watching that on YouTube, I'm publishing these type of videos quite regularly and join us on Thursdays on this workshops where every week I'm talking about other things that you can do with agents with help of Trinity or without it. Thank you very much. Bye-bye.