Deploy guide
Run your own Odysseus
From nothing to a bot that answers you in Telegram, first on your own computer and then on a small server that stays awake. These steps were followed for real, and where something went wrong, the page says so. They were run on Windows; the macOS and Linux forms shown beside them are the standard equivalents.
What you will need
Three accounts are required. Five more are optional, and each one switches on a capability. You can start with the three and add the rest later by adding a line to one file.
| Setting | Where it comes from | What it is for | |
|---|---|---|---|
TELEGRAM_BOT_TOKEN | In Telegram, message @BotFather and send /newbot | The bot you will talk to | Required |
OWNER_TELEGRAM_ID | Your own numeric Telegram ID; @userinfobot will tell you | The one account the bot answers. Everyone else is ignored. | Required |
ANTHROPIC_API_KEY | The Claude Console | The model that does the thinking | Required |
EXA_API_KEY | exa.ai | Web search | Required |
COMPOSIO_API_KEY | The Composio dashboard | Mail, calendar, and any other app you connect from the chat | Optional |
BROWSER_USE_API_KEY | Browser Use Cloud | The browser | Optional |
MISTRAL_API_KEY | The Mistral console | Reading photos and PDFs you send | Optional |
LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY | A Langfuse project, with LANGFUSE_BASE_URL set to its region | A readable record of every task. Keys are removed, and mail text is replaced by its length. | Optional |
You also need Python 3.13 (the version it is tested on) and, for the server step, a card on a hosting account.
What it costs to run. The model and the other services bill you directly, by use. In single measurements made here a question with one web search cost about 1.5 cents and a browser run about 4 cents. The program enforces a limit per task (50 cents by default) and per day (3 dollars by default), and you can change both. A small server is a few dollars a month on top.
Get the code and install it
git clone https://github.com/odysseyvc/odysseus.git odysseus
cd odysseusThe code is at https://github.com/odysseyvc/odysseus.
python3.13 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtpy -3.13 -m venv .venv
.venv\Scripts\Activate.ps1
pip install -r requirements.txtFill in your keys
Copy the example settings file and put your values after each =.
cp .env.example .envCopy-Item .env.example .envThe file .env is ignored by git, is never put into the server image, and is never shown to the model. Fill in the four required lines. Leave the optional ones commented out until you want them.
Use your own numeric ID, exactly. OWNER_TELEGRAM_ID is the only thing that decides who the bot obeys. A message from any other account gets no reply at all and costs you nothing.
Start it and say hello
python -m odysseusOpen Telegram, find your bot by the username you gave BotFather, and send it a message. It should answer within a few seconds. Then try these:
| Send | What it does |
|---|---|
stop | Ends whatever it is doing. Handled by the program, never shown to the model. |
/status | Whether it is busy, and what it has spent today |
/memory and /forget a1b2 | See what it remembers about you, and remove an entry |
/schedule and /cancel a1b2 | See reminders and routines, and cancel one |
/apps | Whether mail and calendar are connected, with a link for any that is not |
/browser and /browser done | Open its browser yourself to sign in to sites; then save the sign-ins |
To connect mail and calendar, add COMPOSIO_API_KEY, restart, and send /apps. To connect any other app, just ask for work in it: the reply will carry a link.
Run only one copy. Telegram hands each message to one program. If two copies run with the same bot token, on your laptop and a server for instance, they take messages from each other. Stop one before starting the other.
Give it a server
On a laptop, reminders only fire while the laptop is awake. A small always-on server fixes that. These steps use Fly.io, which is what this project used; any host that can run a container with a persistent disk will do.
Add a payment card first. Skipping it cost two failed deployments. On a new Fly.io account with no card, every machine was stopped five minutes after it started. Nothing in the deploy output said so. The bot started, answered for five minutes and went silent. The only trace was one line in the machine's log: "Trial machine stopping". The host's published terms for accounts without a card have changed since; the advice has not.
What the server costs. One always-on shared machine with 1 GB of memory in Singapore is listed at about $8.50 a month, the 1 GB disk at 15 cents, and the shared address at nothing. Prices differ by region and change; read the host's own list.
Create the app and its disk
Install the fly command from Fly.io, then:
fly auth login
fly apps create your-app-name
fly volumes create odysseus_data --app your-app-name --region sin --size 1Open fly.toml and change four things: app to the name you just chose, primary_region to a region near you (fly platform regions lists them), ODYSSEUS_TZ to your own time zone, for example Europe/London, and ODYSSEUS_PUBLIC_URL to https://your-app-name.fly.dev.
Then give the app its public addresses. An app made with fly apps create has none, and the deployment will look healthy from the host's side while its address does not exist for anyone else:
fly ips allocate-v4 --shared --app your-app-name
fly ips allocate-v6 --app your-app-nameDo not skip the time zone. A server's clock is UTC. Without ODYSSEUS_TZ, "remind me at 7am" fires at 7am UTC, and nothing reports an error.
Send your keys as secrets
Every filled-in line of .env except the data folder, which on the server is set by fly.toml. A path from your own computer sent along with the rest would override it.
grep -E '^[A-Z_0-9]+=.+' .env | grep -v '^ODYSSEUS_DATA_DIR=' | fly secrets import --app your-app-name --stageGet-Content .env | Where-Object { $_ -match '^[A-Z_0-9]+=.+' -and $_ -notmatch '^ODYSSEUS_DATA_DIR=' } | fly secrets import --app your-app-name --stageDeploy
Stop the copy on your laptop first. Then:
fly deploy --ha=false--ha=false matters: it asks for one machine. Two machines would be two copies of the bot.
Check that it stayed up
fly status
fly logsYou should see a line reading odysseus start, then one line per step as you use it: statuses and numbers, never the contents of your messages. Message the bot. Then check again after ten minutes. The first deployment was reported as working thirty seconds after launch, and it was switched off four and a half minutes later.
The host asks the program's /health address every thirty seconds and shows the answer under CHECKS in fly status. That check runs inside the host's network. Ask from outside as well:
curl -i https://your-app-name.fly.dev/healthIt should answer 200 and ok. Every other address answers 404, apart from the sign-in page and WhatsApp's.
Memory. Measured on this machine size: about 770 MB with one person's agents connected, of 1 GB. fly.toml switches on swap, which costs nothing and keeps the program alive when memory runs short. Before you invite anyone, change memory to "2gb".
If your copy is already in use: moving its data
A copy that has been running on your computer has a conversation, memory, a schedule and sign-ins in its data folder. To take them along, the server must be built without the bot starting, because a started bot polls Telegram and yours is still running. These are the steps that were run.
- Add two lines above
[env]infly.toml, andprocesses = ["app"]under[http_service], so that the machine sleeps:Take the[processes] app = "sleep infinity"[[http_service.checks]]section out for now, deploy, and start the machine:fly deploy --ha=false, thenfly machine startwith the id thatfly statusshows. - Wait until your bot is doing nothing, then stop it, and make sure it has stopped.
- Pack the data folder and send it. Leave out the token of any service that runs on your own computer; a server cannot reach it.
tar -czf data.tgz -C /path/to/the/folder/above your-data-folder fly ssh sftp put data.tgz /tmp/data.tgz - Unpack it on the server, and rename the folder the conversation is filed under. The agent library names that folder after the directory the program was started in, which on the server is
/app:fly ssh console tar -xzf /tmp/data.tgz -C /data --strip-components=1 find /data -type d -path '*/agent/projects/*' -prune # shows the folder; rename each one to -app with mv chown -R app:app /data - Take the three lines out of
fly.tomlagain, put the checks back, and runfly deploy --ha=false.
Do not start the old copy again. Its folder still holds the sign-in renewals as they were when you moved. Each is good for one use; the old copy would spend them, and the server's sign-ins would stop at their next renewal. Keep the folder as a backup and leave it alone.
Optional: WhatsApp as a second channel
Read Meta's terms first. Section 4.7 of the Meta Terms for WhatsApp Business Platform bars general-purpose AI assistants from the platform where the assistant is the primary thing being offered, as Meta alone determines, directly or through a provider. Some countries have exceptions. Whether an assistant that answers only the person who runs it is covered is not settled by the text, and Meta may suspend access at once. Do not let anything depend on this channel, and do not pay for a number until you have decided what that risk is worth.
Telegram needs nothing to reach your server. WhatsApp does: Meta calls an address you own each time a message arrives. Chapter 16 of the book explains what that changes. These steps have been run: a message from the owner's phone was received on the server and answered. A button tap, a file and a voice note have not been tried.
- At developers.facebook.com, create an app and add the WhatsApp product. It gives you a test number, a phone number id, a messaging account id, and under the app's basic settings an app secret. In the business settings, add a system user, assign it the app and the WhatsApp account, and generate a token for it with the two WhatsApp permissions (
whatsapp_business_messagingandwhatsapp_business_management). Meta may ask you to accept a policy and to confirm your account by an emailed code on the way. The token the set-up page shows lasts a couple of hours: a bot left with that one sends nothing by the next day and does not say so. - Add your own WhatsApp number as an allowed recipient of the test number.
- Set
WHATSAPP_TOKEN,WHATSAPP_PHONE_ID,WHATSAPP_APP_SECRET,OWNER_WHATSAPP(your number with country code) andWHATSAPP_VERIFY_TOKEN(any phrase you choose) as secrets. - The
[http_service]section at the end offly.tomlopens the port; it is already on if you kept it for sign-ins. Deploy. - In the Meta app, register the webhook address
https://your-app-name.fly.dev/whatsappwith the same phrase, and subscribe tomessages. Meta calls the address at once and accepts it only if the phrase comes back. - Subscribe the WhatsApp account to your app. Without this the address shows as active and no message is ever forwarded. Use the messaging account id from the app's own WhatsApp page, not the number the business settings show for the account:
The same address with GET lists the apps the account is subscribed to; yours should be among them.
curl -X POST -H "Authorization: Bearer $WHATSAPP_TOKEN" https://graph.facebook.com/v27.0/YOUR_MESSAGING_ACCOUNT_ID/subscribed_apps - Send the test number a message from your own WhatsApp. If nothing answers, read the journal: a delivery that arrived and was refused leaves a line, and one that never arrived leaves none.
WhatsApp's 24-hour rule. The bot can write to you freely only for 24 hours after you last wrote to it. A reminder that falls outside that window is refused by WhatsApp. Reminders and routines are therefore sent on Telegram unless you set ODYSSEUS_NOTIFY_ON=whatsapp.
Optional: the group's assistant in a WhatsApp group
This needs the direct WhatsApp route above, and it needs Meta to have given the number Official Business Account status: a verified business, thirty days on the platform, two-step verification, an approved display name, and Meta's agreement. Without that standing Meta refuses every call (error 131215) and these steps do nothing. They are written from Meta's documentation and have not been run.
- Put the number's id in
.envasWHATSAPP_GROUP_PHONE_ID. It may be the direct route's own number or another number of yours. If it is on another WhatsApp account, runpython scripts/whatsapp_group.py subscribe ACCOUNT_IDso that Meta delivers that account to your app. - Where you registered the
/whatsappaddress, add the four group fields to the app's subscription:group_lifecycle_update,group_participants_update,group_settings_update,group_status_update. - For each colleague who should be heard, write their WhatsApp number against their id on this copy:
WHATSAPP_GROUP_MEMBERS=919800000000=123456789, separated by commas. You need no entry. Restart. - Run
python scripts/whatsapp_group.py create "Deal room". Meta reports the new group to the running program, which sends you its invite link on Telegram. Up to eight people can join. - Join the group yourself and send
/firm onin it. From then on a message that begins with the assistant's name (ODYSSEUS_GROUP_NAME, "odysseus" unless you change it) is answered in the group.
The assistant cannot be added to a group you already have, there is one group assistant across Telegram and WhatsApp, and an approval question in the group is answered by typing YES or NO. ODYSSEUS_WHATSAPP_GROUP=off switches it off.
Optional: iMessage as a third channel
iMessage is bought from Linq (linqapp.com), which runs the lines. It uses the same door, at /linq. These steps are written from Linq's documentation and have not been run.
- Create a Linq account. It gives you an API token and a Linq number. On the free line you can write only to a number that has written to yours first, so send your Linq number a message from your own phone.
- Put
LINQ_API_TOKEN,LINQ_NUMBERandOWNER_IMESSAGE(your own number with country code) in.env. - Run
python scripts/connect_linq.py. It registershttps://your-app-name.fly.dev/linqwith Linq and writes the signing secret, which Linq shows once, into.envasLINQ_WEBHOOK_SECRET. - Send those four lines to the server as secrets, and deploy.
To switch the channel off and keep its settings, set ODYSSEUS_IMESSAGE=off; remove that line, or set it to on, to switch it back. The channel only answers: reminders and routines stay on Telegram. A question that needs your approval arrives as a poll with Approve and Decline; if the poll cannot be made, you are asked to reply YES or NO.
Optional: WhatsApp on a number rented from Vobiz
In place of, or beside, the direct route above: Vobiz (vobiz.ai) rents the number and passes messages between Meta and this program. Your WhatsApp account at Meta is still your own. Vobiz keeps a copy of every message on this route. These steps have been run once, for one text each way.
- Create a Vobiz account, complete its identity check, and add money. In its console, rent a WhatsApp-capable number and make a WhatsApp channel for it on your own WhatsApp account (choose "Connect with Provider", which signs you in to Meta in a window of its own). Leave the Vobiz page exactly where it is until that window closes: the window reports back to that page, and if the page has moved the channel is not made and you must run the sign-up again. Meta's code for the number comes by a phone call, since a rented number receives no text messages. To hear it, first make a voice application in Vobiz with the answer address
https://audio.vobiz.ai/record-inbound.xmland the method GET, attach the number to it, and play the recording in a second tab. Detach the number afterwards, or every call to it is recorded. - Put
VOBIZ_AUTH_ID,VOBIZ_AUTH_TOKEN,VOBIZ_CHANNEL_ID,VOBIZ_NUMBERandOWNER_WHATSAPPin.env. - Run
python scripts/connect_vobiz.py. It registershttps://your-app-name.fly.dev/vobizwith Vobiz under a secret it makes, and writes that secret into.envasVOBIZ_WEBHOOK_SECRET. - Send those lines to the server as secrets, and deploy. Then message the number from your own WhatsApp.
ODYSSEUS_VOBIZ=off switches the route off and keeps its settings. Vobiz cannot send Approve and Decline buttons, so a question that needs your approval ends with "Reply YES to approve or NO to decline", and only that exact one-word reply, within ten minutes, answers it.
Updating later
Pull the new code and run fly deploy --ha=false again. Your memory, schedule and log live on the disk and are not touched by an update. The bot is away for under a minute; a task it was in the middle of is announced when it returns, not carried on.
Going back
To go back to the code as it was, list the earlier images and deploy one:
fly releases --image
fly deploy --ha=false --image registry.fly.io/your-app-name:deployment-XXXXThe host keeps earlier images for a while and does not promise to. The data does not go back with the code. The host photographs the disk once a day (fly volumes snapshots list with the volume's id), and restoring one means creating a new volume from it. The disk is on one physical machine and nothing else copies it; that is not yet built. Neither of these two steps has been run here.
Settings worth knowing
All optional. Put them in .env locally, or set them with fly secrets set on a server.
| Setting | Default | What it changes |
|---|---|---|
ODYSSEUS_TASK_USD | 0.50 | The most one task may spend before it is ended |
ODYSSEUS_DAILY_USD | 3.00 | The most one day may spend. After that, new tasks are refused until tomorrow. |
ODYSSEUS_MAX_TURNS | 25 | The most steps one task may take |
ODYSSEUS_MODEL | claude-sonnet-5-5 | The model for conversations |
ODYSSEUS_BACKGROUND_MODEL | claude-haiku-5-5 | The model for unattended routines |
ODYSSEUS_TZ | the machine's clock | Your time zone, for reminders and message times. Set it on any server. |
ODYSSEUS_BROWSER_ASK_SIGNED_IN | on | You are asked before every browser run that is signed in as you. Set to 0 to let such runs start without asking |
Think before turning that last one off. You are asked before a browser run signed in as you starts, but nothing asks before a click inside it. With the setting at 0 such a run starts without asking and is only reported afterwards. If you sign the browser in to anything that can spend money or speak for you, leave it on. Chapter 11 explains what is at stake.
What you are trusting
Running Odysseus yourself means nobody stands between you and your data except the services you choose to connect. Each one sees something:
| Service | What it sees |
|---|---|
| The model maker | Your conversations, and whatever the tools return into them |
| The search service | The searches the model makes |
| The connector (optional) | It holds the access to your mail, calendar and connected apps, and your mail passes through it |
| The browser vendor (optional) | The tasks you browse, and the sign-ins you save there |
| The text-recognition service (optional) | Every file you send the bot, in full |
| The iMessage vendor (optional) | Every message on that channel, both ways |
| The WhatsApp reseller (optional) | Every message on its number, both ways, kept in readable form, and a token for your WhatsApp account |
| Your host | The disk holding your memory, schedule and log |
If something goes wrong
| What you see | Likely cause |
|---|---|
| The bot answers for five minutes after a deploy, then nothing | No payment card on a new Fly.io account. Look for "Trial machine stopping" in fly logs. |
fly status shows the check passing, and the app's address does not load | The app has no public address. Run the two fly ips allocate commands above. |
| After a move, "I was restarted and could not pick up our earlier conversation" | The conversation's folder under /data/agent/projects still has the name it had on your computer. Rename it to -app. |
| The machine restarts by itself under load | Out of memory. Raise memory in fly.toml. |
| No reply at all, and you are sure it is running | OWNER_TELEGRAM_ID is not your ID, or a second copy is running somewhere and taking the messages |
| "Missing settings: …" at start-up | A required line in .env is empty. The message names which. |
| Reminders arrive hours off | ODYSSEUS_TZ is not set on the server |
| "Today's budget … is used up" | The daily limit was reached. Raise ODYSSEUS_DAILY_USD or wait for tomorrow. |
| It says an app is not connected | Open the link in its reply and approve, then tell it you have |
To see what it actually did, read journal.jsonl in its data folder: one line per step, including every reply sent or lost. On Fly.io:
fly ssh console -C "tail -n 20 /data/journal.jsonl"Checking your copy
The tests run in under a minute and call no outside service.
pip install -r requirements-dev.txt
pytestThey prove what the code around the model does. They do not prove that it works with real services; three faults in the first day were found only by running it for real. The scripts in scripts/ are the live checks used here, and each one spends a few cents.