📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

Build a Self Learning AI Trading Agent with Hermes (Full Setup Guide)

AI Pathways20:49

Transcription

In today's video, I'll show you how I built a self-learning AI trading agent using Hermes, which is basically one of the most powerful AI agents on the market right now. We can use Hermes to act as our 24/7 AI analyst that can monitor markets and our own portfolio for us. It can scan for trade setups and even send signals, alerts, and trading suggestions directly to my phone. And because we're using Hermes, it actually has a self-improving loop with persistent memory.

What this means is that it can actually remember things like your portfolio, trading styles, strategies, and your positions. So, it's going to take all this information across every single conversation and actually improve it over time by building skills. This means that the more you use Hermes and the trading agent, the better it gets.

Now, this is huge since on the channel, I almost always cover either Claude code or Claude as a whole. But now with Hermes, I basically have my own AI trading employee. So, I can wake up in the morning, check my phone, see what trades it found for me or any research that I asked it to do. I can approve trades without ever even opening up my laptop, and then throughout the day, I can chat with Hermes like it's my own employee. So, I have what is essentially a trading analyst on my phone at all times.

So, in this video, I'm going to show you exactly how Hermes works, examples of how to use it, and how to set it up yourself since it's super easy to get going. It's an open-source framework, so it's completely free to use once you connect your LLM to it. You really just need your own local dedicated computer or VPS from Hostinger and a messaging platform like Telegram, Discord, even iMessage. And once we do get it set up, you basically have this assistant that you can talk to rather than using Claude or Claude code to write these complex Python scripts.

And like always, this video is for educational purposes only. I'm not guaranteeing any profits in this video as everyone would use Hermes differently. This is a super simple agent to use when it's all set up. And here on the screen, you can see all the available tools and skills that it can actually do for you.

So, to start with the tools, we can see that it's able to browse the web for us, execute code, take control of your computer as well. Cron jobs are what you can use to automate certain tasks. So, this is going to be super helpful. You can literally just go to Telegram, message the Hermes agent, never look at any code at all. All you need to do is connect Hermes agents to either Claude chat GPT or another AI provider and you're pretty much good to go.

So with plain language, you can tell your agent your portfolio, trading styles, strategies you're using or you want to test. You can monitor certain sectors like semiconductors and then you can also automate the actions with cron jobs so that it runs every single day, hour, minute.

Now the benefit here of using a Hermes agent rather than just typing to Claude or using Claude code is that everything basically lives inside your messages. This means that as you chat with this Hermes agent, it's basically going to learn everything about you, how you trade, what you like it to do, it saves all this information into its persistent memory and it even creates skills files around all these questions that you ask it and all these things you want it to monitor. This way, the more you use this trading agent, the better it learns and adapts to you specifically.

You have the benefits of building out automated systems that you typically would do in Claude code. So those are the more robust and complex systems that you would have Claude code essentially generate code for you for. But it's also super easy to chat to have it do things for you, execute triggers, and set up automated alerts. But you don't need super detailed prompts with endless debugging inside an IDE. Hermes will just simply create files for you, skills for you, search the web for you, and automatically do things for you.

So just to give an example, let me just say, "Hello, Hermes." So this is how we basically wake it up, start talking to it. And then each time, like I said, when you chat with Hermes, it's going to remember everything that you've talked about before, your portfolios, trading styles, things like that. So as a first example, I can just simply ask to give a morning briefing as of Friday when the markets were last open. And then, as we can see, it's typing, thinking, and basically going to give us back a response on whatever we asked. It's going to be able to go through its skills that it's built for us. And again, this is specific to you as it learns more and more about you and how you like to conversate and use Hermes.

And then here we can see our market briefing that's tailored specifically to us. Now, Hermes does have the context that I like to look at market regimes, specifically VIX to see how the macro market is doing. And then it actually goes through our portfolio. So again, it has the context because I've chatted with Hermes before, but if this is your first time using it, you would obviously feed it what you're currently trading, what you're currently holding. And then it's going to give you a summary on your current longs. So here we have Nvidia, Microsoft, and then we also have our calls that we're holding. So Nokia, Service Now, Sony, Oracle, things of that sort. And this way you're going to have, you know, advice from Hermes based on all this information, sizing, preferences, and then approximate share accounts. Everything that you would ever really need inside a morning briefing.

Now, here's where Hermes becomes super helpful, which is through cron jobs or automated jobs. So rather than asking, you know, the Hermes agent every single day for a morning briefing, what we can do is set up cron jobs, which are basically scheduled tasks that run. So for our first example, if we just wanted this morning briefing every single day, we can say set up a cron job. Um, again, we don't have to do any complex, you know, prompting, literally just type to it as if it's your employee. And then it's going to go ahead and set this up, look through its skills, and make sure that you get this message in your inbox or through your messages every single day. And great, now we have daily morning equity briefings every single day. So again, this is going to be sent to you directly to Telegram.

