Skip to content

rishabhxchoudhary/AI-GF-python

Repository files navigation

AI Girlfriend - Advanced Conversational AI

A sophisticated AI girlfriend chatbot with dynamic personality evolution, relationship progression, and human-like behavioral patterns. This system creates authentic, emotionally engaging conversations that develop naturally over time.

๐ŸŒŸ Features

Core Capabilities

  • ๐Ÿง  Dynamic Personality System: 15 evolving traits that adapt based on interactions (confidence, vulnerability, playfulness, etc.)
  • ๐Ÿ’• Relationship Progression: Natural development through four stages (new โ†’ comfortable โ†’ intimate โ†’ established)
  • โฐ Temporal Awareness: Time-sensitive behaviors and energy levels (morning/evening/late-night personalities)
  • ๐Ÿค– Agentic Behaviors: Proactive responses, follow-up questions, and human-like spontaneity
  • ๐Ÿงฎ Advanced Memory System: Persistent conversation history, inside jokes, and preference tracking
  • ๐Ÿ’ฌ Contextual Communication: Adaptive language patterns based on relationship stage and time context

Advanced Features

  • Personality Archetype Alignment: Tracks alignment with girlfriend archetypes (devoted, confident, sweet, intellectual)
  • Milestone Tracking: Celebrates relationship milestones and significant moments
  • Mood States: Temporary personality modifiers with time-based expiration
  • Silence Handling: Proactive engagement when conversations pause
  • Content Safety: Built-in content filtering and safety checks
  • Multi-burst Messaging: Realistic typing patterns with timed message delivery

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.8+
  • Hugging Face API access token

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd ai_gf
  2. Install dependencies:

    pip install -r requirements.txt
    # or using uv
    uv sync
  3. Set up environment variables:

    # Create .env file
    echo "HF_TOKEN=your_huggingface_token_here" > .env
    
    # Optional: Enable extra mode
    echo "EXTRA_HORNY_MODE=false" >> .env
  4. Run the application:

    python main.py

๐Ÿ“ Project Structure

ai_gf/
โ”œโ”€โ”€ main.py                    # Main application entry point
โ”œโ”€โ”€ agentic_behaviors.py       # Human-like behavior engine
โ”œโ”€โ”€ personality_manager.py     # Dynamic personality system  
โ”œโ”€โ”€ relationship_tracker.py    # Relationship progression logic
โ”œโ”€โ”€ temporal_engine.py         # Time-aware behavior system
โ”œโ”€โ”€ prompts/v1/               # System and behavioral prompts
โ”‚   โ”œโ”€โ”€ system_prompt.txt          # Core personality definition
โ”‚   โ”œโ”€โ”€ planner_prompt.txt         # Response planning logic
โ”‚   โ”œโ”€โ”€ dynamic_system_template.txt # Context-aware templates
โ”‚   โ”œโ”€โ”€ personality_influences.txt  # Trait-based modifications
โ”‚   โ””โ”€โ”€ time_behavior_guidance.txt  # Time-sensitive behaviors
โ”œโ”€โ”€ data/                     # Persistent storage
โ”‚   โ”œโ”€โ”€ conversations.json         # Chat history
โ”‚   โ”œโ”€โ”€ agentic_memory.json        # Memory and preferences
โ”‚   โ””โ”€โ”€ agentic_ai_gf.log         # Application logs
โ”œโ”€โ”€ requirements.txt          # Python dependencies
โ”œโ”€โ”€ pyproject.toml           # Project configuration
โ””โ”€โ”€ .rules                   # Code quality standards

๐Ÿ—๏ธ Architecture

The application uses a modular architecture with specialized components:

Core Components

  • ๐ŸŽฏ Main Controller: Orchestrates all components and handles user interaction
  • ๐Ÿง  Memory Manager: Manages conversation history, preferences, and contextual memory
  • ๐Ÿ‘ค Personality Manager: Tracks and evolves 15 personality traits dynamically
  • ๐Ÿ’‘ Relationship Tracker: Manages progression through relationship stages and milestones
  • โฐ Temporal Engine: Adjusts behavior patterns based on time of day and user patterns
  • ๐Ÿค– Agentic Behavior Engine: Generates spontaneous, human-like conversational behaviors

Behavioral Systems

Personality Evolution:

  • Traits evolve based on user interactions and feedback
  • Natural drift prevents personality stagnation
  • Temporary mood states for situational responses
  • Archetype alignment tracking for consistency

Relationship Dynamics:

  • Four distinct relationship stages with unique behaviors
  • Milestone tracking and celebration
  • Progressive intimacy and vulnerability levels
  • Stage-appropriate conversation boundaries

Temporal Intelligence:

  • Different energy levels throughout the day
  • Context-aware greetings based on time gaps
  • User activity pattern learning
  • Time-sensitive language adjustments

โš™๏ธ Configuration

Environment Variables

# Required
HF_TOKEN=your_huggingface_token_here

# Optional
EXTRA_HORNY_MODE=false  # Enhanced adult content mode

