We Built a News Bot That Only Shares What You Like!

A demo and walkthrough of an AI-powered Telegram news bot (called 'newsmate') that curates personalized, ad-free news digests via conversational UI. The presenters (Angelina Yang and Mehdi) show features including setting topic preferences (categories), scheduling daily digest times, and a backend that scrapes news sites and stores articles in a SQLite database (demo dataset includes ~400 CNN articles). Many features (scheduler, live scraping, conversation history, user-defined source lists) are sketched or partially implemented rather than complete.
Questions this video answers
newsmate
SQLite
CNN — about 400 articles (pre-scraped)
Chapters
What if we can have an AI assistant who can source our news feed and present them to us in a very conversational user interface and they only share stories we care about. And more than that, there will be no ads, just the news. Right. Today, Mehdi and I are going to build an AI Telegram bot that does exactly that. So let's dive in. Hi, Mehdi.
Hi, Angelina. Let me share my screen. And then you have a big promise.
It's okay. We have the skeleton of it. We have the skeleton of it.
Yeah, that's the point. We have the skeleton of the code. So here is the bot. I just cleared my history, so we can start the bot and have a conversation and just see how it works. I would like to say that obviously I haven't implemented all the features that I will explain later on, but before doing anything, I would like just show the demo and show you how it works and the features that it currently has, and then we can discuss the architecture and the code and more details. When you come to the bot, I called it newsmate. Then when you start the conversation, it has this kind of welcoming message where it just shows you the commands that it can handle and just simply a basic message. So it has this conversational capabilities because there is an AI behind that. But I haven't added like conversation history and handle a lot of different scenarios and things like that because this is just a very basic version of that. So let's see how it works. So if I say hey there and then it has to just give us write a meaningful message and it says, are you interested in some news and all that. If I type help, then obviously it will just show this all the commands. And there are three other commands. One of them is called categories.
How do I give the bot my preference? What do I want to read about?
That's exactly what this command does. When you type categories, it shows all the different categories of news that it supports. So where they have come from, I have manually defined them in the code, but eventually, and ideally users can define their own categories and things like that. But I have defined these number of topics here. Politics, business. And let's say I am a new user, so I click on politics and then it says added to your interest. Right. Entertainment, science, I don't know, Business, just you can click on as many of them as you want and then it's going to capture that and store it in a database. The database is a SQLite database and that you can see later on if I just show the data. But it's a Very basic one. All right, so let's say I have added these different categories and the thing is right now for this demo I have already scraped and got.
Let me ask. So now I have to find out categories that I'm interested in. The question is where are the news coming from?
Right.
This is a telegram bot.
Exactly. That's a very good point. Again, for this demo and in this version of the code I have defined a list of news websites that at the beginning bot will go. When you run this entire application, it will just go and grab the news articles and store them inside the database. So I did run that once. Right now I have disabled that scheduler just news capture module. So it already has a collection of news items from CNN website and that's the only thing that they added about 400 news articles that go back to a while ago. So I haven't updated the the database, but it's already there. Again ideally user wants to say that oh, here is a list of URLs or websites that I'm interested in. And then bot will just behind the scene will run bottom that news downloader thing and then it will just go and you know, get the, the, the.
News grabber behind the scenes. So the new user can define what they want. Like whether I want cnn, I also want New York Times maybe.
Exactly. Just like the RSS feed kind of thing. Yes, user can define and then behind the scene that module will be called and then it will go to those particular URLs and get the news. But again this is not implemented. Yeah, so now if I there is another command here is called digest. So digest is going to go and based on my preference that I have already defined, the bot will go and get some news articles that it has already captured and are in the database and then it will just show them to me. So here you can see I clicked on Politics Business. So for all the categories that they specified as my preferences, then it will just go in the database and if there is any news related to that category it's going to get restricted to two different news items. But again this is hard coded. Users can change later on and add that as part of the conversation. So here you can see from CNN that's the only source. But these are the Politics news. It gives the title and the URL of the news. So all of these things are real news, right? For business, for sports, things like that. So let's say if I click on this one, then it open this, you can see that, right? Do you see the browser Yep.
I can see the residential bracket.
Yeah. So I don't know, I click on this one, the sports one. So it come to the sports and you can see the news item. Because at the beginning, as I said, these news articles have been scraped and then they have been stored in the database. Right now it just goes there and grab a couple of them.
Is it possible for me to schedule it? So like in the morning when I'm drinking coffee, I can, instead of going to a new site, I can just talk to the telegram bot. What's the latest news across several sites, maybe.
So when you click on digest right now, it's going to go in the database and let's say whatever it has, depending on the topic, it's going to show that to you. However, you can add this logic where it has to just go and show you the latest one. Because there could be like a lot of different news articles about technology, but you want to see whatever is right in the database, like today, this morning. So this has to be added into the code. And there is another thing that I called, time. So it's another command slash time. If I just type that, then it just shows you different time that they defined. Six, eight, things like that. These are the preferred daily digest time. It is supposed to, let's say if I click on 6 or I don't know, like 6pm Then at that time it has to go and get my digest and it has to show that to me. Exactly. But again I have implemented the skeleton of that, but it is not hundred percent completed. But it's there if you. I'll show you the code and it's 80% there. But I didn't want to just spend a whole lot of time on this demo. This is just again a demo to show the capabilities and what is possible. But I haven't implemented all the features.
I'm a great. So once you set the digest time to let's say 6am and does it mean that the Telegram bot will initiate a conversation to me, send me the digest in the morning at 6am it.
Is supposed to do that, but it's not there. Yes, potentially.
I see, I see.
At 6pm Then. Yes. Or at 6pm it has to. Yeah, it has to send you let's say the news articles and I need to take a look to make sure that it also captures the news right. And then show that to you. It's not just about showing whatever it has. It also needs to get some like the latest news and show them to the user.
So you process the latest News at maybe 5:50 or something like that and show me the news at 6 o' clock so that I have the freshest news.
Exactly. When I designed this chatbot, this AI assistant, I wanted really to implement all the features. Even users can give feedback, right? Let's say if I want to say I don't like this type this news anymore, right. I can change my preferences or even give feedback and all that. So I have added all the descriptions and everything into the to the project, but I really didn't implement all of that. So there will be a recommendation system that is in charge of improving the user's preferences and all that, but it is not implemented unfortunately didn't have the time to do that. But the code is there. People can go and use the code and update it, change it however they want. This is more or less the logic even here. If I just start having a conversation with it, it's going to have a natural conversation. However, if I say show me a bunch of news about a particular topic, that is not even my preference. Sometimes it just hallucinate, generate something, right? Because it doesn't consider the conversation history. So all of you know the checking and doing, considering the history of the conversation and all that is not implemented and baked into the code yet. But that's about demo. Now let's switch to the architecture. So I can show the architecture and then explain what how each component works and then I can also show a little bit of the code that they have. So the idea here is that we are using Telegram API so users are going to talk to our backend which is a fast API via Telegram API and webhook. So that's essentially this part. So everything that all the messages will be redirected to our backend and in the backend we'll get the messages and then there is a conversation manager that is in charge of handling the conversation history and all of that. But again it's not fully implemented, but the skeleton code is there. Users can add those features. I have also added a personalization module where its job is to get user interest and based on users feedback essentially changes and updates the user preferences for better recommendation. So all the conversation and everything could be recorded inside a database. There is a database I have created database but it just contain a few tables about the articles, mostly about the news, right? Not necessarily capturing all the users preferences and things like that. And then there is also a component that they called it scheduler. So its time essentially is to at particular time it will be triggered and it just goes to whatever sources that we have defined, and it's going to get the news articles from the websites and extract the title, the metadata about the news, even summarizes that using the AI, which is actually currently doing, and then it's going to store that inside the database. Here I mentioned vector database or normal database. So I don't have any vector database. If so, I have a regular SQL like database. But if users want to be able to have a conversation, the question answering over the news articles, then having a vector database is needed. Pretty much. So these are all the components and as I said, I have implemented almost all of them, but not fully for this demo.
More from Angelina

The MrBeast Rule That Quietly Decides Who Wins on YouTube | Rox Codes, CEO @ Flightcast

Ask Any C-Suite This One Question About Their AI Agents | Hector Hernandez, COO @ Speakeasy