And then because there's persistent memory, you can ask about any message you've ever sent it. So if we're curious about, you know, insider reads on specific positions that we hold, we can literally type how is the insider activity in Nokia for the past 5 days. And then it's going to go ahead search the web, go through all the filings, look through documents, and then give you back all this information neatly. So here we have all the insider activity as of the past 5 days. So it actually went through, you know, the foreign filings on the internet, documents as well. So we have the strict past five calendar day information. Uh, so it seems like we have some insider transactions from a senior manager on May 26th. If we scroll down, we also have a second filing, another senior manager. So we're able to see basically, you know, all the information we could ever want in terms of research on specific holdings that we have.

And then now, just to give you some more examples, if you wanted actual trade ideas, uh, you would obviously feed it your trading strategies and styles that you prefer. Assuming that it does know all this context about you, you can simply just ask, you know, super simple questions like scan for new long opportunities based on today's data. So after scanning the universe, it basically gave us a list of picks based on, you know, our specific strategies and what we like. So first, we have the macro data to make sure that the macro market does align with our thesis before we even start. And then we have specific picks like Palto Networks. We have, you know, insider transactions, momentum, IV rank, and then it is giving us IV figures because it knows that we trade options on this account. So we have things like bull cases, bear cases, any upcoming catalysts. And then if you scroll down again, DataDog, uh, we have Dell as well. And then as kind of like a cherry on top, we have the most attractive for a new long and things to avoid chasing just because Dell is a bit overextended after, you know, last Friday's price action.

If we want to go a bit deeper, we can say that we like the DataDog setup and to run pre-trade checks and execute if it passes. And then now what we have is the pre-trade checks. Obviously today's Sunday, so we don't have live market data. It's taking the information from last Friday, but we have the current price, the day moves, VIX, and then also the momentum, making sure that this passes. Again, this is all based on context that we've provided before. We have insider activity, you know, any upcoming catalysts. And then we also have a suggested trade ticket as well. So, based on our 200k portfolio, we have the starter size, shares, approximate, and then if we wanted to, we can also add stop-losses, entry, exit points, everything that you would potentially want or need.

So, as you can see, Hermes is super powerful. Uh, sky is basically the limit as to how you want to use it. You can have it just essentially help you research, you know, automate morning briefings for you. So, that's more of a passive role, I would say, or you can go all the way and just have Hermes basically act as your actual trade analyst, assuming that you give it all your parameters, uh, your risk tolerance, things of that sort. So, this way, it's going to be able to work with you, and you don't have to go through the headaches of building out an extremely robust system in an IDE that you would with Claude code.

Now, before I show you how to set up Hermes Agent yourself, if you want to learn how to build complex trading systems with AI agents like Hermes, Claude Code, or any other new AI tool, make sure to click the link in the description for my school community. It's currently the largest AI-focused trading community with full in-depth guides and hundreds of members in there right now building AI trading systems across stocks, crypto, options, and any other asset class. And if you already have an idea of what specific trading systems you want built, I offer one-to-one custom consulting work on my website in the description at aipathways.io.

So now that you know how Hermes works inside a trading context, let me now go over the two main components to actually get the setup. Now to start, we have features of Hermes, which itself is the free open-source AI agent framework built by News Research. The main things that make it super useful for us for trading is persistent memory. It's going to remember everything that you guys discuss over days, weeks, and months. Apart from persistent memory, it also has the built-in scheduler. So, this is where it can actually, you know, automate for you. Um, as long as you tell it that you want certain things to be sent or done every single day or every single hour, it's able to set up those cron jobs. And then finally, there's the self-learning loop where it actually builds new skills based on all the things you have it to do and it improves over time. This is where Hermes really shines since it's able to self-learn, understand what you like, and become better essentially over time.

Now, to add the AI connection to Hermes, you can use one of three options. So, you first have the ChatGPT Codex subscription. So, this is just a regular ChatGPT subscription, which is about give or take $20 a month to get a lot of usage out of Hermes without paying per message. Now, if you don't have a ChatGPT account or you don't want to use it, you can also use Claude, which is going to be a tiny bit more powerful. And if you have any other preferences, you can use OpenRouter or any other LLM directly via API as well.

Now, once you get the AI connection, which is basically the intelligence, all set up, you would then have the messaging platform. So, this is where you can connect to Telegram, Discord, Slack, basically any messaging platform. So, this way you can interact with it on your phone, from your computer, basically anywhere. And this is going to be the main communication method and how you conversate with your Hermes agent and how it talks back to you.

