← All projects
ContactResume
Project

Second Brain

Notes that answer back, with citations

A Telegram bot that saves notes, links and voice notes, and answers questions from them with cited sources. Distilled into a paid skill, reviewed and live on the Agensi marketplace.

PythonCloudflare WorkersD1VectorizeWorkers AITelegram
scroll
Overview

What it is

Second Brain is a serverless Telegram bot: send it text, links or voice notes and it saves them; ask a question and it answers from your own notes, citing the exact notes it used. It runs as a pure-Python Cloudflare Worker with D1 for storage, Vectorize for embeddings and Workers AI for transcription, summarisation and answers. The same retrieval core is packaged as a paid skill on the Agensi marketplace, where it passed review and is listed live.

Save anything

Text, links and voice notes - voice is transcribed and summarised, and every save confirms with an ID.

Answers with citations

Hybrid BM25 + vector retrieval fused with RRF; a relevance threshold keeps unrelated notes out of the sources.

Honest fallback

If nothing in your notes matches, it says so and gives a labeled general answer or a Wikipedia lookup instead.

Note management

/search and /find list matching notes, /get shows one verbatim, /edit re-indexes, /rename retitles, /forget deletes.

Conversation memory

Follow-up questions work: the bot remembers the chat context, plus /brainstorm, /summarize and /web helpers.

On the marketplace

The distilled skill "Second Brain - notes that answer back, with citations" passed Agensi's review and security scan and is listed for $19.

Flow

How it works

Save

Incoming Telegram messages are stored in D1; voice notes go through Workers AI transcription first.

Index

Each note is embedded into Vectorize and indexed for BM25 keyword search at the same time.

Answer

/ask retrieves with hybrid search (RRF), builds a prompt from the top notes and replies with cited sources.

Pure-Python Cloudflare Worker. 183 tests. Deployed live.

Run it

git clone https://github.com/Prajit-22/second-brain-bot.git cd second-brain-bot uv run pywrangler deploy
Next projectnever429 →