Self-hosted AI agents: assistants that remember and work inside my systems
Off-the-shelf AI assistants forget context, have unpredictable costs and can't work inside my systems.
The problem
Off-the-shelf AI assistants forget context from one conversation to the next, have costs that are hard to predict and can't work inside my systems.
The solution
I set up agents that run on my own server and answer through Telegram and the terminal:
- four-layer memory (session, daily note, topics and a central index) that cuts token use at startup and keeps decisions continuous;
- daily versioned backup to a private repository;
- private-network access, with no sensitive ports exposed to the internet;
- connections to my systems through MCP (Project Hub, Post Flow and finance);
- clear rules: anything sensitive goes through human approval.
How it works
- I write to the agent through Telegram or the terminal, from anywhere.
- It runs on my server, on a private network, with no sensitive ports exposed to the internet.
- Memory has four layers: session, daily note, topics and a central index, which avoids rereading everything at each start.
- Through MCP, it queries and acts on my systems, and anything sensitive goes through human approval.
Where it stands
Active and in daily use. The backup routine, server security and the connection to each system are still being refined.
Stack: Python, Hermes Agent, MCP, Docker, systemd, Tailscale, Git.
What I learned
- Organized memory beats a giant context: separating the ephemeral from the permanent cuts token use and preserves decisions.
- The provider's native authentication has a predictable cost and is more stable than relying on intermediaries.
- Deleting an old bot can silently take down alerts from other services. I now check who uses a token before removing it.
Frequently asked questions
What is MCP?
It's an open protocol that lets an AI assistant use tools and data from other systems in a standard way. My agents use it to query Project Hub, Post Flow and finance.
Why run it on my own server?
To keep control of cost, data and security, with versioned backups and private-network access.
Keep reading
Want something like this for your business?
Tell me what you need and I'll reply on WhatsApp.
Get in touch