Now, let's go over how to actually run Hermes since these are all pretty straightforward. But when you want to run Hermes, you have basically two main options. The first is a local computer and the second is a VPS. But I would highly recommend using a VPS here since you won't need a dedicated Mac open running 24/7 like you see people do with Mac Minis. It it gets pretty expensive if you want to buy your own computer just to run Hermes. But with a VPS, it can run, you know, regardless of what your computer is doing. You don't need a second one. And this is especially important for trading as you'll have the AI agent run scheduled pipeline fires, you know, every evening. Um, you have alerts fired during market hours. The agent is always available on Telegram. So nothing really depends on your laptop being open. And then whether you use your local computer or VPS like Hostinger, you'll have, you know, data privacy. So all your API keys, your broker credentials, portfolio data.

And just as a final tidbit, you can actually run multiple agents at once. So if you want, you can set up like, you know, five Hermes agents and they all do something different. In my example, I just had one main agent, but I find that Hermes works best if you have the means to separate out your specific tasks. So like you can have a trader Hermes agent, a researcher Hermes agent. Another one can be just like a morning brief agent. So if you have all these separated chats with all these different Hermes agents, they can all excel at that one very specific task that they're assigned to. So theoretically, you can have like five employees working for you that are all doing different trading contexts for you.

Now, let's go over how to actually set up Hermes Agent. The best way to do this and the easiest is to use Hostinger, 'cause they do have a one-click deploy which makes it super simple to set up. So what you'd want to do is go to the link in the description for hostinger.com/aipathways to get directed straight to this page where you can deploy Hermes agent in one click. Then what you'll need to do is choose a plan. So if you scroll down, you can see we have KVM 1, 2, 4, and 8. Now I would probably recommend KVM2 depending on, you know, your own usage. These have different RAMs, CPU cores, and bandwidth. But I found that KVM2 works perfectly even if you are running, you know, say a few Hermes agents all doing different things. Uh, this should have the bandwidth to support pretty much any task that you would need. So, go ahead and click choose plan. And then on this page here, what you would first need to do is choose the period. So, this is how long you want to use your VPS. So, there's 1 month, 12 month, and 24 months. Now, 12 and 24 months do have the best value. So, I'd probably recommend one of those two. This way, you'll have your VPS server running pretty much for the whole year, especially if you know that you're going to be using this Hermes agent, pretty regularly. And the other benefit to using a 12 or 24-month plan is that I have a coupon code for 10% off. So, if you just go ahead and type in AIPATHWAYS and click apply, you'll basically have 10% off for your Hostinger VPS and have it running for basically the whole year. Next, what you'll need to do is just go ahead and click continue and then create an account and register all your information.

Next, after going through the setup, it's going to automatically take you to the Hermes agent configuration where it's going to create the template for you. So, it's going to give you the admin username, which is always the same, Hermes. But make sure to save this password here as this is how you actually log in to your Hermes terminal. So, you can click show and then copy and paste this somewhere inside your computer. Then after that, just go ahead and click deploy and it's going to set up everything for you. So, first it's going to set up your VPS, which is going to take around 5 minutes, and then automatically set up Hermes as well. Next, it's just going to ask you some questions about your VPS needs. If it's your first time managing a VPS, if you're experienced, I would probably skip this step. But if you do want to know more about managing a VPS, what you can use Hostinger for apart from Hermes, like you can also use it to host, you know, Naden, web apps, things of that sort, then you can go ahead and click into this. But I'll go ahead and skip all of this since we're here for Hermes. And then again, because you use the hostinger.com/aipathways link, it's going to automatically create this Hermes project for you. You don't need to do anything. All you need to do is sit back and wait for your project to be deployed.

Now, after 10 minutes or so, you should see this Hermes agent running, which means you can now open it, log in, and basically configure and set up your Hermes agent yourself. But if you don't see this Hermes agent automatically set up for you, you can also find it in the catalog. So, go ahead and click catalog, find the Hermes template, select this, and then now you can click deploy with the new password. And this is also helpful if for some reason you forgot your password to log in to the first one you made. But again, if you use my link, then this should automatically all set up for you. This is where you would find it though if you ever need to create a second Hermes agent or you lost your password or you never had it to begin with.

