I wanted a personal AI assistant that lives somewhere I already use every day: Telegram.
Not another web UI, not another browser tab, and not an n8n stack with Redis, workers and half a dozen services.
So I built a lightweight Railway template:
Python + PostgreSQL + Telegram Bot API + OpenAI API
The goal was simple:
Deploy → enter 3 values → start chatting.
The only required variables are:
TELEGRAM_BOT_TOKEN
OWNER_TELEGRAM_ID
OPENAI_API_KEY
PostgreSQL is created and connected automatically by the Railway template.
What it does
The current version supports:
persistent conversation history
long-term personal memory
automatic memory for useful facts
/new, /memory, /remember, /forget
built-in web search
Telegram voice messages → transcription → AI response
image understanding
PDF, DOCX, XLSX, PPTX, CSV and TXT analysis
custom personality
owner-only access
The owner whitelist is checked before OpenAI requests and media processing, so random Telegram users can't burn your API credits.
Why Telegram?
For me, the main advantage isn't another set of AI features.
It's that the assistant lives inside an app you already have open.
You can send it a voice message, forward a document, drop in a photo, or ask a quick question without opening a separate AI website.
It also uses your own OpenAI API key instead of requiring a fixed ChatGPT Plus subscription.
That means API usage is pay-as-you-go. Some eligible OpenAI API accounts can also opt in to data sharing and receive complimentary daily tokens.
Of course Railway hosting still has its own usage cost, so I wouldn't call it a completely free ChatGPT replacement. The point is more about having control over the stack and paying for what you actually use.
Why not n8n?
I actually considered it.
But for a public Railway template I wanted:
fewer services
lower RAM usage
fewer environment variables
fewer things that can fail during deployment
easier code for other developers to inspect and modify
So v0.1 intentionally has no n8n, Redis, FastAPI or separate vector database.
Long-term memory is stored directly in PostgreSQL.
Deploy
You can deploy it here:
https://railway.com/deploy/personal-ai-assistant-for-telegram--personal-ai-assistant
Source:
https://github.com/mastter-nsk/personal-ai-telegram
I'd be interested in feedback on two things in particular:
Is the 3-variable setup simple enough?
Would you actually use a personal AI inside Telegram instead of a separate AI app?
Top comments (0)