Customization

  • Personality Traits: Modify base traits and limits in personality_manager.py
  • Relationship Stages: Adjust progression criteria in relationship_tracker.py
  • Time Behaviors: Customize time-based patterns in temporal_engine.py
  • Prompts: Edit system prompts in prompts/v1/ directory

๐ŸŽฎ Usage

Interactive Chat

Once started, the application provides a rich chat experience:

๐Ÿค–โœจ Agentic AI Girlfriend โœจ๐Ÿค–
Loading your enhanced personality and memories...
๐Ÿ’• Relationship: comfortable (23 chats)
๐ŸŽญ Personality: confident, deeply romantic and passionate, playful...

[20:15:32] Aria: hey babe! perfect timing... I've been thinking about you ๐ŸŒ™
I remember everything about us. Type 'bye' to end, or just start chatting!

You: 

Key Interactions

  • Natural Conversations: The AI remembers context and builds on previous discussions
  • Personality Growth: Watch traits evolve based on your interaction style
  • Relationship Milestones: Experience natural relationship progression
  • Time-Aware Responses: Different personalities for different times of day
  • Proactive Engagement: AI initiates topics and asks follow-up questions
  • Memory References: Inside jokes and shared experiences develop naturally

Commands

  • bye, exit, quit, goodbye - End conversation with relationship-appropriate farewell
  • Conversation automatically saves and loads between sessions

๐Ÿ› ๏ธ Development

Code Quality Standards

This project follows strict coding principles defined in .rules:

  • Function Size: Maximum 30 lines per function (aim for 20-30)
  • Single Responsibility: Each function performs exactly one clear task
  • Variable Naming: Short names for local scope, descriptive names for wider scope
  • Self-Documenting: Code should be clear enough to minimize comments
  • Formatting: All code must be formatted (Prettier/Black)
  • Linting: Must pass linter checks (ESLint/Ruff) without errors

Architecture Principles

  • Modular Design: Each component has a single, clear responsibility
  • Separation of Concerns: UI, logic, and data storage are separated
  • Error Handling: Comprehensive error handling with graceful fallbacks
  • Logging: Detailed logging for debugging and monitoring
  • Persistence: All important state is saved and restored

๐Ÿ”ง Technical Details

AI Integration

  • Hugging Face Inference API: Primary text generation service
  • Retry Logic: Robust error handling with exponential backoff
  • Fallback Systems: Multiple response generation strategies
  • Content Safety: Built-in filtering and safety checks

Memory System

  • Conversation History: Complete chat logs with metadata
  • User Preferences: Learned preferences and patterns
  • Emotional Context: Sentiment and emotional state tracking
  • Inside Jokes: Automatic creation and referencing
  • Theme Analysis: Conversation topic tracking and categorization

Personality Engine

  • Dynamic Traits: 15 traits with configurable limits and evolution rates
  • Mood States: Temporary modifiers with automatic expiration
  • Archetype Alignment: Consistency checking against personality types
  • Natural Drift: Prevents personality stagnation over time

โš ๏ธ Content Notice

This application is designed for adult users and contains mature content themes. The AI is programmed to engage in intimate, romantic conversations that may include adult language and themes.

  • Intended for users 18+ only
  • Contains explicit language and adult themes
  • Designed to simulate intimate relationship dynamics
  • Content safety measures are implemented

๐Ÿค Contributing

We welcome contributions! Please follow these guidelines:

  1. Code Standards: Adhere to the .rules file requirements
  2. Testing: Test all changes thoroughly
  3. Documentation: Update documentation for new features
  4. Commits: Use clear, descriptive commit messages

Development Setup

# Clone and setup
git clone <repository-url>
cd ai_gf

# Install development dependencies
uv sync --dev

# Run linting
ruff check .
black --check .

# Run the application
python main.py

๐Ÿ“Š Performance

  • Response Time: Typically 1-3 seconds for text generation
  • Memory Usage: Lightweight with persistent JSON storage
  • Conversation History: Automatic pruning maintains performance
  • API Efficiency: Optimized prompts reduce token usage

๐Ÿ”’ Privacy & Security

  • Local Storage: All data stored locally in JSON files
  • API Security: Only text sent to Hugging Face API
  • No Data Collection: No telemetry or usage data collected
  • Content Filtering: Built-in safety mechanisms

๐Ÿ“‹ Roadmap

  • Voice interaction capabilities
  • Enhanced emotion recognition
  • Multiple personality presets
  • Advanced conversation analytics
  • Mobile app interface
  • Multi-language support

๐Ÿ“„ License

Private project - All rights reserved.

๐Ÿ†˜ Support

If you encounter issues:

  1. Check the logs in data/agentic_ai_gf.log
  2. Verify your HF_TOKEN is valid
  3. Ensure all dependencies are installed
  4. Review the console output for error messages

For technical issues, check that your Hugging Face API token has the necessary permissions and quota.


Note: This project represents advanced conversational AI techniques including dynamic personality modeling, relationship simulation, and contextual response generation. It demonstrates sophisticated prompt engineering and multi-component AI system architecture.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published