Our Silage Notebook Is Now a Telegram Bot

Our Silage Notebook Is Now a Telegram Bot

On the silage side of Khamarvest, my partner Hasibul Talukder Shanto and I run the business together. We make maize silage and sell it to farms across Bangladesh through silage.khamarvest.com. We wanted one thing: write down every taka that comes in and every taka that goes out.

That sounds small. It is not, because of how the business actually works.

We sell silage mostly in standard 50 kg bags, and sometimes by the ton. Prices change from sale to sale. Many customers pay later. We sometimes buy maize on credit too. We buy the maize crop by land area, in bigha, and sometimes we do not know the exact size of the land. Some silage is wasted. And there are the running costs: labour, khawa (food), gari tel (fuel for the vehicle), repair, mobil.

Before this, we kept it all in a notebook, with a pencil. That worked when the notebook was in hand. It often was not. A sale happened in the field, a payment came in on the road, and it went into the notebook later, or not at all. Nothing was instant, and only the person holding the notebook knew the numbers.

So I built a bot. It went live on 11 November 2026, so this post is about how it works and why. It is not about numbers yet.

Why Telegram, and not an app

An app has to be installed, updated, and learned. Telegram is already on both our phones. If the network drops, Telegram holds the message and sends it when the network is back. You type, you send, and it goes when it can.

We also have a Telegram group. Other people can read it. Only the two partners can enter data. The bot ignores everyone else, silently.

How you talk to it

You write what happened, in a short fixed format. The bot reads it, shows you a summary, and waits. Nothing counts until you press Save.

A sale message and the bot’s reply in Bangla: 100 bags, ৳53,000, ৳530 per bag, with Save and Cancel buttons. The customer name is blurred.

Here are the real messages. Rahim and Karim are made-up example names.

What happenedYou write
Sold, fully paidsell 40 bag 34k Rahim
Sold, not paid yetsell 40 bag 34k Rahim due
Sold, part paidsell 40 bag 34k Rahim paid 20k
Bought maize by landbuy 1.5 bigha 45k Karim
Not sure of the land sizebuy 1.5? bigha 45k Karim
Made bagsmade 180 bag from 1.5 bigha
Spent money- 500 khawa
A buyer paid an old due+ 10k Rahim
We paid a farmerpay 30k Karim
Spoiled bagswaste 12 bag rain

k means thousand. 1.5 lakh works too. A date is optional and defaults to today, so you can add yesterday or 8nov if you forgot to write something down.

What changed for us

Writing an entry now takes a few seconds, right when it happens. The bot is the notebook, and it is always in our pocket.

It also answers questions the notebook never could, the moment we ask:

  • Stock. How many bags are left, how many tons of maize, and how many bags were wasted.
  • Prices. The average price we sold at, per bag, and what we paid for maize, per bigha or per ton.
  • Dues. Who owes us, and whom we owe.
  • A phonebook. Every buyer and every land owner we bought maize from, with a phone number and a thikana. Next season, when it is time to buy maize again, the numbers are there. So is the record of which land gave us the best deal.

Both of us see the same books, synced, at the same time. The other people in our group see each entry as it is saved. That is the part I care about most: everyone can see the numbers, so nobody has to ask.

Saved entries posted in our Telegram group, in Bangla, each with who saved it. Names are blurred.

Why a fixed format and not AI

I did not use AI to read the messages. A fixed format is free, and it never misreads an amount. For money, that matters more than being clever. I may add AI later for messy messages. For version one, no.

The words are English, with Banglish aliases. becha for sell, kena for buy, khoroch for spend, pelam for got, dilam for pay, nosto for waste. Expense words like khawa and tel work as they are.

The Bangladesh bits

Land is where a generic tool would fail us. Here the bot knows:

  • 1 bigha is 33 shotok.
  • 20 katha is 1 bigha.
  • 1 acre is 100 shotok.

So buy 1 bigha 5 katha 40k Karim works, and parts add up. Internally the bot stores everything in shotok and shows it back in bigha.

Sometimes we do not know the exact land size. For that I chose a question mark. 1.5? means “about 1.5”. I first thought of +-, but + and - already mean money in and money out in this bot. A ? has no other meaning. When you measure the land later, you edit the entry.

Money is shown the way we write it: ৳1,50,000, not ৳150,000.

One more number: 1 ton is 20 bags of 50 kg. The bot uses that to move between tons of maize and bags of silage.

The help menu

I wanted someone who reads at a class 5 level to understand it without help. A page of commands would lose them. So /help is a menu of buttons, each with a very short screen in simple words and an example you can tap to copy. There is a button to switch the help to Bangla. /lang bn makes the bot reply in Bangla too. By default it replies in simple English.

The bot’s help menu: ten buttons such as Sold silage, Bought maize, Spent money and See hisab, and a button to read it in Bangla

Keeping the books honest

Three rules, all on purpose.

Balances are never stored. Stock, dues and totals are always calculated from the entries. If you edit or delete an entry, every number fixes itself. There is no second copy to get out of sync.

Editing is just editing. To fix a mistake, edit your Telegram message. The bot shows what changes and asks you to confirm. /undo removes your last entry.

Every change is kept. Create, edit and delete all go into a history table, with who did it and when. If the two of us ever disagree about a number, the history can answer. That is how we trust the books.

New contacts need a phone number and a thikana. There is a Later button if you do not have them in the moment, and the 9pm summary reminds us about anyone still missing. The same summary lists customers whose dues are more than 30 days old.

Every Friday the bot also sends backup files, as CSV, privately to each partner. Not to the group.

How it is built

It is small.

  • Cloudflare Workers run the bot. One Worker handles both Telegram and the schedule.
  • D1, Cloudflare’s SQLite, holds the data: contacts, categories, entries, and the entry history.
  • grammY is the Telegram library. Telegram sends each message to the Worker, and the Worker turns away anything that does not come from Telegram.
  • A cron trigger fires every day at 9pm and posts the summary to the group.
  • TypeScript throughout, with a few hundred Vitest tests for the message reading and the money math.

Customer phone numbers and our numbers stay in our own database. They are not in the code, and not anywhere public.

For a business our size, I expect all of this to fit in Cloudflare’s free tier. I have not seen a bill yet, so I will not promise more than that.

What is next

I have no numbers to share yet, because we have just started. I will write a follow-up once we have a season of real numbers.

This is not the first thing I have built for the farm. Before this, we set up our own camera system, which I wrote about in We Wired Our Farm Ourselves.

What I want next is a web dashboard, so the books can also be read on a bigger screen. If it holds up in daily use, I might offer it to other farms. That is a maybe, not a plan.

For now, we write sell 40 bag 34k Rahim and press Save.

If you run a farm or a small business and want something like this for your own books, write to me at mmestiyak@gmail.com.

Written by . Software engineer from Bangladesh. I ship products end to end, from the browser to the board: code generation, firmware and PCB tooling at IDEEZA, and my own products ProcureIndex, Akhra and Kommercly. Also farms, cycles and fights MMA.

Published

Get new logs by email. No spam, unsubscribe anytime.