<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Serg</title>
    <description>The latest articles on DEV Community by Serg (@mastter_nsk).</description>
    <link>https://dev.to/mastter_nsk</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4105576%2Ffb4fdc67-9c28-4d21-aa89-d4d17b625e53.png</url>
      <title>DEV Community: Serg</title>
      <link>https://dev.to/mastter_nsk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mastter_nsk"/>
    <language>en</language>
    <item>
      <title>I built a Personal AI Assistant for Telegram that deploys on Railway with 3 variables</title>
      <dc:creator>Serg</dc:creator>
      <pubDate>Wed, 02 Sep 2026 06:48:27 +0000</pubDate>
      <link>https://dev.to/mastter_nsk/i-built-a-personal-ai-assistant-for-telegram-that-deploys-on-railway-with-3-variables-1906</link>
      <guid>https://dev.to/mastter_nsk/i-built-a-personal-ai-assistant-for-telegram-that-deploys-on-railway-with-3-variables-1906</guid>
      <description>&lt;p&gt;I wanted a personal AI assistant that lives somewhere I already use every day: Telegram.&lt;/p&gt;

&lt;p&gt;Not another web UI, not another browser tab, and not an n8n stack with Redis, workers and half a dozen services.&lt;/p&gt;

&lt;p&gt;So I built a lightweight Railway template:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Python + PostgreSQL + Telegram Bot API + OpenAI API&lt;/strong&gt;&lt;br&gt;
The goal was simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deploy → enter 3 values → start chatting.&lt;/strong&gt;&lt;br&gt;
The only required variables are:&lt;/p&gt;

&lt;p&gt;TELEGRAM_BOT_TOKEN&lt;br&gt;
OWNER_TELEGRAM_ID&lt;br&gt;
OPENAI_API_KEY&lt;/p&gt;

&lt;p&gt;PostgreSQL is created and connected automatically by the Railway template.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What it does&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The current version supports:&lt;/p&gt;

&lt;p&gt;persistent conversation history&lt;br&gt;
long-term personal memory&lt;br&gt;
automatic memory for useful facts&lt;br&gt;
/new, /memory, /remember, /forget&lt;br&gt;
built-in web search&lt;br&gt;
Telegram voice messages → transcription → AI response&lt;br&gt;
image understanding&lt;br&gt;
PDF, DOCX, XLSX, PPTX, CSV and TXT analysis&lt;br&gt;
custom personality&lt;br&gt;
owner-only access&lt;/p&gt;

&lt;p&gt;The owner whitelist is checked before OpenAI requests and media processing, so random Telegram users can't burn your API credits.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Telegram?&lt;/strong&gt;&lt;br&gt;
For me, the main advantage isn't another set of AI features.&lt;/p&gt;

&lt;p&gt;It's that the assistant lives inside an app you already have open.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;It also uses your own OpenAI API key instead of requiring a fixed ChatGPT Plus subscription.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why not n8n?&lt;/strong&gt;&lt;br&gt;
I actually considered it.&lt;/p&gt;

&lt;p&gt;But for a public Railway template I wanted:&lt;/p&gt;

&lt;p&gt;fewer services&lt;br&gt;
lower RAM usage&lt;br&gt;
fewer environment variables&lt;br&gt;
fewer things that can fail during deployment&lt;br&gt;
easier code for other developers to inspect and modify&lt;/p&gt;

&lt;p&gt;So v0.1 intentionally has no n8n, Redis, FastAPI or separate vector database.&lt;/p&gt;

&lt;p&gt;Long-term memory is stored directly in PostgreSQL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deploy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can deploy it here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://railway.com/deploy/personal-ai-assistant-for-telegram--personal-ai-assistant" rel="noopener noreferrer"&gt;https://railway.com/deploy/personal-ai-assistant-for-telegram--personal-ai-assistant&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Source:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/mastter-nsk/personal-ai-telegram" rel="noopener noreferrer"&gt;https://github.com/mastter-nsk/personal-ai-telegram&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd be interested in feedback on two things in particular:&lt;/p&gt;

&lt;p&gt;Is the 3-variable setup simple enough?&lt;br&gt;
Would you actually use a personal AI inside Telegram instead of a separate AI app?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>telegram</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
