Skip to content

kydrahul/barmaBot

Repository files navigation

Barma

A private Telegram bot that acts as your second brain — logs your days, remembers your relationships the way you experienced them, and reflects your patterns back to you over time.


What Barma is / is not

It is:

  • Private — only your Telegram ID can interact with it
  • Local — all data lives in a SQLite file on your machine
  • Yours — no cloud service, no accounts, no sharing

It is not:

  • A cloud service
  • Shared with anyone
  • Used to train any models

Setup

1. Get your credentials

What Where
Telegram Bot Token Message @BotFather on Telegram → /newbot
Your Telegram User ID Message @userinfobot → it replies with your numeric ID
Groq API Key console.groq.com/keys (free tier available)

2. Configure environment

copy .env.example .env

Edit .env and fill in your values:

TELEGRAM_TOKEN=your_bot_token_here
TELEGRAM_USER_ID=your_numeric_id
GROQ_API_KEY=gsk_your_key_here

3. Install dependencies

pip install -r requirements.txt

4. Run

python bot.py

Commands

Command Description
/start Welcome message
/help List all commands
/status Entry count, people tracked, prompt time
/with [name] [note] Log a moment with someone
/recall [name] Timeline of moments with a person
/people Everyone in your logs with mention counts
/week This week's entries grouped by day
/ask [question] Query your journal with AI
/settime HH:MM Change daily prompt time (24hr, IST)

Implicit features

  • Text messages → auto-tagged journal entry with AI summary
  • Voice messages → transcribed via Groq Whisper, then processed like text
  • Daily prompt → bot asks "how'd today go?" at your set time (default 21:00 IST)
  • Weekly reflection → Sunday 20:00 IST, AI-powered review of your week

Architecture

Telegram ──→ bot.py (handlers + security + dedup)
               │
               ├──→ ai.py (Groq Llama 3.3 70b — tagging, summaries, /ask)
               ├──→ voice.py (Groq Whisper — transcription)
               ├──→ db.py (aiosqlite — entries, relations, config)
               ├──→ scheduler.py (daily prompt, weekly reflection)
               └──→ config.py (.env loading + validation)

Stack

  • Python 3.11+
  • python-telegram-bot v22 (async, polling)
  • Groq (Llama 3.3 70b + Whisper large v3 turbo)
  • aiosqlite (async SQLite)
  • APScheduler (via python-telegram-bot job queue)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages