Let's improve the devOps experience
Let’s add some quality of life improvements.
Note: This is one in a series of posts about making a multi agentic personal AI bot. See the others in the series here.
Today I made some tweaks to make running and developing my bot easier.
Since I last wrote…
I’ve been playing with the “Projects” feature in Claude, and it already does some of what I’m hoping for my bot setup to do. I can have multiple chats, each with its own context and instructions, and by putting these in a project, each can reference a shared knowledge base. It’s been a way to get me about 50% of where I want to go with my project, and it’s making me question my whole approach. Especially with new features in Claude like dispatch, which makes it possible to control Claude Work from a phone / on the go.
This may alter my long term plans for this project.
Back to the main storyline…
Since the last post I wrote, I had to reboot my Proxmox server, and with that, my bot died. Not permanently … but rather, because the LXC was not setup to auto-boot, nor was the bot setup to run as a service.
This became a problem this morning because I wanted some help planning the week ahead, and the easiest way to get my calendar into Claude is to copy and paste output from my bot back into a conversation in Claude desktop. So I took a time out to fix it.
Step 1 - Operationalize with shell scripts
When I tried to get my bot going again, I had an error in the shell:
Traceback (most recent call last): File "/root/assistant/bot.py", line 1, in <module> from telegram import Update ModuleNotFoundError: No module named 'telegram'
No problem, I could just ask Claude, and I was quickly reminded of things I had forgotten since my last work session on this. Claude reminded me that I needed to activate a virtual environment before the bot could run.
This is the moment I realized there was likely an easier way. I had Claude write me 3 shell scripts. I knew of shell scripts but somehow have never written one myself. My knowledge with this concept goes back to DOS .bat files, and…same concept. So simple enough there. Fun to learn by doing (with help).
prod.sh - Start bot as service
#!/bin/bash
echo "Starting production service..."
systemctl start assistant
systemctl status assistant
dev.sh - Start bot in console with verbose output for troubleshooting
#!/bin/bash
echo "Stopping service..."
systemctl stop assistant
echo "Starting bot in dev mode (Ctrl+C to stop)..."
cd /root/assistant
source venv/bin/activate
python3 bot.py
stop.sh - Stop the service (without starting in dev mode)
>#!/bin/bash
echo "Stopping service..."
systemctl stop assistant
systemctl status assistant
Step 2 - Cleanup Proxmox setup
With the shell scripts in place to easily toggle between bot-as-a-service and bot-running-semi-interactively, I set this LXC to auto-boot when Proxmox boots. This ensures that the next time I need to reboot my Proxmox server, I’ll still have access to my bot.
Step 3 - Document
This highlights one of the challenges with building this way, and not having all the professional habits around this that one would hope to develop over time. When you’re moving fast and not building all the stuff yourself, it’s tougher to remember stuff.
So I also started some dead simple documentation in a github repo, to which I’ll add my other project assets in a future work session. Henrybot on github
What’s next?
I’ll be pondering how I want to best proceed. I am looking into options that will make it easy to bridge the custom stuff I’m building using developer tools like Claude API with the “consumer” offerings in Claude desktop.