Skip to content

TimurPythonUser/psycologist_telegram_bot

Repository files navigation

🤖 AI Psychologist Assistant "Alice" (Larisa Surkova's Aide)

Introducing "Alice"—a sophisticated, multi-agent conversational AI system designed to simulate a psychological consultation based on the methods of renowned psychologist Larisa Surkova. The system guides users through a structured dialogue, from an initial greeting and information gathering to providing a detailed conclusion with practical, actionable recommendations.

🏛️ System Architecture

The project is built upon a multi-agent architecture, where each component performs a highly specialized role, creating the effect of a coordinated team of experts:

  • Router Agent: The brain of the entire system. It manages the flow of the consultation, analyzes the state of the dialogue, and directs user input to the appropriate agent based on the current stage.

  • Greeting Agent: Establishes the initial contact, introduces the assistant in Larisa Surkova's signature style, and prepares the user to begin the consultation.

  • Profile Agent: Conducts a structured interview to gather key information about the user's problem, its impact on their life, and any previous attempts to resolve it.

  • Safety Agent: Monitors user messages in real-time for inappropriate or harmful content, ensuring an ethical and safe conversational environment.

  • Search Agent: Utilizes a FAISS vector database, built from Larisa Surkova's courses and materials, to find the most relevant solutions and techniques tailored to the user's unique situation.

  • Conclusion Agent: Synthesizes all gathered information (user profile + search results) to formulate a deep, personalized conclusion and a go-forward action plan.

  • Main Dialogue Agent: Engages after the analysis phase, conducting a free-flowing conversation to provide support and help the user delve deeper into their issues based on the initial recommendations.


⚙️ Setup and Installation

1. Clone the Repository

git clone [https://github.com/TimurPythonUser/psycologist_telegram_bot](https://github.com/TimurPythonUser/psycologist_telegram_bot)
cd psycologist_telegram_bot

2. Create and Activate a Virtual Environment

python -m venv venv
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Download the Vector Database ❗️

The pre-built FAISS vector database is required for the Search Agent to function. It is not stored in the repository due to its size.

➡️ Download the vector_db folder from this Google Drive link

Unzip the archive and place the vector_db folder in the root directory of the project.

5. Prepare the Prompts File ❗️

Ensure the system_prompts.xlsx file is present in the root directory. This file contains the system instructions for all agents and is critical for their correct behavior.

6. Set Up Environment Variables

Create a .env file by copying .env.example and fill in your secret keys:

# Your Telegram Bot Token
TGBOT_TOKEN=

# Your OpenAI API Key
SECRET_OPENAI_KEY=

# The bot's initial greeting (can be customized)
HELLO_MESSAGE="Hello! I can answer your questions, feel free to ask!"

7. Run the Bot

python main.py

Your AI assistant is now ready to start consultations!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages