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.
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.
git clone [https://github.com/TimurPythonUser/psycologist_telegram_bot](https://github.com/TimurPythonUser/psycologist_telegram_bot)
cd psycologist_telegram_botpython -m venv venv
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activatepip install -r requirements.txtThe 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.
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.
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!"python main.pyYour AI assistant is now ready to start consultations!