LLM-based conversational Telegram bot aiming to mimic human texting behaviour. Rachel is a singapore girl!
- Faux typing indicator and delays between messages
- Conversational memory using summarisation models (using a technique similar to this)
- A separate bot to manage the bot's "context" (instructions on writing responses) from within Telegram (
/set_context,/get_context) - Manage conversation history using commands from within Telegram (
/update_history,/clear_history)
- Python 3 (tested on 3.9)
- A separate Telegram user account from your own, i.e. a second phone number to register for one (or use a service like Textverified)
- Clone repo, install dependencies in
requirements.txt - Rename
template.envto.env - Create a Telegram user account and obtain its API ID and hash
- Create a Telegram bot (message @BotFather) and obtain its bot token
- Create a Google Gemini API for free account and get your API key
- Get your personal Telegram account's user ID (not that of the bot you created earlier) (message @userinfobot)
- Update
.envwith all above information - Run
main.py
- Different personalities for different occasions (start with enthusiastic vs normal)
- Trigger for enthusiastic mode is when messages per min > threshold (then reduce typing delay)
- set random timer to be online after receiving messages
- For each group, store what you know about each user based on what they have said (long term memory)
- Long term: an agent inside the bot that rewrites the system prompt based on new information that may have shaped its world view, or emotions it might have felt from the interactions with other people