Skip to content

Airam2W/Conceptual-Personality-Builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Conceptual Personality Builder

A sophisticated Python framework for modeling and simulating psychological personality systems. This project enables dynamic personality evolution through event simulation, allowing for realistic modeling of how life experiences shape personality traits and psychological attributes.

🎯 Overview

The Conceptual Personality Builder is designed to provide a comprehensive, extensible system for representing and evolving personality profiles. Whether you're building AI systems, psychological simulations, game character development, or behavioral modeling tools, this framework offers a structured approach to personality representation based on established psychological concepts.

Core Features

  • 11 Interconnected Personality Attributes: Model different psychological dimensions including Character, Emotional Style, Self-Concept, Self-Esteem, Temperament, and more
  • Event-Driven Evolution: Watch personalities evolve realistically through life events across multiple domains (Career, Health, Relationships, etc.)
  • Intelligent Categorization: Events are organized by Valencia (Positive/Negative/Neutral), Domain, and Controllability level
  • Dynamic Event Discovery: Automatically discovers and catalogs all available events in your system
  • Extensible Architecture: Easy to add new events, personality attributes, or psychological dimensions

πŸ’‘ How to Use This Project

This repository is designed to be flexible and open for collaboration:

For Your Own Projects

You can fork or clone this repository and adapt it to your needs:

  • Use the personality system as-is for character development, AI behavior, or simulations
  • Extend personality attributes with your own psychological dimensions
  • Create domain-specific event libraries for your use case
  • Integrate with game engines, chatbots, or behavioral AI systems

For Contribution

If you'd like to contribute and help improve this framework:

  1. Fork the repository and create a branch for your changes
  2. Add new events following the established patterns
  3. Extend personality attributes if needed for your use case
  4. Submit a pull request with clear documentation of your additions

πŸ›  Technologies & Requirements

  • Python 3.9+: Core language for the framework
  • OOP Architecture: Object-oriented design for clean, extensible code
  • No External Dependencies: Uses only Python standard library (importlib, inspect, os)

This lightweight approach ensures maximum portability and minimal setup friction.


πŸ“š Documentation & Recommendations

Project Structure Overview

Conceptual-Personality-Builder/
β”œβ”€β”€ Actions/                           # Event Library (organized by psychology)
β”‚   β”œβ”€β”€ Positive/                      # Valencia: Positive events
β”‚   β”œβ”€β”€ Negative/                      # Valencia: Negative events
β”‚   └── Neutral/                       # Valencia: Neutral events
β”‚       └── DOMAIN/                    # Domain: Career, Health, Relationships, etc.
β”‚           β”œβ”€β”€ eventControllable.py   # Events the person can control
β”‚           β”œβ”€β”€ eventPartiallyControllable.py    # Mixed control events
β”‚           └── eventUncontrollable.py # Events beyond person's control
β”‚
β”œβ”€β”€ PersonalityAtributes/              # Core personality classes
β”‚   β”œβ”€β”€ Character.py                   # How person presents themselves
β”‚   β”œβ”€β”€ EmotionalStyle.py              # Emotional regulation & expression
β”‚   β”œβ”€β”€ SelfConcept.py                 # How person sees themselves
β”‚   β”œβ”€β”€ SelfEsteem.py                  # Self-worth and confidence
β”‚   β”œβ”€β”€ Temperament.py                 # Innate behavioral tendencies
β”‚   β”œβ”€β”€ ThoughtPatterns.py             # Cognitive styles
β”‚   β”œβ”€β”€ Environment.py                 # Adaptability to changes
β”‚   β”œβ”€β”€ HabitualBehavior.py            # Consistency of behaviors
β”‚   β”œβ”€β”€ InternalNeeds.py               # Psychological needs
β”‚   β”œβ”€β”€ LifeExperience.py              # Life events collection
β”‚   β”œβ”€β”€ Motivations.py                 # Drive and goals
β”‚   └── __init__.py
β”‚
β”œβ”€β”€ PersonalityBuilder/                # Aggregator & orchestrator
β”‚   β”œβ”€β”€ PersonalityBuilder.py          # Unified personality management
β”‚   └── __init__.py
β”‚
β”œβ”€β”€ Main/                              # Application entry points
β”‚   β”œβ”€β”€ main.py                        # Core simulation engine
β”‚   β”œβ”€β”€ discover_events.py             # Event exploration tool
β”‚   └── display_person.py              # Personality visualization tool
β”‚
β”œβ”€β”€ Aditional/                         # Supporting classes
β”‚   └── PersonalInformation.py         # Demographic & personal data
β”‚
└── README.md                          # This file

