ArticlesBy Paweł Dobrzyński13 October 202612 min

Build a 24/7 AI agent from scratch with Hermes Agent

A chat window forgets you the moment you close it; an agent does not. The whole setup start to finish, no code and about an hour: the machine, the install, your own Telegram bot, and the fiddly ten minutes that give it your calendar, your mail and your Drive.

A chat window forgets you the moment you close it. An agent does not. It sits on a machine that never sleeps, it knows your calendar and your inbox, and it writes to you first thing in the morning.

This is the whole setup, start to finish, the way I did it. No code, about an hour of your time, and most of the pieces are free. At the end you will have an assistant you text or talk to, that can look at your schedule, read your mail, pull a file from your Drive, and remember what you told it last week.

What you need before you start

Three things, and you can get all of them in the next ten minutes.

A machine that stays on. A small server costs about €16 a month and takes five minutes to rent. A spare laptop or a Mac Mini on your desk works just as well and costs nothing, as long as you leave it running.

An account with an AI provider, so the agent has something to think with. Any of the big ones works.

A Telegram account, which is how you will talk to it. You almost certainly have one already.

That is it. You do not need to know how to program.

1. Rent the machine

If you are using your own spare computer, skip ahead.

Any provider will do. I picked a small server with four processors and 8 GB of memory, on monthly billing with no contract. Watch out for the cheap offers: the low price usually means paying for a quarter or a whole year up front, and you want to be able to walk away after a month if this is not for you.

Two things matter more than the price. Pick Ubuntu 24.04 as the operating system, because that is what everything below assumes. And prefer a provider that includes daily backups, because everything your agent learns will live on this machine.

When the server is ready you get an address and a way to log in. Keep both.

2. Install the agent

Log in to the machine. On a rented server that means opening a terminal and connecting with the address and user they gave you. On your own spare computer, just open a terminal.

Then paste one line:

curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash

It brings everything it needs with it, so there is nothing to install beforehand. Give it two minutes. Then check it answers:

hermes --version

If the command is not found, close the terminal and open it again; the installer adds itself to your path and that only takes effect in a new session.

One setting people miss, and it will bite you. By default, anything you start on a server stops when you log out, so your assistant would die the moment you close the window. One command fixes it for good:

loginctl enable-linger $USER

Run it now and forget about it.

3. Give it a brain

The agent needs an AI model to think with, which means a key from a provider.

  1. Open your provider's console and create an API key. Make a fresh one just for this agent rather than reusing a key you already have elsewhere.
  2. Set a spending cap on that key while you are there. This is your safety net, and it takes ten seconds.
  3. Put the key into the agent's settings file on the server, the same place the Telegram token will go.
  4. Tell the agent which model to use. A mid-range model is the sensible default; you can raise it later for harder work.

Two things I learned the hard way.

Never paste a key into a chat window, not even to ask for help with it. I did that early on and had to replace the key the same day. A key you have pasted anywhere outside your own machine is a key you have lost.

The friendly setup wizard needs you to be sitting at the machine. Over a remote connection it refuses to start, which is confusing the first time. When that happens, set the values from the command line one at a time instead. Less pretty, works everywhere.

4. Create your Telegram bot

This is how you reach your assistant from your phone. Telegram hands out bots for free and the whole thing takes three minutes.

  1. Open Telegram and search for @BotFather. It is Telegram's own bot for making other bots, and it has a blue verified tick. Open the chat and press Start.
  2. Send /newbot.
  3. It asks for a display name. This is the name you will see at the top of the chat. Anything readable: Hermes.
  4. It asks for a username. This one must be unique across all of Telegram and must end in the word bot, for example pawel_hermes_bot. If it is taken, BotFather says so and you try another.
  5. It replies with a token, a long string that looks like 8123456789:AAH.... That token is the password to your bot. Anyone holding it can read and send its messages, so never put it in a screenshot, a document or a chat window.
  6. Paste that token into the agent's settings on the server, in the file where it keeps its keys.

Now the step that protects you, and the single most important setting in this guide.

Your bot is public. Anyone who guesses or finds that username can write to it, and in a few minutes it will have access to your calendar and your mail. So you tell it that only you are allowed in.

  1. In Telegram, write to @userinfobot and send it anything at all. It replies with your numeric user ID, a number like 8880730423. That number is you.
  2. Put that number in the agent's allowed-users setting. Do this before you start the bot for the first time.

Then start it and check it works.

  1. Start the agent as a background service so it runs whether or not you are logged in.
  2. Open the chat with your bot. BotFather gives you a t.me link for it. Press Start and write "hello". You should get an answer within a few seconds.
  3. In that same chat, tell it this is home, so morning messages, reminders and alerts land in a conversation you actually read rather than somewhere you never look.

If it does not answer, the usual causes are the token pasted with a stray space, or the service not actually running.

5. Turn on the safety rails before it touches anything personal

You are about to give this thing your inbox. Spend two minutes on this first.

Set it so that dangerous commands wait for your approval, so that changes to its memory wait for your approval, and so that anything it writes for itself waits for your approval. You will relax these later, once you trust it. For the first week, let it ask.

Then write it a short description of who you are and how it should behave. Mine is a few paragraphs in plain Polish: speak Polish, be brief, be an operator rather than a cheerleader, ask one question at a time, never message anyone but me, never write passwords or financial details into your notes, do not touch this other application on the same machine.

