Skip to content

Evolving Persona AI is a cutting-edge chatbot system that moves beyond simple conversation. It empowers AI with a persistent, dynamic personality that evolves based on user interaction and relationship depth.

License

Notifications You must be signed in to change notification settings

EMMA019/Evo-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Evolving Persona AI - Personality Evolving AI Partner

image image image image image

Python Flask

Developers, researchers, and technical evaluators interested in experimental persona-driven AI systems, HCI studies, and longitudinal interaction research. Not intended for children, etc. use.

Content scope

Experimental conversational personas and behavior-modulation tools. This repository may include examples, demos, and configuration that can produce mature, emotionally charged, or provocative character expressions for research and prototyping. Explicit sexual content, graphic violence, and illegal activities are disabled by default.

Purpose

Research and experimentation only. The project is provided to enable reproducible experiments on persona evolution, long-term memory effects, and interaction dynamics. It is not a consumer product and is not intended for deployment without additional safety, legal, and ethical review.

Overview

"Personality Evolving AI Partner" is an innovative chatbot system where the AI's personality dynamically changes and evolves through conversations with the user. A Flask API backend and modern frontend UI work together to provide an immersive user experience.

Safety & Consent (must-read)

โ€ข Parent/child and workplace usage: parental guidance and organization policies should be considered. โ€ข Sensitive-topic filters automatically trigger safe-response templates (e.g., underage, alcohol+driving, sexual content).

๐ŸŒŸ Key Features

๐ŸŽจ Dynamic UI Themes

  • Complete color themes for 5 personality types (Natural, Tsundere, Yandere, Kuudere, Dandere)
  • Smooth theme transition animations
  • Consistent changes to message bubbles, backgrounds, and text colors

๐Ÿ“Š Real-time Status Display

  • Collapsible status panel
  • Personality tendency radar chart (using Chart.js)
  • Affection level progress bar
  • Long-term memory list display

โœจ Spectacular Evolution Effects

  • Full-screen flash effects
  • Particle animations matching theme colors
  • Evolution announcement in modal window
  • Smooth theme switching

๐Ÿ’ฌ Modern Chat UI

  • Smooth message animations
  • Typing indicator
  • Auto-scroll
  • Responsive design
  • Textarea auto-resize

๐Ÿง  Intelligent AI Integration

  • Integration with Google Gemini AI
  • Single API call for response + personality analysis
  • Long-term memory system (#memory tag)
  • Conversation context maintenance
  • Memory-based evolution system

๐Ÿš€ Instant Demo Experience

  • Demo mode with accelerated evolution
  • Quick start functionality
  • Instant evolution test commands

๐ŸŽฎ Instant Demo Experience

Quick Start

  1. After starting the app, click the "๐Ÿš€ Start Demo Mode" button
  2. Chat 2-3 times to trigger evolution!
  3. Or use "โšก Instant Evolution Test" for immediate evolution

Permanent Demo Mode via Environment Variables

# Set in .env file
DEMO_MODE=true
EVOLUTION_AFFECTION_THRESHOLD=3
EVOLUTION_SCORE_DIFFERENCE=2
Evolution Test Command
Type #evolve_now in chat for instant evolution

๐Ÿ›  Setup Instructions
1. Environment Setup
bash
# Clone repository
git clone < https://github.com/EMMA019/Evo-chat.git >
cd evolving-persona-ai

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt
2. Environment Variable Configuration
bash
# Create .env file
cp .env.example .env

# --- Application Configuration ---
SECRET_KEY=your secret key here

# --- Database Configuration ---
DATABASE_URL=sqlite:///instance/project.db

# --- External Services ---
GEMINI_API_KEY=your GEMINI key here

# --- Evolution Parameters ---
EVOLUTION_AFFECTION_THRESHOLD=30
EVOLUTION_SCORE_DIFFERENCE=5

# --- Application Limits ---
MAX_CHAT_MESSAGES_PER_USER=100
MAX_REQUESTS_PER_MINUTE=60

# --- Demo Mode ---
DEMO_MODE=false
DEMO_EVOLUTION_THRESHOLD=3
DEMO_SCORE_DIFFERENCE=2

# --- Environment ---
FLASK_ENV=development

3. Database Initialization
bash
# Create database and run migrations
flask db upgrade
4. Application Startup
bash
# Start development server
python run.py

# Or use Flask command
flask run
5. Access
Open browser and navigate to http://localhost:5000

๐Ÿ“ Project Structure
text
evolving-persona-ai/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ __init__.py              # Application factory
โ”‚   โ”œโ”€โ”€ extensions.py            # Database extensions
โ”‚   โ”œโ”€โ”€ models.py                # Database models
โ”‚   โ”œโ”€โ”€ api/                     # API endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ””โ”€โ”€ routes.py
โ”‚   โ”œโ”€โ”€ frontend/                # Frontend
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”œโ”€โ”€ routes.py
โ”‚   โ”‚   โ”œโ”€โ”€ templates/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ index.html
โ”‚   โ”‚   โ””โ”€โ”€ static/
โ”‚   โ”‚       โ”œโ”€โ”€ css/
โ”‚   โ”‚       โ”‚   โ””โ”€โ”€ style.css
โ”‚   โ”‚       โ””โ”€โ”€ js/
โ”‚   โ”‚           โ””โ”€โ”€ sw.js
โ”‚   โ”‚           โ””โ”€โ”€ script.js
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ bot/                         # AI logic
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ engine.py               # AI response generation
โ”‚   โ”œโ”€โ”€ evolution.py            # Evolution logic
โ”‚   โ”œโ”€โ”€ memory.py               # Memory management
โ”‚   โ”œโ”€โ”€ memory_analyzer.py      # Memory analysis
โ”‚   โ””โ”€โ”€ prompts.py              # Prompt management
โ”œโ”€โ”€ config.py                   # Configuration management
โ”œโ”€โ”€ run.py                      # Application entry point
โ”œโ”€โ”€ unpacker.py                 # Project unpacking tool
โ”œโ”€โ”€ requirements.txt            # Dependencies
โ”œโ”€โ”€ .env.example               # Environment variable template
โ””โ”€โ”€ tests/                     # Tests
    โ””โ”€โ”€ test_basic.py

๐Ÿ”Œ API Endpoints
POST /api/chat
Send user message and get AI response

json
{
  "message": "Hello!"
}
GET /api/status
Get current user status

POST /api/reset
Reset user data

POST /api/demo/quick-start
Create pre-evolution state for demo mode

๐Ÿ’ก Usage
Start Conversation: Type message in input field and send

Add Memories: Use #memory important information format to add long-term memories

Check Status: Click "Status" button for detailed information

Observe Evolution: Evolution triggers when affection reaches threshold and personality scores have sufficient difference

๐Ÿงฉ Technology Stack
Backend
Flask: Web framework

SQLAlchemy: ORM

Google Gemini AI: AI language model

Flask-Migrate: Database migrations

Frontend
Vanilla JavaScript: Interactive features

CSS3: Modern styling and animations

Chart.js: Radar chart display

Responsive Design: Multi-device support

Security Features
Session fixation attack protection

Rate limiting

Input validation

Secure cookie settings

โš™๏ธ Customization
Evolution Parameter Adjustment
Adjust these parameters in .env file:

bash
EVOLUTION_AFFECTION_THRESHOLD=30      # Affection required for evolution
EVOLUTION_SCORE_DIFFERENCE=5          # Score difference required for evolution
MAX_CHAT_MESSAGES_PER_USER=100        # Message retention per user
Theme Color Changes
Edit CSS variables in app/frontend/static/css/style.css:

css
:root {
  --primary-color: #your-color;
  --background-color: #your-background-color;
  /* Other color variables */
}
Memory Analysis Customization
Edit keyword mappings in bot/memory_analyzer.py to adjust reactions to specific words.

๐Ÿงช Running Tests
bash
# Run tests
pytest tests/

# Detailed test output
pytest tests/ -v
๐Ÿ“„ License
This project is released under the MIT License.

๐Ÿค Contributing
Bug reports, feature requests, and pull requests are welcome.

๐Ÿ”ฎ Future Feature Extensions
Voice recognition & synthesis

Multi-user support

Evolution history visualization

Custom personality type addition

Mobile app support

Cloud storage functionality

# Credits
Original concept and implementation by Emma Saka
GitHub: EMMA019/Evo-chat
=======
# Evo-chat
Evolving Persona AI is a cutting-edge chatbot system that moves beyond simple conversation. It empowers AI with a persistent, dynamic personality that evolves based on user interaction and relationship depth.  
>>>>>>> 2a93dcfce7acae8d43a950db11adb5548a4be359

About

Evolving Persona AI is a cutting-edge chatbot system that moves beyond simple conversation. It empowers AI with a persistent, dynamic personality that evolves based on user interaction and relationship depth.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published