Understanding Event Organization

Events are organized using a 4-dimensional taxonomy:

1. Valencia (Emotional Quality)

  • Positive: Events with beneficial outcomes
  • Negative: Events with harmful or stressful outcomes
  • Neutral: Events with mixed or ambiguous valence

2. Domain (Life Area - 10 Categories)

  • CAREER: Job, profession, work achievements, unemployment
  • HEALTH: Physical/mental health, illness, fitness, medical events
  • RELATIONSHIPS: Romance, family, friendships, social connections
  • TRAUMA: Abuse, loss, severe stress, PTSD triggers
  • PERSONAL_GROWTH: Learning, skill development, self-improvement
  • FINANCIAL: Money, poverty, wealth, economic changes
  • SOCIAL: Community, status, social acceptance/rejection
  • EXISTENTIAL: Meaning, purpose, mortality, philosophy
  • LEGAL: Crime, justice, legal matters
  • EDUCATIONAL: School, learning outcomes, academic achievement

3. Controllability (Agency Level)

  • eventControllable.py: Person directly caused/controlled this (their choice, effort, action)
  • eventPartiallyControllable.py: Mixed agency (person participated, but others had decision power)
  • eventUncontrollable.py: Happened to person (luck, circumstances, others' decisions)

4. Duration (Temporal Scope - Organization Comments)

Within each .py file, events are organized by duration comments:

  • # ACUTE: Single, time-limited event (e.g., job interview, injury, argument)
  • # CHRONIC: Ongoing, persistent condition (e.g., chronic illness, ongoing conflict)
  • # RECURRENT: Repeating pattern across time (e.g., seasonal depression, repeated rejections)
  • # EPISODIC: Multiple discrete instances of similar events (e.g., multiple achievements)

Example Path: Actions/Negative/HEALTH/eventUncontrollable.py β†’ ACUTE section

  • Meaning: A negative, health-related event beyond person's control, happening suddenly

How Events Modify Personality

Each event function follows a consistent, proven pattern:

def CompletedProfessionalCertification(personality_builder):
    """
    -Event Description: Person completed a professional certification  through dedicated effort
    
    -Controllability: This is controllable because the person chose to pursue it, invested time,
    studied, and took the examination themselves. Their agency was direct.
    
    -Psychological Impact: This positive controllable event boosts self-efficacy, demonstrates
    achievement capability, and strengthens career-focused self-esteem. The person recognizes
    their capacity to accomplish challenging goals through effort.
    """
    
    # 1. GET CURRENT VALUES
    current_self_efficacy = personality_builder.self_esteem.general_self_efficacy
    current_achievement_motivation = personality_builder.motivations.achievement_motivation
    current_academic_self_esteem = personality_builder.self_esteem.academic_professional_self_esteem
    current_global_self_esteem = personality_builder.self_esteem.global_self_esteem
    
    # 2. CALCULATE NEW VALUES (with validation: min 0, max 100)
    new_self_efficacy = min(100, current_self_efficacy + 8)
    new_achievement_motivation = min(100, current_achievement_motivation + 6)
    new_academic_self_esteem = min(100, current_academic_self_esteem + 10)
    new_global_self_esteem = min(100, current_global_self_esteem + 5)
    
    # 3. PRINT BEFORE STATE
    print("[Before Event]")
    print(f"  General Self-Efficacy: {current_self_efficacy}")
    print(f"  Achievement Motivation: {current_achievement_motivation}")
    print(f"  Academic/Professional Self-Esteem: {current_academic_self_esteem}")
    print(f"  Global Self-Esteem: {current_global_self_esteem}")
    
    # 4. APPLY CHANGES using setter methods
    personality_builder.self_esteem.set_general_self_efficacy(new_self_efficacy)
    personality_builder.motivations.set_achievement_motivation(new_achievement_motivation)
    personality_builder.self_esteem.set_academic_professional_self_esteem(new_academic_self_esteem)
    personality_builder.self_esteem.set_global_self_esteem(new_global_self_esteem)
    
    # 5. UPDATE LIFE EXPERIENCE
    personality_builder.life_experience.add_major_achievement("Professional Certification Completed")
    personality_builder.life_experience.add_positive_experience("Career milestone achieved through personal effort")
    
    # 6. PRINT AFTER STATE with deltas
    print("\n[After Event]")
    print(f"  General Self-Efficacy: {new_self_efficacy} (+{new_self_efficacy - current_self_efficacy:.2f})")
    print(f"  Achievement Motivation: {new_achievement_motivation} (+{new_achievement_motivation - current_achievement_motivation:.2f})")
    print(f"  Academic/Professional Self-Esteem: {new_academic_self_esteem} (+{new_academic_self_esteem - current_academic_self_esteem:.2f})")
    print(f"  Global Self-Esteem: {new_global_self_esteem} (+{new_global_self_esteem - current_global_self_esteem:.2f})")
    
    # 7. PRINT PERSONALITY EVOLUTION NARRATIVE (3-4 sentences)
    print("\n[Personality Evolution]")
    print("The person experiences a significant boost in self-efficacy and achievement motivation.")
    print("Their academic/professional self-esteem increases substantially, as they've proven their capacity")
    print("to master complex material and achieve demanding goals. This success ripples into broader")
    print("self-esteem improvements, strengthening their global sense of competence and self-worth.")

Key Principles:

  • Always validate values: min(100, max(0, value)) to keep within 0-100 range
  • Use {delta:.2f} for formatting deltas to 2 decimal places
  • Print before/after/evolution for immediate feedback and debugging
  • Use + for positive deltas, - is automatic for negative
  • Write evolution narrative in clear, psychological language (3-4 sentences)

Example Events Included

Three exemplar events are included demonstrating each controllability level (found in Actions/Positive/CAREER/):

1. CompletedProfessionalCertification

  • File: eventControllable.py | Duration: ACUTE
  • Scenario: Person completed a professional certification through their own effort
  • Controllability: Fully controllableβ€”they chose to pursue it
  • Attributes Modified: 4 (Self-Efficacy, Achievement Motivation, Academic/Professional Self-Esteem, Global Self-Esteem)
  • Key Insight: Shows how achievement builds confidence and career-focused identity

2. PromotionAfterApplication

  • File: eventPartiallyControllable.py | Duration: ACUTE
  • Scenario: Person applied for promotion and was selected by management
  • Controllability: Partially controllableβ€”they prepared and applied, but others made final decision
  • Attributes Modified: 5 (Locus of Control moves toward balanced internal/external)
  • Key Insight: Demonstrates realistic psychological response to external validation of effort

3. UnexpectedlyOfferedDreamJob

  • File: eventUncontrollable.py | Duration: ACUTE
  • Scenario: Person unexpectedly offered their dream job without applying
  • Controllability: Uncontrollableβ€”pure luck, timing, or external circumstances
  • Attributes Modified: 7 (Major boost but includes imposter syndrome warning)
  • Key Insight: Shows how external agency events create different psychological responses, including potential negative feelings despite positive outcome

All three examples use consistent patterns and are fully functionalβ€”run them directly in Main/main.py.

Working with PersonalityBuilder

from PersonalityBuilder.PersonalityBuilder import PersonalityBuilder
from Aditional.PersonalInformation import PersonalInformation

# Step 1: Create person with demographic information
info = PersonalInformation(
    name="Alice",
    age=28,
    gender="Female",
    occupation="Software Engineer"
)
person = PersonalityBuilder(info)

# Step 2: Display current personality state
person.describe()

# Step 3: Discover available events
person.discover_available_events()

# Step 4: Apply an event and observe evolution
from Actions.Positive.CAREER.eventControllable import CompletedProfessionalCertification
CompletedProfessionalCertification(person)

# Step 5: Check changes in personality
print(f"New Self-Efficacy: {person.self_esteem.general_self_efficacy}")
print(f"Achievement History: {person.life_experience.major_achievements}")

# Step 6: Apply multiple events in sequence
from Actions.Positive.CAREER.eventPartiallyControllable import PromotionAfterApplication
PromotionAfterApplication(person)

Helper Tools

discover_events.py - Event Exploration

A standalone script that displays all available events organized hierarchically:

[AVAILABLE EVENTS IN SYSTEM]

[Positive > CAREER > eventControllable.py]
   > CompletedProfessionalCertification()

[Positive > CAREER > eventPartiallyControllable.py]
   > PromotionAfterApplication()

[Positive > CAREER > eventUncontrollable.py]
   > UnexpectedlyOfferedDreamJob()

Usage:

python Main/discover_events.py

display_person.py - Personality Visualization

Utility to inspect complete current state of a personality:

python Main/display_person.py

Displays:

  • Personal demographic information (name, age, gender, occupation)
  • All 11 personality attributes with current values (0-100)
  • Life experience records (achievements, traumas, positive/negative experiences)
  • Easy reference for personality debugging

main.py - Core Simulation

The main orchestrator that:

  1. Creates a person with initial personality
  2. Initializes all personality attributes
  3. Shows available events
  4. Displays current personality state
  5. Simulates event application
  6. Demonstrates personality evolution

🎨 Writing Your Own Events

Step-by-Step Guide

1. Choose the Correct Location

Actions/
  [Valencia - Positive/Negative/Neutral]/
    [Domain - CAREER/HEALTH/RELATIONSHIPS/etc]/
      [Controllability - eventControllable/eventPartiallyControllable/eventUncontrollable].py

Choose the file that matches your event's characteristics.

2. Follow the Docstring Format (Required for event discovery)

def YourEventName(personality_builder):
    """
    -Event Description: Clear explanation of what is happening to the person
    
    -Controllability: Explain why this event fits this controllability level for the person
    
    -Psychological Impact: Describe which psychological attributes change and why (2-3 sentences)
    """

3. Implement Following the Pattern

# Get current values
current_value = personality_builder.attribute_class.attribute_name

# Calculate new values (validate!)
new_value = min(100, max(0, current_value + delta))

# Print before
print(f"[Before] Attribute: {current_value}")

# Apply changes
personality_builder.attribute_class.set_attribute_name(new_value)

# Update life experience
personality_builder.life_experience.add_major_achievement("Description")

# Print after with delta
print(f"[After] Attribute: {new_value} (+{new_value - current_value:.2f})")

# Print evolution narrative (3-4 sentences)
print("[Personality Evolution] Description of psychological change...")

4. Magnitude Guidelines (Recommended delta ranges)

  • Small events: Β±2 to Β±5 points (e.g., minor criticism, small success)
  • Medium events: Β±6 to Β±10 points (e.g., job loss, relationship improvement)
  • Major life events: Β±11 to Β±15 points (e.g., marriage, serious illness)
  • Extreme events: Up to Β±20 points (e.g., trauma, life-changing achievement)
  • Never exceed Β±20 points in a single event for realistic evolution

5. Test Your Event

from Actions.Negative.HEALTH.eventUncontrollable import YourEventName
person = PersonalityBuilder(PersonalInformation("Test", 30, "M", "Tester"))
YourEventName(person)

6. Commit Pattern (What variables to modify) Different events naturally modify different attributes:

Event Type Likely Attributes
Success/Achievement Self-Efficacy, Self-Esteem, Motivations, Achievement Motivation
Failure/Rejection Self-Esteem, Self-Concept, Motivations, Thought Patterns
Social Events Emotional Style, Character, Temperament
Health Events Temperament, Thought Patterns, Internal Needs
Trauma All attributes can be impacted (Β±15-20)

πŸ“– Personality Attributes Reference

All attributes use a 0-100 scale with semantic interpretations:

1. Character

  • Represents moral consistency, integrity, and authenticity
  • High (70-100): Principled, reliable, morally consistent
  • Mid (40-60): Mixed morality, situational ethics
  • Low (0-30): Unreliable, unprincipled, deceptive

2. Emotional Style

  • Represents emotional regulation and expressiveness
  • High (70-100): Emotionally controlled, stable, composed
  • Mid (40-60): Moderate emotional expression
  • Low (0-30): Emotionally volatile, reactive, overwhelmed

3. Self-Concept

  • How the person understands their own identity
  • High (70-100): Clear self-understanding, coherent identity
  • Mid (40-60): Somewhat confused identity, developing self-awareness
  • Low (0-30): Identity confusion, unclear self-image

4. Self-Esteem

  • Contains multiple sub-dimensions of self-worth
  • General Self-Efficacy: Belief in ability to handle challenges
  • Global Self-Esteem: Overall self-worth
  • Academic/Professional Self-Esteem: Career-specific confidence
  • Social Self-Esteem: Confidence in social situations

5. Temperament

  • Innate emotional reactivity and behavioral persistence
  • High (70-100): Calm, persistent, steady responses
  • Mid (40-60): Moderate reactivity and persistence
  • Low (0-30): Highly reactive, easily discouraged

6. Thought Patterns

  • Cognitive style and processing preferences
  • High (70-100): Analytical, logical, systematic thinking
  • Low (0-30): Intuitive, creative, holistic thinking
  • Used to model cognitive approaches to problems

7. Environment

  • Adaptability and comfort with environmental changes
  • High (70-100): Adaptable, comfortable with change
  • Low (0-30): Rigid, uncomfortable with new situations

8. Habitual Behavior

  • Consistency and automaticity of daily behaviors
  • High (70-100): Routine-oriented, consistent habits
  • Low (0-30): Spontaneous, inconsistent behavior

9. Internal Needs

  • Psychological motivations and needs (Maslow-inspired)
  • High (70-100): Strong intrinsic motivation
  • Low (0-30): Struggling with basic needs

10. Life Experience

  • Collection of major achievements, traumas, and experiences
  • Not a 0-100 scale but a repository
  • Lists: major_achievements, traumas, positive_experiences, negative_experiences

11. Motivations

  • Goal orientation and drive
  • Achievement Motivation: Drive to succeed
  • Growth Motivation: Desire to develop
  • Social Motivation: Desire for connection

πŸš€ Getting Started

Installation

# Clone the repository
git clone https://github.com/Airam21170247/Conceptual-Personality-Builder.git

# Navigate to project directory
cd Conceptual-Personality-Builder

# Verify Python installation
python --version  # Should be 3.9 or higher

# Run the main simulation
python Main/main.py

# Explore available events
python Main/discover_events.py

# View person's personality state
python Main/display_person.py

Basic Quickstart Example

# Create a personality-driven character
from PersonalityBuilder.PersonalityBuilder import PersonalityBuilder
from Aditional.PersonalInformation import PersonalInformation

# Initialize
person = PersonalityBuilder(PersonalInformation("Sarah", 25, "Female", "Designer"))

# View initial state
print("=== Initial Personality ===")
person.describe()

# Simulate a positive career event
from Actions.Positive.CAREER.eventControllable import CompletedProfessionalCertification
print("\n=== Event: Professional Certification ===")
CompletedProfessionalCertification(person)

# View evolved state
print("\n=== Updated Personality ===")
person.describe()

# Check specific attributes
print(f"\nGeneral Self-Efficacy: {person.self_esteem.general_self_efficacy}/100")
print(f"Achievements: {person.life_experience.major_achievements}")

πŸŽ“ Advanced Usage

Creating Event Chains

# Apply multiple events in sequence to see compound effects
from Actions.Positive.CAREER.eventControllable import CompletedProfessionalCertification
from Actions.Positive.CAREER.eventPartiallyControllable import PromotionAfterApplication

CompletedProfessionalCertification(person)
PromotionAfterApplication(person)

# Observe cumulative personality evolution
print(f"Final Self-Efficacy: {person.self_esteem.general_self_efficacy}")

Analyzing Personality State

# Snapshot personality at different time points
initial_state = {
    'self_efficacy': person.self_esteem.general_self_efficacy,
    'achievement': person.motivations.achievement_motivation,
    'experiences': len(person.life_experience.positive_experiences)
}

# Apply events...

final_state = {...}

# Compare changes
print(f"Self-Efficacy change: {final_state['self_efficacy'] - initial_state['self_efficacy']}")

Integration with External Systems

This framework can be integrated into:

  • Game engines (character personality-based decision making)
  • Chatbots (personality-consistent responses)
  • AI systems (behavioral modeling)
  • Simulations (social dynamics, psychology research)
  • Educational tools (psychology teaching, behavioral training)

🌱 Future Directions

Planned Expansions

  • Personality Interactions: Model how one attribute influences another over time (e.g., trauma reduces self-esteem, which increases social anxiety)
  • Event Chains: Create dependencies where event A makes event B more/less likely
  • Statistical Analysis: Track personality statistics across event sequences
  • Visualization: Graph personality evolution over time
  • Narrative Generation: Automatically create story text describing personality change
  • Multiplayer Dynamics: Model personality changes in relationships with other personalities
  • Decision Trees: Make future events depend on current personality state
  • Extended Domains: Add more specific event categories based on use case

Contributing

Interested in contributing? Consider:

  1. Adding Events: Create CHRONIC, RECURRENT, or EPISODIC examples in existing domains
  2. New Domains: Propose additional life domains beyond the current 10
  3. Personality Metrics: Add derived metrics (e.g., emotional resilience = self_esteem + temperament)
  4. Event Libraries: Build domain-specific event sets (e.g., "Medical Events", "Academic Events")
  5. Integrations: Connect with external APIs or systems
  6. Tools: Build utilities for visualization, analysis, or event creation
  7. Documentation: Improve examples and documentation for specific use cases

To contribute:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature
  3. Make your changes following the established patterns
  4. Test thoroughly
  5. Commit with clear messages: git commit -m "Add X events for Y domain"
  6. Push to your fork: git push origin feature/your-feature
  7. Submit a pull request with description of your contribution

πŸ“ License & Attribution

This project is open source and available for personal and commercial use. Attribution is appreciated but not required.

Citation (if used in research or academic work):

Conceptual Personality Builder - A Python Framework for Dynamic Personality Simulation
https://github.com/Airam21170247/Conceptual-Personality-Builder

πŸ’‘ FAQ

Q: Can I use this for game character development?
A: Absolutely! The personality evolution system creates realistic character arcs based on in-game events.

Q: Is this based on real psychology?
A: The framework uses established psychological concepts (self-efficacy theory, locus of control, personality models) but is a simplified computational model for simulation purposes.

Q: How many events can I add?
A: No limit. The system dynamically discovers all events. Scale as needed for your use case.

Q: Can I modify existing personality attributes?
A: Yes. Each attribute class uses setter methods for validation. You can extend or customize.

Q: What Python versions are supported?
A: Python 3.9 and above.


πŸ“ž Questions or Issues?

For questions, issues, or suggestions:

  • Review the example events in Actions/Positive/CAREER/ for implementation patterns
  • Check individual PersonalityAttribute classes for available methods
  • Examine PersonalityBuilder.py to understand the aggregation system
  • Run discover_events.py to see your event catalog

Version: 1.0
Last Updated: December 2025
Python Version: 3.9+
Status: Active Development

About

A sophisticated Python framework for modeling and simulating psychological personality systems. This project enables dynamic personality evolution through event simulation, allowing for realistic modeling of how life experiences shape personality traits and psychological attributes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages