An AI-powered emotional support agent that can identify, store, and help resolve emotional issues using MongoDB and AutoGen.
- 🤗 Empathetic conversation with users
- 🧠 Automatic identification of emotional issues
- 💾 Storage of issues in MongoDB for tracking
- 🔄 Ongoing support and coping strategies
- 💬 Casual chitchat capability
- 📊 Issue history retrieval
make bootstrap
This will install uv, dependencies, and create a .env template.
# Install dependencies
make install
# Run the agent
make run
# Development mode (install + run)
make dev
# Full setup (install + create .env)
make setup
make help # Show all available targets
make install # Install dependencies using uv
make run # Run the emotional support agent (checks environment first)
make setup # Setup environment (install + create .env template)
make clean # Clean up temporary files
make dev # Install dependencies and run in development mode
make check-env # Check if environment variables are configured
make check-deps # Check if required tools are available
make install-uv # Install uv if not present
make bootstrap # Full setup including uv installation
Note: The run
target automatically checks if your OPENAI_API_KEY
is properly configured before starting the agent. If the API key is missing or still set to the placeholder value, it will stop with a helpful error message.
pip install uv
uv pip install -r requirements.txt
Make sure MongoDB is running with authentication. The default connection string expects:
- Username:
admin
- Password:
123qwe
- Host:
localhost:27017
- Auth source:
admin
Create a .env
file with:
OPENAI_API_KEY=your_openai_api_key_here
MONGO_URI=mongodb://admin:123qwe@localhost:27017?authSource=admin&authMechanism=SCRAM-SHA-256
uv run python emotional_support_agent.py
- The agent will greet you and create a safe space for conversation
- Share your thoughts, feelings, or concerns
- The agent will identify significant emotional issues and store them automatically
- Continue the conversation for support and coping strategies
- Type "GOODBYE" to end the session
Issues are stored in emotional_support.user_issues
collection with:
{
"user_id": "string",
"issue_type": "string",
"description": "string",
"severity": "low|medium|high",
"timestamp": "datetime",
"status": "active|resolved",
"resolution_notes": []
}
- Modify the system message in
emotional_support_agent.py
to adjust the agent's personality - Add more tools for additional functionality
- Implement user authentication for production use
- Add more sophisticated issue categorization
- This is a PoC for educational purposes
- Not a replacement for professional therapy
- Always encourage users to seek professional help for serious mental health concerns
- Ensure proper data privacy and security in production environments