The Environmental Stimuli System is a groundbreaking feature that connects The Cognisphere to real-world data, allowing the digital civilization to evolve based on actual events, trends, and patterns from our reality.
This system creates a living bridge between reality and simulation, where:
- Real-world data is continuously ingested from multiple sources
- Environmental stimuli are processed and analyzed for cultural impact
- Cultural mirroring makes the civilization initially reflect reality (70% mirroring factor)
- Divergence mechanics gradually evolve the culture into a "future version" (1% divergence rate per stimulus)
The system fetches real-world data from multiple sources:
- RSS Feeds: BBC Technology, Science, Business, Entertainment, CNN Technology
- News APIs: Technology, science, business, entertainment, health news
- Weather Data: Current weather conditions affecting social behavior
- Social Media: Trends and cultural movements (extensible)
Each piece of real-world data becomes an EnvironmentalStimulus with:
- Sentiment Analysis: Positive/negative emotional impact (-1.0 to 1.0)
- Intensity Levels: Low, Medium, High, Critical based on content analysis
- Impact Scores: Cultural, Economic, and Social impact calculations
- Keywords: Extracted meaningful terms that influence agent vocabulary
The system implements sophisticated cultural evolution mechanics:
- 70% Mirroring Factor: Culture initially mirrors real-world patterns
- Agents adopt vocabulary, behaviors, and preferences from reality
- Social norms and economic patterns reflect current world trends
- 1% Divergence Rate: Each stimulus introduces small variations
- Culture gradually evolves beyond current reality
- Creates a "future version" of human civilization
- Agents develop novel concepts, behaviors, and social structures
GET /stimuli/statusReturns the current status of the environmental stimuli system, including:
- Active stimuli count
- Cultural mirroring factor
- Divergence rate
- Historical data summary
GET /stimuli/activeReturns all currently active environmental stimuli with:
- Stimulus details (title, content, source)
- Sentiment and intensity scores
- Impact measurements
- Keywords and timestamps
GET /stimuli/by-type/{stimulus_type}Filter stimuli by type:
news- General news articlestechnological- Technology-related contentscientific- Science and researcheconomic- Business and economycultural- Arts, entertainment, cultureweather- Weather conditionssocial_media- Social media trends
POST /stimuli/fetchManually trigger fetching of new environmental stimuli from all sources.
GET /stimuli/divergenceGet detailed analysis of cultural divergence from reality, including:
- Mirroring factor percentage
- Divergence rate
- Reality baseline patterns
- Future projection insights
The Environmental Stimuli Dashboard provides:
- Live feed of incoming stimuli
- Sentiment analysis visualization
- Impact score tracking
- Cultural evolution metrics
- Filter by stimulus type
- Sort by intensity, sentiment, or timestamp
- Keyword analysis
- Historical trends
- Mirroring factor display
- Divergence rate tracking
- Reality baseline comparison
- Future projection insights
Add new data sources by extending the DataSource class:
class CustomSource(DataSource):
def __init__(self, name: str, enabled: bool = True):
super().__init__(name, enabled)
async def fetch_data(self) -> List[EnvironmentalStimulus]:
# Implement data fetching logic
passAdd new stimulus types by extending StimulusType enum:
class StimulusType(Enum):
NEWS = "news"
CUSTOM_TYPE = "custom_type"Adjust cultural evolution parameters:
manager = EnvironmentalStimuliManager()
manager.cultural_mirroring_factor = 0.8 # 80% mirroring
manager.divergence_rate = 0.02 # 2% divergence rate- Personality Evolution: Agents' personalities shift based on stimuli
- Vocabulary Growth: New words and concepts enter agent language
- Social Dynamics: Cooperation and trading behaviors adapt to real-world patterns
- Cultural Preferences: Agents develop preferences based on environmental influences
- Market Sentiment: Economic stimuli affect trading willingness
- Resource Preferences: Agents adapt resource priorities based on real-world trends
- Innovation Patterns: Technology stimuli drive innovation in the simulation
- Alliance Formation: Social stimuli influence cooperation patterns
- Cultural Norms: Real-world events shape emerging social norms
- Institution Development: Agents create institutions reflecting real-world patterns
- Machine Learning Integration: AI-powered sentiment analysis and trend prediction
- Social Media APIs: Direct integration with Twitter, Reddit, and other platforms
- Economic Data: Real-time stock market and economic indicator integration
- Scientific Papers: Integration with arXiv and other research databases
- Cultural Events: Calendar integration for festivals, holidays, and cultural events
- Predictive Modeling: Forecast cultural evolution trends
- Reality Comparison: Compare simulation outcomes with real-world predictions
- Anomaly Detection: Identify when simulation diverges significantly from reality
- Cultural Mapping: Visualize the evolution from reality to future civilization
from simulation.environmental_stimuli import create_default_stimuli_manager
# Create stimuli manager with default sources
manager = create_default_stimuli_manager()
# Fetch stimuli
stimuli = await manager.fetch_all_stimuli()from simulation.environmental_stimuli import EnvironmentalStimuliManager, NewsAPISource
# Create custom manager
manager = EnvironmentalStimuliManager()
# Add custom news source
news_source = NewsAPISource(api_key="your_api_key")
manager.add_source(news_source)
# Adjust cultural parameters
manager.cultural_mirroring_factor = 0.6 # 60% mirroring
manager.divergence_rate = 0.015 # 1.5% divergence rate# Environmental stimuli are automatically applied every 10 ticks
# Access stimuli status through the simulation engine
status = simulation_engine.get_environmental_stimuli_status()The system provides comprehensive logging for:
- Data source fetch operations
- Stimulus processing and analysis
- Cultural impact calculations
- Divergence measurements
Track key metrics:
- Stimuli fetch rate and success rate
- Cultural mirroring accuracy
- Divergence progression
- Agent behavior changes
Monitor system health:
- Data source availability
- Processing performance
- Memory usage
- Error rates
The Environmental Stimuli System transforms The Cognisphere from a closed simulation into a living, breathing digital civilization that:
- Starts grounded in reality through cultural mirroring
- Evolves organically through environmental influences
- Develops unique characteristics through divergence mechanics
- Creates a future version of human civilization
This creates an unprecedented opportunity to study how real-world events shape cultural evolution and to explore what human civilization might become in the future.
The system is designed to be extensible, allowing researchers and developers to add new data sources, adjust cultural parameters, and explore different scenarios of civilizational evolution.