Your always-on AI assistant, living in Telegram — running entirely on your Mac mini.

macOS Local SQLite 2-Brain Memory No cloud database ~20 min setup
⬇ Download gobot-starter.zip  201 KB

Grab the zip, then follow the steps below. Bookmark this page — it's your whole setup guide.

What you're setting up

Gobot is a personal AI agent you talk to through Telegram. You text it like a person; it thinks using Claude and remembers everything in two local databases on your own machine. Nothing about your conversations leaves your Mac.

🧠 Brain 1 — Working Memory

db/gobot.db

Every conversation, the facts & goals it learns about you, activity logs, and background tasks.

🧠 Brain 2 — Second Brain

data/gobot.db

Semantic search, a knowledge base, and any documents you feed it — so it can recall things by meaning, not just keywords.

Both databases are created automatically the first time you run the bot. You don't create, configure, or host anything — no Supabase, no cloud account, no server. It's all local files.

0Before you start — what you need

Everything else (Bun, Claude Code CLI) we install in Step 2.

1Create your Telegram bot

You need two things from Telegram: a bot token and your user ID.

A) Make the bot & get its token

  1. In Telegram, open a chat with @BotFather (the official one with the blue check).
  2. Send /newbot and follow the prompts (give it a name and a username ending in bot).
  3. BotFather replies with a token that looks like 123456789:ABCdefGhIjKlMnOpQrStUvWxYz. Copy it — that's your TELEGRAM_BOT_TOKEN.

B) Get your user ID

  1. Open a chat with @userinfobot (make sure it's spelled exactly that way).
  2. Send it any message like "hi". It instantly replies with your numeric ID (e.g. 987654321).
  3. That number is your TELEGRAM_USER_ID — it locks the bot to only you.
Keep both handy — the token and your ID go into one file in Step 4.

2Install the tools (Bun & Claude Code)

Open the Terminal app (⌘-Space, type "Terminal", Enter) and paste these one at a time.

Install Bun (the runtime that runs the bot)

curl -fsSL https://bun.sh/install | bash

After it finishes, quit and reopen Terminal so Bun is on your PATH. Verify with bun --version.

Install Node & npm (needed for Claude Code)

A fresh Mac has no npm. If npm -v says "command not found", install it via Homebrew — paste these one at a time:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Homebrew may ask for your Mac password and prompt to install Xcode Command Line Tools — that's normal, click through it.

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile && eval "$(/opt/homebrew/bin/brew shellenv)"

That line puts brew on your PATH (needed on Apple Silicon).

brew install node

Verify both print a version number: node -v && npm -v

Too slow or erroring out? Zero-terminal fallback: download the macOS installer from nodejs.org (the big green LTS button), double-click the .pkg, click Continue through it, then reopen Terminal.

Install the Claude Code CLI (the bot's brain)

npm install -g @anthropic-ai/claude-code

Now that npm works, this installs the CLI that lets the bot think.

Log Claude Code into your subscription

claude

Run claude once, pick "Log in with your subscription", and finish the browser sign-in. This is what lets the bot think for free. Confirm with claude --version. Type /exit to leave.

3Unzip the bot & install it

  1. Double-click gobot-starter.zip to unzip it. You'll get a gobot folder.
  2. Move that gobot folder somewhere permanent, e.g. your home folder.
  3. In Terminal, go into it (drag the folder onto the Terminal window to autofill the path):
cd ~/gobot
bun install

bun install downloads the bot's dependencies. It takes a minute or two the first time.

4Add your details (the .env file)

The bot reads its settings from a file called .env. Create it from the template:

cp .env.example .env
open -e .env

That opens the file in TextEdit. Fill in just these three lines, then save (⌘-S) and close:

TELEGRAM_BOT_TOKEN=paste_your_botfather_token_here
TELEGRAM_USER_ID=paste_your_numeric_id_here
USER_NAME=Your First Name
That's the whole database setup. Because you leave the Supabase lines blank, the bot automatically uses the two local SQLite brains. Nothing else to configure.
Keep .env private. It holds your bot token. Don't share it or post it anywhere.

5First run — say hi

Start the bot:

bun run start

You should see "Bot online as @YourBotName". The two databases get created automatically at this moment. Now open your bot in Telegram and send it a message like "hey, are you working?" — it should reply within a few seconds.

Heads up: Telegram bots can't message you first. Open the chat with your bot and send the first message yourself, then it will reply.

Leave it running to keep chatting. Press Ctrl+C in Terminal to stop it. Next step makes it run forever on its own.

6Make it always-on (survives reboots)

So the bot runs 24/7 without a Terminal window open, install it as a background service:

bun run setup:launchd -- --service telegram-relay

macOS may show a popup that "software from 'Jared Sumner' can run in the background" — that's just the Bun runtime. Click Allow.

Now the bot starts automatically when the Mac boots and restarts itself if it ever crashes. Your Mac mini can be left running headless and the bot just stays online.

Want the proactive extras too (daily check-ins + morning briefing)? Use --service all instead. Optional — skip it for now if you just want the chat bot.

7Optional: smarter memory (Ollama)

Brain 2 works out of the box with text search. If you want it to recall things by meaning (semantic search), install Ollama — free and local:

# Download the app from https://ollama.com then run:
ollama pull nomic-embed-text

The bot auto-detects Ollama on startup and switches memory to semantic mode. Nothing to configure — if it's running, it just works. Totally optional.

8Make it yours (optional)

Tell the bot about you so it tailors its answers. Create a profile from the template:

cp config/profile.example.md config/profile.md
open -e config/profile.md

Fill in your name, business, timezone, and how you like it to communicate. Save, then restart the bot (or the launchd service) to pick it up.

Handy commands

WhatCommand
Start the bot manuallybun run start
Health check everythingbun run setup:verify
Test Telegram connectionbun run test:telegram
Stop the always-on servicelaunchctl unload ~/Library/LaunchAgents/com.go.telegram-relay.plist
Start the always-on servicelaunchctl load ~/Library/LaunchAgents/com.go.telegram-relay.plist
See live logstail -50 logs/telegram-relay.log

If something's off

Bot won't reply

  • Did you send it the first message? Bots can't start the chat.
  • Check the token & ID in .env have no extra spaces.
  • Run bun run test:telegram to confirm the connection.

"claude: command not found"

  • Re-run the Claude Code install in Step 2.
  • Quit & reopen Terminal, then claude --version.

"npm: command not found"

  • Node isn't installed yet — do the Install Node & npm steps in Step 2 (Homebrew, then brew install node).
  • Or use the zero-terminal fallback: the LTS installer from nodejs.org.

"bun: command not found"

  • Quit & reopen Terminal after installing Bun.
  • Still nothing? Add it: echo 'export PATH="$HOME/.bun/bin:$PATH"' >> ~/.zshrc then reopen.

Bot replies slowly / errors

  • Make sure Claude Code is logged in: run claude once and sign in.
  • Check logs/telegram-relay.log for the real error.
There's a fuller reference in the zip: README.md, CLAUDE.md, and docs/troubleshooting.md.