So, heading back here, what you need to do now is go ahead and open the Hermes agent. So, this way you can start configuring it. Now, for the username, just type in Hermes. And then for the password, again, this is the one that you copy and pasted from when we initially set up Hostinger. So, now go ahead and click sign in and you should be taken to the terminal. Just give it a second. And then now you can do either a quick setup or full setup to configure everything. Now because we're using our Hermes for trading, uh, you don't need to do full setup for almost everything unless you want to go deep into the weeds. So go ahead and click quick setup. Type enter. Then it's going to ask you which AI provider you want to connect to. Now like I mentioned earlier, I would recommend OpenAI Codex just because you can use your monthly subscription. It's not API-based. So as long as you know it fits within your plan, then you don't need to pay anything on top. So here I'm just going to go ahead click enter on OpenAI Codex and then what you need to do is open this URL inside your browser. Then after you paste this code here, it should say login successful and then this is where you can select your default model. Now this is the model that is basically going to be connected to your Hermes agent. So if you want to use GPT 4.5, which is the most powerful, you can select that. Just know that you're going to hit usage limits a bit quicker if you use 4.5 versus something like 4.0. But I'm just going to do 4.5 for the latest and greatest. Then for the terminal backend, we're just going to keep this the exact same. So keep current, local. Then it's going to ask you to set up messaging. So this is where you're going to configure either Telegram, Discord, iMessage, or anything else. So go ahead and click set up. And then for the platforms to configure, you can see all the different ways that you can basically connect to Hermes agent, but I'm just going to use Telegram here and show you guys how to set that up. So click space on Telegram, then click enter. Then we can see here that we need to create a bot via BotFather on Telegram. So, this is super simple. What you need to do is go to Telegram. Then on Telegram, what you want to do is search up BotFather. Once you're on the BotFather chat, click /newbot. Then it's going to ask you for a name. So you can call this like Hermes. And then for the username of the bot, I'll do the exact same thing. And then now we have our Hermes bot basically created. Then all we need to do is copy the token. So go ahead and click this to copy. And then heading back here, what you need to do is paste it. Click enter. And then now all it needs is your user ID as well. So it tells you right here how to get your user ID. You just message userinfobot on Telegram and then it'll give you your user information. So go ahead and copy this. And then on Telegram, we're just inside this getinfobot. So if you just click /start. So next, all you want to do is paste in your ID. Click enter. Then it'll ask you if you want to set this as your home channel. Simply click yes. And now you're pretty much ready to go.

So if you ever want to see all the documentation capabilities of Hermes, just go ahead and reconnect to the server and you'll be able to see all the information ranging from available tools, available skills. If you want to get any additional information on VCPs, how to connect to GitHub, how to use computer use, it's basically all right here. You would just simply type in the command to get more information. But now what we care about obviously is setting up the Telegram messaging and being able to essentially connect with Hermes back and forth. So here we can type directly to the Hermes agent. I'm just telling it to set up Telegram messaging and ensure the connection works. So we can wait for it to initialize the agent and basically connect what we have here to Telegram. So just like Claude code, it's going to go through your skills, make a plan for you, and then perform this action. So now we can see that Telegram messaging is set up and verified. So theoretically, we don't need to chat with Hermes here inside the terminal anymore. We can just simply go straight to Telegram and talk to it.

So let's open up Telegram. And here we can see the Hermes connection test works. Have the bear home test. Everything looks like it's up and running. And then one way that we'll know this is actually working is just simply type in, "Hi Hermes." We can see that it's typing now. So this way it's going to be able to communicate back and forth with us.

Now, if you're setting this up for the first time, I would recommend that you now start feeding it, you know, all the context around you as a person, how you like to trade, what you're currently trading, what your positions are, connecting any external accounts that you want to. So, this way, Hermes at least has all this background context before you set up any cron jobs. So, here's a very simple example. I'm just typing in that I'm a swing trader that also likes to use the wheel strategy for options. Um, typically like to trade when VIX is below 20 and then my current positions are these separate tickers. Then we want Hermes to basically act as a personal trading assistant that gives ideas, entries, market briefs, intelligent thesis, and then we want to make sure that all market data is always updated when providing outputs. But obviously, if you're working with Hermes, it needs to be a lot more detailed, right? You can even give all your past trades, things of that sort. This way, it'll know exactly what you want and how to work with it, which is way better than having a blank slate. But I'm just going to go ahead and type this in just so it has at least some context around how we're going to be using this bot.

So here we can see this is where the persistent memory comes in. It's going to remember everything we ever tell it. Then this is where you're going to be able to build on top of it. You know, add any scheduled actions like cron jobs if you want to get reports, trade ideas, signals every single day, things of that sort. Basically, the sky's the limit as to how you want to use this Hermes agent to basically help you in your own trading endeavors.

Now, if you found this video helpful, make sure to like, comment, and subscribe as it greatly helps out the channel. I cover everything regarding AI trading and how you can best use AI in your own portfolios, trading styles, and strategies. And like I mentioned in the beginning of the video, if you do want to join the largest AI trading community, make sure to click the link in the description. We have full in-depth guides, templates, and systems for all of our members to use, as well as weekly calls just to make sure that everyone has the latest and greatest information around using AI and how it can genuinely help you become a better trader.