马自立99 downloadsCapture Telegram messages into your daily note, and chat with a bot that has read your recent notes. It keeps a profile note about you and works with the model you choose.
Getting started guide · 中文说明 · 上手指南
Contents
A Telegram bot for your Obsidian vault that does two things. Everything you send it lands in today's daily note, and when you want to talk, it answers as a friend who has read your recent notes. It keeps a small profile note about you that grows over time, and you choose which model sits behind it: Claude Code CLI, the Anthropic API, or any OpenAI-compatible endpoint, including a local Ollama.
It is a modified version of the community plugin Telegram Inbox, which saves messages sent to your own Telegram bot into your daily note. This version adds a character on the other end of the inbox who has read your notes. It can see what you are doing today, what you have been busy with all week and what you plan to do next. So when you say "I'm exhausted" it does not answer with a generic "hang in there", and when you say "done!" it knows what you finished.
The settings and the bot's built-in messages follow Obsidian's language (Chinese or English). The language of the model's replies is a separate setting, English by default.
| Your situation | What it does |
|---|---|
| An idea arrives and only your phone is at hand | Send it to the bot in Telegram. Text, photos and links go straight into today's daily note |
| You want to talk, but an AI chat needs you to explain what you have been doing first | It reads the last week of your daily notes before answering |
| AI chats repeat themselves after a while | It remembers what it said recently and does not bring the same thing up again |
| Every AI has the same customer-service voice | The default persona is warm and on your side. You can write a note that makes it play someone else, and teach it your own catchphrases |
| It forgets what you told it last time | After a chat it writes new facts into a profile note, and rewrites the recent part every week. Long-term traits are only added after you approve them |
| You want to know what you did today | Say "睡了" (going to sleep) and it replies with a summary: what got done, what to start with tomorrow |
| You do not want to be tied to one model provider | Switch between Claude Code CLI, the Anthropic API and OpenAI-compatible endpoints at any time. With a local Ollama, your notes never leave your computer |
Left: chat mode. The message was "Praise me! Look how much I got done today, and I sprained my ankle." Everything it praises is in that day's daily note: finishing the backlinks panel and shipping it at 4 a.m., working on a résumé, updating a skill, an hour of ball. It got the order of the sprain and the research backwards, corrected itself when told, and asked whether it still hurts to stand on.
Right: used together with Nautilus Spiral. At a few fixed times a day it sends today's spiral to your phone: how much of the day is gone, how much time is left, whether the to-dos still fit, and what to do next.
Both are real conversations from the author's own use, originally in Chinese and translated here (original screenshots). The model replies in the language set under Reply language; the Nautilus Spiral push is currently in Chinese only.
Desktop only. The bot runs inside Obsidian on your computer, so Obsidian has to be open for it to answer. Messages sent while the computer was asleep are picked up when it wakes.
main.js, manifest.json and styles.css from the latest release into <your vault>/.obsidian/plugins/telegram-companion/, then enable the plugin under Settings → Community plugins.@BotFather, send /newbot, and copy the token it gives you.@) or numeric IDs into the allowlist yourself./chat to start talking and /record to go back to capturing. /help lists every command.Chat mode starts only when you clearly want to talk:
/chat, or a message that is just a chat phrase. The default phrases are "chat mode", "let's talk", "let's chat", "I want to ask you" and "can I ask you" (with Obsidian in Chinese: 对话模式, 让我们来对话吧, 对话一下, 我想问你, 问你个事, 陪我聊聊 and a few more). It stays on until you send /record.Edit the phrases under Phrases that start chat mode in the settings. Symbols of your own work too: add ?? and send ?? what did I do this week. Moods do not start chat mode: "so tired" or "nailed it" is saved like any other message, and once you are in chat mode it answers in the matching tone. A chat that started any way other than a whole phrase or /chat returns to record mode after 20 minutes of silence (configurable) and tells you so.
| You send | It does | Saved to the daily note |
|---|---|---|
| Any text, photo, link or voice message | Saves it to today's daily note, timed by when the message was sent. With list mode on, each line becomes a list item; lines that already are list items (•, 1、, ① and the like) keep their own marker and indentation, and a # heading becomes an item with everything under it indented one level (## one level deeper). Optionally the first line gets the time it arrived, forwarded messages get a tag, and pictures are embedded at a percentage of their own width |
Yes |
/chat, /record |
Enters or leaves chat mode | No |
/voice |
Voice mode: chat mode where every reply comes as a voice message. Needs a voice command (see Voice replies); /chat switches back to text |
No |
/summary |
Summarises today without ending the day | No |
/mode |
Says which mode it is in | No |
/model |
Shows the current model, with buttons to switch | No |
/persona |
Shows the current persona, with buttons to switch | No |
/me |
Shows what it currently knows about you | No |
/profile |
Re-reads this week's notes and updates the profile | Updates the profile note |
/task text |
Adds a to-do | Yes |
/help |
Lists the commands, your own included | No |
| Your own triggers | Whatever you set them to do, see Custom commands | Depends |
Most commands also have a Chinese phrase (for example "对话模式" for /chat, "睡了" to end the day and get the summary). The full list is in the Chinese README.
The built-in phrases are fixed, such as ? for today's schedule. Under Custom commands in the settings you pick your own triggers (a word, a few letters or a symbol: !, zz, idea, /idea) and what each one does:
| Kind | What happens | Example |
|---|---|---|
| Same as a built-in command | A message that is just the trigger does what that command does | zz ends the day with the summary; sched shows today's spiral schedule |
| Save to a note | The text after the trigger is written to a note, in a format you choose. With no note set, it goes where messages are normally saved (today's daily note) | Trigger idea, note Ideas.md, format - {{time}} {{text}}: sending idea podcast about sleep adds - 14:05 podcast about sleep to Ideas.md |
| Ask the model | It answers a prompt you wrote, with your profile note and the last week of daily notes at hand. The message is not saved | Trigger recap, prompt "From today's note, list what I got done and give me a first step for tomorrow" |
idea: text). A trigger that ends in a symbol can be followed directly (!buy milk).{{text}} is the text, {{time}} the time the message was sent and {{date}} its date. - [ ] {{text}} makes a to-do. In a prompt, {{text}} is the text after the trigger; without it, the text is added after the prompt./ and uses only lowercase letters, digits and underscores (/idea) also shows up in Telegram's / menu. /help lists your commands at the end.Tasks in your daily note can be Markdown checkboxes (- [ ], - [/], - [x]) or keywords (- TODO, - DOING, - DONE). It reads both.
/persona.Rules that hold whatever the persona or profile says: it responds only to your own affairs and does not apply other people's words quoted in your notes to you; it brings up self-harm resources only when you explicitly say you want to hurt yourself in the current conversation; and when the model cannot be reached, it says so right away.
A persona also gets a few red lines that come before anything the persona note says: every character is an adult (18 or older) and is not played childlike; it can be sweet and flirty but never sexually explicit; it does not make money, medical, legal or safety decisions for you, only points out the risks; and it does not play a character that manipulates you or encourages harm. These are instructions to the model, so they are not guaranteed. The one check the plugin does itself: a persona note that states an age under 18 or says the character is a minor is not used, and the default persona answers instead.
The bot remembers you in four layers: the higher, the more stable; the lower, the shorter-lived. Your daily notes are not one of them. They are your own record, which it reads before replying but never edits.
| Layer | Where it lives | How it gets written | How long it lasts |
|---|---|---|---|
| Long-term profile | The sections you wrote at the top of the profile note | You write it. The bot can only suggest additions; nothing is written until you tap ✅ | Until you change it |
| Recently | The "🔄 Recently" section at the end of the profile note | After a chat in which you said at least 150 characters, new facts are merged in; the whole section is rewritten every Sunday | Rewritten weekly |
| This week's chats | The plugin's own data file (data.json), never your notes |
Everything you say in chat mode | Marked once merged; cleared after the Sunday update |
| This conversation | Memory only | The last 16 messages (about 8 exchanges) | Cleared when you leave chat mode or switch persona |
It also keeps the replies it sent in the last 24 hours (up to 30), only so it does not repeat the same point or the same praise. They are cleared when you switch persona.
Send /me to see what it currently knows about you, or /profile to update the profile from this week's notes right away.
In chat mode, every reply hands the model:
Chat replies, summaries and profile updates call a large language model. Choose one backend in the settings:
| Backend | What you need | Good for |
|---|---|---|
| Claude Code CLI | Claude Code installed and logged in on this computer; no key | People with a Claude subscription |
| Anthropic API | An API key and a model name | Paying per use for Claude |
| OpenAI-compatible endpoint | A base URL, a key and a model name. DeepSeek, OpenAI, OpenRouter and a local Ollama all work | Other providers, or keeping data on your computer with Ollama |
You can fill in all three and switch at any time, in the settings or by sending /model in Telegram.
Using your own DeepSeek key. Choose OpenAI-compatible endpoint, pick DeepSeek in the address dropdown, paste your key and enter the model name from DeepSeek's docs. Press the test button to check. Other providers with an OpenAI-compatible API work the same way with their own address.
Fallback backend. Pick a second backend under Fallback backend (备用后端) and fill in its settings right below it, and the bot keeps answering when the first one fails, for example when a subscription's usage limit is reached, a request times out, or a login expires. The failed request is retried once on the fallback, and the reply ends with a line saying which model answered and why the first one did not. For the next 10 minutes requests go straight to the fallback, then the first backend is tried again. For example, use the Claude Code CLI as the backend and, as the fallback, OpenAI-compatible with DeepSeek picked as the address, plus a DeepSeek key and model name.
Where your data goes. For each reply the plugin sends your profile note, the persona note and a digest of the last week of daily notes (task lines and top-level items, no attachments) to the model service you chose (or to the fallback backend, when one is set and it answered), and to no one else. API keys are stored in the plugin's own data.json. If your vault is synced to a public place, exclude that file.
Chat replies can also arrive as Telegram voice messages. The plugin does not include a text-to-speech engine. You tell it which program on your computer turns text into audio, so the voice can be a local model, a cloud service, or your own cloned voice. This is off by default.
{out} is replaced with the audio file the command should write; Telegram voice messages need OGG Opus. The text to read arrives on standard input, or as an argument wherever you write {text}. For example my-tts -o {out}.Before the text is handed over, HTML, links, emoji and list markers are removed, and lines without punctuation get a full stop so the voice pauses there. One reading runs at a time; while it runs, Telegram shows "recording voice". If the command fails, a silent message says why and the text reply stays as it is.
Voice mode. Send /voice (or 语音模式) to start a chat in which every reply is only a voice message, whatever the setting above says; if a reading fails, the text is sent instead. Each voice message has a 📝 Show text button that puts its text under the voice bubble (tap Hide text to fold it away). /chat switches back to text replies, /record leaves. Your own voice messages are still saved to the daily note rather than answered.
BreezeBlue is a cloud text-to-speech service: design a voice from a one-line description, or clone one from a recording. Its free plan gives 400 credits a day, claimed by hand on the website; a credit is 10 characters, and Chinese, Japanese and Korean characters count double. Its official CLI works as the voice command as is, with no script of your own:
Install the CLI and log in (macOS / Linux; for Windows see its docs):
curl -fsSL https://breezeblue.ai/cli/install.sh | sh
breeze login
breeze login opens the browser to authorize this computer and keeps the key in ~/.breeze, where the CLI finds it when the plugin runs it; no key goes into the plugin. The installer also adds BreezeBlue's own agent skills to any Claude Code, Codex or Cursor it finds.
Pick a voice: design or clone one on the BreezeBlue website and save it to get its id, which starts with voc_. breeze voice list lists your saved voices too.
Fill in Voice command (replace voc_xxx with your voice id and en with the language you chat in):
breeze tts --stdin --voice voc_xxx --language en --no-stream --format opus --file {out} --agent
--format opus writes the OGG Opus that Telegram voice messages need, so nothing has to be converted. The streaming endpoint cannot produce opus, hence --no-stream.--instructions "warm, unhurried, no breathiness".breeze, give the full path as the first word, for example ~/.local/bin/breeze.Try it in a terminal first: echo Hello, long day today | breeze tts --stdin --voice voc_xxx --language en --no-stream --format opus --file test.ogg --agent, and play test.ogg.
When the credits run out, or today's were not claimed, the reading fails: the 🔊 button sends a message saying why, and voice mode sends the text instead. With BreezeBlue, the replies to be read are sent to its servers (api.breeze.blue).
The plugin works on its own. Together with Nautilus Spiral, a plugin by the same author that draws today's events and to-dos as a spiral schedule, it does more:
? to get today's spiral and what is next.done 写稿 2h and doing 写稿 update the matching task in today's note (this one also needs the done-to-top plugin).Without these plugins the phrases above are saved like any other message, and everything else works the same.
api.telegram.org): receives the messages you send to the bot, sends replies, and downloads photos and files from messages.api.anthropic.com for the Anthropic API, or the base URL you entered for an OpenAI-compatible endpoint. With a local Ollama nothing leaves your computer. If a fallback backend is set, the same content goes to that service instead when the first backend fails.claude program installed on your computer to generate replies, using that program's own login. Other backends start no programs. If you set a voice command, the plugin starts that program to make voice replies; whether it goes online depends on the program you chose.It is not therapy and does not replace the people around you.
To follow new features, send feedback or keep up with progress, follow me on Twitter: @Matsurimywaifu.
Based on the community plugin Telegram Inbox by icealtria. The original inbox, media download and message templates are kept. This version adds the two modes, the companion, personas, catchphrases, the profile note and the switchable model backends. The source changes are in this repository's commit history. The original is released under GPL-3.0, and so is this version: GPL-3.0.