This matters more than any setting. Boundaries written as plain sentences are followed well. Boundaries you merely assumed are not.

6. Give it your calendar, mail and Drive

This is the step that turns a chatbot into an assistant, and it is the fiddliest part of the guide. Budget ten minutes and do it once.

Google will not simply hand your mail to a program. You create a small project in Google's own console, say which services it may touch, and approve it with your own account.

First decide what it actually needs. If you only want it to read and send email, there is a much shorter route that uses a Gmail app password and takes two minutes. Everything below is for calendar, Drive, documents and spreadsheets.

  1. Go to the Google Cloud console and create a project. Any name will do. If you already have one, use it.
  2. Open the API library and switch on the services you want: Gmail, Calendar, Drive, Sheets, Docs, and People if it should know your contacts. Enabling a service is free; you are only declaring what the project may use.
  3. Go to Credentials, choose Create credentials, then OAuth client ID. For application type pick Desktop app. Confirm.
  4. Download the JSON file it offers you and copy it onto the server. It is small and it identifies your project, not your account.
  5. Go to the Audience settings and add your own Google address under test users. While a project is new, Google treats it as unpublished and refuses everyone who is not on that list. Skip this and the next step fails with a permission error that explains nothing.
  6. Ask the agent to run its Google setup, pointing it at the file you copied. Tell it which services you want, so the consent screen asks for those and nothing more.
  7. It gives you a link. Open it in your browser, choose your Google account, and tick the permissions.
  8. The browser will then land on a page that cannot be reached. That is expected and is not a failure. Copy the entire address out of the address bar, including everything after the question mark, and paste it back to the agent. The approval code is inside that address.

Done. Ask it what is on your calendar tomorrow, or what in your inbox needs you today. It will tell you.

Ask only for the services you will actually use. The consent screen then requests less, which is both safer and far less alarming to click through.

7. Teach it, and let it remember

Your agent keeps two sets of notes: what it has learned about its environment, and what it knows about you. Both survive restarts.

In practice you just talk to it. Tell it your goals, your working hours, how you like to be spoken to. With approvals on, it proposes a note and you accept it. After a week it stops needing to ask the same questions.

Mine knows my timezone, that I answer in Polish, that I want one question at a time rather than a list, and what I am trying to finish this quarter. The morning message is useful because of that, not because of the model.

8. Back it up, because this is now worth something

Everything the agent knows sits in one folder as ordinary files. A nightly job that zips that folder and keeps the last fourteen days is enough, and the whole thing is about two megabytes.

Once a week, copy the newest archive to your own computer. A backup that lives only on the machine it is backing up is not a backup.

9. Let it speak, and listen

This part surprised me by being free in both directions.

Speech recognition runs on the server itself, so your voice messages never leave the machine. Speech comes back through Microsoft's free voices, and Telegram plays it as a normal voice message. No per-minute billing anywhere.

Two settings to check. The language starts out as English, so set it to yours or your words come back as gibberish. And the voice feature needs one extra component installed, plus a restart afterwards, or the agent will politely tell you transcription is unavailable while everything looks correctly configured.

By default it replies the way you wrote: speak to it and it speaks back, type and it types. That is the behaviour you want.

10. Optional: let it supervise your coding work

If you write software, you can install a coding agent on the same machine and let your assistant run it for you.

The arrangement that works is three separate sessions with separate jobs. One investigates and is allowed only to read. One makes the change. One reviews the result and must be a different session from the one that wrote the code, because a session that just wrote something will approve it.

Two warnings. A coding agent working unattended never asks questions, it guesses, so instruct it to stop and list what it does not know. And never accept its report as the outcome: have your assistant rerun the tests and look at the diff itself. Mine caught a claimed fix that had not been made.

What it costs

The server is about €16 a month and you can cancel any time. Voice is free. Google is free.

The model is the only real variable. A conversational exchange costs a few cents on a top model and noticeably less on a mid-range one. For a morning check-in, an evening question and some back and forth, a light month is a few pounds. Set a spending cap on the key and check it after the first week.

One claim worth correcting, because I measured it: keeping a long session open does not save you money compared with starting fresh each time. The cost follows the length of the conversation, not the way you launched it.

The traps, in one list

  • The setup wizard needs you at the machine; configure from the command line when working remotely.
  • Without the one command in step 2, your assistant dies when you log out.
  • Without an allowlist, your bot will talk to strangers.
  • Replace any key you have pasted into a chat.
  • Add yourself as a Google test user, or the approval fails with an unhelpful error.
  • The browser failing after Google approval is expected; copy the whole address anyway.
  • Set the voice language, or your speech is transcribed as English.
  • After adding a component, restart the agent or it will not see it.
  • A restart also applies every setting you changed and left sitting. Mine quietly switched to a more expensive model that way.
  • Verify work yourself. An agent reporting success is not evidence of success.

What it does for me now

It writes in the morning with what is on my calendar and what in my inbox actually needs me. It asks in the evening how the day went. When I describe something while walking, it understands the voice note, looks up what we decided last week, and answers in two sentences.

None of this is clever. It is reliable, which is better, and every warning above is in here because something broke first.