A modern web application built with Django featuring user authentication, real-time chat interface, AI-powered responses with Reinforcement Learning, and a beautiful 3D animated UI.
Created by Noaman Ayub
- LinkedIn: https://www.linkedin.com/in/noamanayub
- GitHub: https://github.com/noamanayub
- Features
- AI & Machine Learning Features
- Tech Stack
- Project Structure
- Installation & Setup
- Database Models
- AI Response System
- Recent Updates & Bug Fixes
- API Endpoints
- Usage
- Testing
- Customization
- Security Considerations
- Troubleshooting
- License
- Support
- User Authentication: Secure registration and login system
- AI-Powered Chat: Intelligent responses using Reinforcement Learning
- Modern UI: 3D animated buttons, responsive design, dark theme
- Chat Interface: Real-time messaging with chat history and session management
- Reinforcement Learning: Adaptive AI that improves responses based on user feedback
- Database Integration: SQLite database for user management and chat storage
- Admin Panel: Django admin interface for user and chat management
- Message Management: Edit, delete, and manage chat messages
- Response Analytics: Track and improve AI response quality
- Reinforcement Learning Service: AI responses improve over time based on user feedback
- Pattern Recognition: Identifies successful response patterns and reuses them
- Contextual Responses: Categorizes user inputs and provides appropriate responses
- Feedback System: Users can rate responses to train the AI model
- Response Templates: Structured templates for different conversation types
- Backend: Django 4.2.7
- Database: SQLite (easily configurable for PostgreSQL/MySQL)
- Frontend: HTML5, CSS3, JavaScript (ES6+)
- Templates: Django template system with inheritance
- Authentication: Django built-in authentication system
- AI/ML: NumPy for machine learning computations
- Reinforcement Learning: Custom RL service for response improvement
CipherDepth/
├── cipherproject/ # Django project configuration
│ ├── settings.py # Main settings
│ ├── urls.py # URL routing
│ └── wsgi.py # WSGI configuration
├── cipherapp/ # Main Django application
│ ├── models.py # Database models (User, Chat, AI models)
│ ├── views.py # View controllers
│ ├── forms.py # Django forms
│ ├── urls.py # App URLs
│ ├── admin.py # Admin configuration
│ ├── rl_service.py # Reinforcement Learning service
│ ├── static/ # Static files (CSS, JS, images)
│ └── templates/ # HTML templates
├── static/ # Collected static files
├── manage.py # Django management script
├── requirements.txt # Python dependencies
├── run_django.bat # Windows startup script
└── test_django.py # Database test script
# Install all required packages including AI/ML dependencies
pip install -r requirements.txt# Create database migrations (includes AI models)
python manage.py makemigrations
# Apply migrations
python manage.py migrate
# Create superuser (optional)
python manage.py createsuperuserpython test_django.pyOption 1: Command Line
python manage.py runserver 8000Option 2: Windows Batch File
run_django.batThe application will be available at: http://localhost:8000
- Extended user information (full name, avatar, theme preference)
- One-to-one relationship with Django User model
- Organizes conversations by user
- Tracks chat titles and timestamps
- Individual messages within chat sessions
- Supports user, bot, and system message types
- Tracks user actions (login, logout, chat activity)
- Includes IP address and user agent for analytics
- Stores user feedback on AI responses (positive/negative)
- Used by Reinforcement Learning system for improvement
- Stores successful response patterns
- Tracks success rates and usage statistics
- Manages AI model versions and parameters
- Tracks accuracy and training metrics
The CipherDepth AI uses a sophisticated Reinforcement Learning system:
- Input Analysis: Categorizes user messages (greeting, technical, creative, etc.)
- Pattern Matching: Finds similar successful responses from history
- Response Generation: Creates appropriate responses using templates or learned patterns
- Feedback Loop: Users can rate responses to improve future interactions
- Continuous Learning: Model adapts and improves based on user feedback
- Fixed: Duplicate greeting responses issue
- Issue: AI was returning "Hello! I'm CipherDepth, your AI assistant created by Noaman Ayub. How can I help you today? Hello! How can I assist you today?"
- Solution: Modified RL service to prevent concatenation of template and base responses for greeting category
- Updated: Enhanced requirements.txt with comprehensive dependencies
- Updated: README.md with detailed AI features and creator information
/- Redirects to login page/login/- User login page/register/- User registration page/logout/- User logout
/home/- Main chat dashboard (requires authentication)/api/chat/- Chat API for sending/receiving messages with AI responses/api/chat/history/- Chat history retrieval/api/edit-message/- Edit chat messages/api/delete-session/- Delete chat sessions
/admin/- Django admin panel for managing users, chats, and AI models
- Navigate to
/register/ - Fill in: Full Name, Username, Email, Password
- Account is created and user is automatically logged in
- Navigate to
/login/ - Enter email and password
- Redirected to chat dashboard
- Click "New Chat" to start a conversation with CipherDepth AI
- Type messages in the input field
- AI responds using advanced Reinforcement Learning
- Rate responses with thumbs up/down to improve AI performance
- Chat history is automatically saved
- Previous chats accessible from sidebar
- Edit or delete messages as needed
- Access
/admin/with superuser credentials - Manage users, chat sessions, and messages
- View AI model performance and feedback
- Monitor response patterns and success rates
- Analyze user activity and engagement
- Configure AI model parameters
A test user has been created for development:
- Email: test@example.com
- Password: testpass123
Edit cipherproject/settings.py or modify CSS variables in styles.css:
:root {
--primary-color: #4fd1c7;
--secondary-color: #3fb8ae;
--background-color: #1a2332;
--surface-color: #0f1419;
}For production, update DATABASES in settings.py:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'cipherdeepth',
'USER': 'your_user',
'PASSWORD': 'your_password',
'HOST': 'localhost',
'PORT': '5432',
}
}- Change
SECRET_KEYin production - Set
DEBUG = Falsein production - Configure
ALLOWED_HOSTSfor your domain - Use HTTPS in production
- Consider rate limiting for chat API
- Implement CSRF protection (already included)
-
Static files not loading
- Run
python manage.py collectstatic - Ensure
STATIC_URLandSTATICFILES_DIRSare configured
- Run
-
Database errors
- Delete
cipherdeepth.dband run migrations again - Check file permissions
- Delete
-
Template not found
- Verify template paths in
TEMPLATESsetting - Ensure templates are in correct directories
- Verify template paths in
- Use
python manage.py shellfor interactive testing - Enable Django debug toolbar for development
- Check
python manage.py checkfor configuration issues
This project is created by Noaman Ayub and is open source. Feel free to modify and distribute.
Creator Contact:
- LinkedIn: https://www.linkedin.com/in/noamanayub
- GitHub: https://github.com/noamanayub
For issues or questions, please check the Django documentation or create an issue in the project repository.
CipherDepth v1.1 - AI-Powered Chat Assistant with Reinforcement Learning