AI-based psychological support chat-bot
About the project:
This is a project of a Telegram bot created to provide initial emotional support to users. The goal is to create a safe space where a person can express their feelings and receive a warm, empathetic response from an AI conversational partner.
Key features and characteristics:
Intelligent core based on Google Gemini:
The bot uses the powerful language model gemini-1.5-flash-latest for conducting deep and meaningful dialogues.
A detailed system prompt has been developed to set the AI's role as an empathetic conversational partner, not a psychologist, and to define the communication style.
Crisis situation handling:
Built-in mechanism for recognizing key words related to suicidal thoughts.
In case of risk detection, the bot automatically sends a message with contacts of emergency psychological assistance services in Ukraine.
Contextual memory:
The bot saves the dialogue history with each user, allowing it to maintain conversation context and provide more relevant responses.
Thoughtful user experience:
Implemented commands /start, /help, /reset for convenient navigation.
At startup, the bot provides a detailed explanation of its purpose, capabilities, limitations, and information to support the project.
Reliable architecture:
Code written in Python using the asynchronous library python-telegram-bot.
A retry mechanism is implemented when calling the API to improve stability.
For security, tokens and API keys are stored in environment variables (.env).
Technologies and concepts:
Chatbot development
Integration with API (Google Gemini API)
Working with LLM (Large Language Models)
Prompt engineering
Asynchronous programming (Async/Await)
Error handling and stability (Error Handling, Retry logic)
Conversation state management (ConversationHandler)
Secure configuration storage
This is a project of a Telegram bot created to provide initial emotional support to users. The goal is to create a safe space where a person can express their feelings and receive a warm, empathetic response from an AI conversational partner.
Key features and characteristics:
Intelligent core based on Google Gemini:
The bot uses the powerful language model gemini-1.5-flash-latest for conducting deep and meaningful dialogues.
A detailed system prompt has been developed to set the AI's role as an empathetic conversational partner, not a psychologist, and to define the communication style.
Crisis situation handling:
Built-in mechanism for recognizing key words related to suicidal thoughts.
In case of risk detection, the bot automatically sends a message with contacts of emergency psychological assistance services in Ukraine.
Contextual memory:
The bot saves the dialogue history with each user, allowing it to maintain conversation context and provide more relevant responses.
Thoughtful user experience:
Implemented commands /start, /help, /reset for convenient navigation.
At startup, the bot provides a detailed explanation of its purpose, capabilities, limitations, and information to support the project.
Reliable architecture:
Code written in Python using the asynchronous library python-telegram-bot.
A retry mechanism is implemented when calling the API to improve stability.
For security, tokens and API keys are stored in environment variables (.env).
Technologies and concepts:
Chatbot development
Integration with API (Google Gemini API)
Working with LLM (Large Language Models)
Prompt engineering
Asynchronous programming (Async/Await)
Error handling and stability (Error Handling, Retry logic)
Conversation state management (ConversationHandler)
Secure configuration storage