Dukhtar is a comprehensive AI-powered pregnancy and women's health assistant that combines user authentication with advanced conversational AI capabilities. The system provides personalized support for expecting mothers through text chat, voice interaction, and medical image analysis.
- Secure user registration and login system
- PostgreSQL database integration
- Session management
- User profile management
- Text Chat: Natural language conversations about pregnancy and women's health
- Voice Input: Speech-to-text with support for English and Urdu
- Voice Output: Text-to-speech responses in multiple languages
- Image Analysis: Medical document and prescription analysis
- Search Integration: Real-time information from trusted medical sources
- Pregnancy anxiety and stress management
- Family planning guidance
- Child spacing advice
- Mental wellbeing support
- Medical document interpretation
- 24/7 availability
- Flask: Web framework
- PostgreSQL: User database
- LangGraph: AI agent orchestration
- LangChain: LLM integration
- OpenAI: GPT-4 and Whisper models
- gTTS: Text-to-speech for Urdu/Hindi
- OpenCV: Image processing
- Tavily: Web search integration
- HTML5/CSS3: Modern responsive design
- JavaScript: Interactive chat interface
- Font Awesome: Icons
- Google Fonts: Typography
-
Clone the repository
git clone <repository-url> cd Dukhtar
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables Create a
.envfile in the root directory:OPENAI_API_KEY=your_openai_api_key TAVILY_API_KEY=your_tavily_api_key DATABASE_URL=your_postgresql_connection_string
-
Set up PostgreSQL database
CREATE TABLE users ( user_id SERIAL PRIMARY KEY, name VARCHAR(100) NOT NULL, email VARCHAR(100) UNIQUE NOT NULL, password_hash VARCHAR(255) NOT NULL, phone VARCHAR(20), number_of_children INTEGER, age_of_last_child INTEGER, current_weight DECIMAL(5,2), ongoing_diseases TEXT, additional_info TEXT, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
-
Configure database connection Update
config.pywith your PostgreSQL credentials:def config(): return { 'host': 'localhost', 'database': 'dukhtar_db', 'user': 'your_username', 'password': 'your_password' }
python app.pyThe application will be available at http://localhost:5000
- Registration/Login: Users must create an account or log in to access AI features
- Home Page: Personalized dashboard showing user-specific content
- Chat Interface: Access the AI assistant through
/chatroute - Features Available:
- Text conversations
- Voice input (English/Urdu)
- Image upload and analysis
- Chat history management
- Export conversations
GET /- Home pageGET /signup- Registration pagePOST /signup- User registrationGET /login- Login pagePOST /login- User authenticationGET /logout- User logout
GET /chat- Chat interfacePOST /api/chat- Text chatPOST /api/process_voice- Voice processingPOST /api/analyze_image- Image analysisPOST /api/clear_history- Clear chat historyGET /api/export_history- Export chat history
- Authentication Required: All AI features require user login
- Session Management: Secure session handling
- Password Hashing: bcrypt password encryption
- Input Validation: Sanitized user inputs
- Error Handling: Comprehensive error management
- Input Languages: English, Urdu, Hindi
- Output Languages: English, Urdu, Hindi
- Auto-detection: Automatic language detection for voice input
- Handwritten prescription reading
- Medical document interpretation
- Multiple preprocessing techniques
- Confidence scoring for accuracy
- Real-time speech recognition
- Multi-language support
- Audio response generation
- Visible audio controls
Dukhtar/
├── app.py # Main Flask application
├── db.py # Database connection
├── config.py # Database configuration
├── requirements.txt # Python dependencies
├── .env # Environment variables
├── templates/
│ ├── index.html # Home page
│ ├── login.html # Login page
│ ├── signup.html # Registration page
│ └── test.html # Chat interface
└── static/ # Static assets
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions, please contact the development team or create an issue in the repository.
- User data is stored securely in PostgreSQL
- Chat conversations are processed through secure APIs
- No personal health information is stored permanently
- Users can export and delete their chat history
Dukhtar - Your compassionate pregnancy and women's health assistant 🤱💕