It matters less about where we are, and more about how we move together.
A dynamical-systems framework for studying how relational meaning unfolds in dialogue.
Rather than treating mind as an internal system or reducing cognition to measurable substrates, this project analyses semantic movement and other observable traces as partial expressions of a wider ecology of sense-making. It incorporates the core semantic complexity metrics of Morgoulis (2025) but extends them into a relational phase‑space architecture that supports trajectory analysis, attractor dynamics, and optional semantic–autonomic integration across human–human and human–AI interaction.
This system measures traces of experience.
Semantic metrics are not meaning in themselves. Physiological signals are not feeling. Dynamical signatures are not cognition.
These measurements exist to complement, not replace, the lived, felt, relational nature of mind.
First-person phenomenology and third-person quantification are different ways of knowing the same territory. They must mutually constrain one another. The moment we mistake the map for the territory—reducing experience to its measurable traces—we lose the thing we set out to understand.
Use this framework with that awareness.
This framework treats dialogue as a dynamical system, measuring how meaning moves through semantic space. Three core metrics capture different aspects of coupling quality:
| Metric | Symbol | What It Measures |
|---|---|---|
| Semantic Curvature | Δκ | Trajectory non-linearity (inferential complexity) |
| Fractal Similarity | α | Self-organising patterns via Detrended Fluctuation Analysis (coherence) |
| Entropy Shift | ΔH | Semantic reorganisation (conceptual diversity) |
Extensions in this project add:
- Vector Ψ - 4D phase-space representation (semantic, temporal, affective, biosignal)
- Attractor Basin Detection - 10 canonical dialogue configurations
- Trajectory Dynamics - Velocity, acceleration, curvature of meaning movement
- Real-time Web Application - Live semantic coupling analysis
Most prior work in semantic complexity and dialogue analysis treats conversational embeddings as static sequences, producing scalar descriptors rather than modelling the unfolding relational process. This project reframes those metrics within a relational dynamical‑systems ontology, treating semantic and autonomic trajectories as complementary, partial indicators of an ongoing ecology of sense‑making. The framework supports real‑time analysis of how meaning moves through multi‑dimensional phase‑space across human–human and human–AI interactions without reducing cognition to these signals.
Specifically, this framework introduces:
The core innovation is the construction of a 4D semantic–temporal–affective–biosignal manifold. Scalar metrics from Morgoulis (2025) become state variables, allowing trajectory-based analysis rather than snapshot metrics.
Meaning is treated as motion:
- velocity of semantic change
- acceleration and curvature
- stability and divergence
- local derivatives via windowed buffers
This shifts the epistemic framing from descriptive statistics to differential geometry of meaning-making.
Dialogue is modelled as a dynamical system with identifiable attractors (e.g., generative flow, vigilant engagement, semantic drift). These are defined not only by metric values but by movement patterns in Ψ-space, enabling state-transition analysis.
When integrated with EarthianBioSense, the system supports simultaneous modelling of:
- semantic trajectories in dialogue
- autonomic trajectories (HRV-derived phase space)
This enables the first computational framework capable of joint modelling of semantic and somatic phase-space dynamics within human–AI interaction.
Unlike prior post-hoc analytic approaches, this project supports:
- live state estimation
- streaming trajectory visualization
- attractor detection in real time
This makes the system suitable for empirical research, experimental protocols, and embodied cognition studies involving human–AI coupling and embodied interaction human-to-human.
This project builds beyond Morgoulis’s complexity metrics and constitutes a new methodological frame:
- embeddings become trajectories
- metrics become dynamical substrates
- conversation becomes a phase-space system
- human–AI dialogue becomes a coupled dynamical ecology
Researchers can now interrogate meaning-making, coherence formation, destabilization, and recovery with tools drawn from dynamical systems, cognitive science, and embodied interaction.
git clone https://github.com/m3data/semantic-climate-phase-space.git
cd semantic-climate-phase-space
# Core library only (lightweight)
pip install -r requirements.txt
# Full web application (includes embeddings, API server)
pip install -r semantic_climate_app/requirements.txtCore library (requirements.txt):
- Lightweight install (~50MB)
- Dependencies: numpy, scipy, scikit-learn, pandas
- Optional: vaderSentiment for basic affective substrate
- Optional: transformers for GoEmotions hybrid affective analysis
Web application (semantic_climate_app/requirements.txt):
- PyTorch dependency (~2GB download on first install)
- Embedding model download (~400MB on first run)
- GPU recommended for embedding speed (CPU works but slower)
- Memory: 4GB+ RAM recommended
For local LLM inference via Ollama, additional resources required:
- 7B models: ~8GB RAM/VRAM
- 70B models: ~40GB+ RAM/VRAM (or quantized versions)
from src import SemanticComplexityAnalyzer
import numpy as np
# Initialize analyzer (Morgoulis core metrics)
analyzer = SemanticComplexityAnalyzer()
# Generate embeddings for your dialogue turns
# (use sentence-transformers, OpenAI embeddings, etc.)
embeddings = [np.random.randn(384) for _ in range(20)]
# Calculate all metrics
results = analyzer.calculate_all_metrics(embeddings)
print(f"Semantic Curvature (Δκ): {results['delta_kappa']:.4f}")
print(f"Fractal Similarity (α): {results['alpha']:.4f}")
print(f"Entropy Shift (ΔH): {results['delta_h']:.4f}")
print(f"Complexity Detected: {results['summary']['cognitive_complexity_detected']}")from src import SemanticClimateAnalyzer
import numpy as np
# Extended analyzer with Vector Ψ and attractor detection
analyzer = SemanticClimateAnalyzer()
embeddings = np.array([np.random.randn(384) for _ in range(20)])
turn_texts = ["Hello, how are you?", "I'm doing well, thanks!"] * 10
result = analyzer.compute_coupling_coefficient(
dialogue_embeddings=embeddings,
turn_texts=turn_texts
)
print(f"Coupling Coefficient (Ψ): {result['psi']:.4f}")
print(f"Attractor Basin: {result['attractor_dynamics']['basin']}")
print(f"Confidence: {result['attractor_dynamics']['confidence']:.2%}")from src import semantic_curvature, dfa_alpha, entropy_shift
# Simple function calls without class instantiation
dk = semantic_curvature(embeddings)
alpha = dfa_alpha(similarity_series)
dh = entropy_shift(embeddings)Real-time semantic coupling analysis with multi-provider LLM support.
| Provider | Type | Latency | Setup |
|---|---|---|---|
| Together AI | Cloud | 2-5s | Set TOGETHER_API_KEY env var |
| Ollama | Local | 30-120s | ollama serve + pull model |
| Anthropic | Cloud | 3-8s | Set ANTHROPIC_API_KEY env var |
| OpenAI | Cloud | 3-8s | Set OPENAI_API_KEY env var |
Note: Cloud providers (Together AI recommended) significantly reduce latency confounds in semantic coupling measurements. Local inference via Ollama provides privacy but introduces variable response times.
Create a .env file for API keys:
cp semantic_climate_app/.env.example semantic_climate_app/.envEdit .env with your API keys (at least one provider required):
# Together AI (recommended for research - fast, reduces latency confound)
# Get key: https://api.together.xyz/
TOGETHER_API_KEY=your_key_here
# Anthropic (optional)
# Get key: https://console.anthropic.com/
ANTHROPIC_API_KEY=your_key_here
# OpenAI (optional)
# Get key: https://platform.openai.com/
OPENAI_API_KEY=your_key_here
# Ollama requires no API key - runs locallycd semantic_climate_app
python backend/main.py
# Access at http://127.0.0.1:8000For local-only operation with Ollama (no API keys needed):
ollama serve
ollama pull llama3.2- Multi-provider LLM support with automatic detection
- Live metric gauges (Temperature/Humidity/Pressure metaphor)
- Trajectory-aware coupling mode detection
- Vector Ψ visualization with trajectory sparklines
- Hybrid affective analysis (VADER + GoEmotions)
- Epistemic/safety trajectory visualization with top emotions
- Trajectory integrity scoring (fragmented → living → rigid)
- Session export to JSON
- Optional EarthianBioSense biosignal integration
- Debug timing mode for performance profiling
The framework classifies dialogue into coupling modes based on metric position and trajectory:
| Mode | Δκ | ΔH | Character |
|---|---|---|---|
| Sycophantic | < 0.20 | < 0.08 | Minimal exploration, compliance |
| Contemplative | > 0.70 | < 0.05 | Dense sustained meaning-making |
| Generative | 0.50-0.75 | < 0.08 | Building new conceptual ground |
| Resonant | 0.35-0.65 | 0.08-0.18 | Co-emergent coupling |
| Dialectical | 0.35-0.70 | 0.12-0.25 | Productive tension |
| Emergent | > 0.65 | 0.05-0.12 | Complexity developing |
| Chaotic | high | > 0.25 | Fragmentation |
Trajectory modifiers: -Warming, -Cooling, -Oscillating, -Stable
Important: These are proto-classifications and should be interpreted contextually rather with mutual constraints of first person account and third-person observation.
These proto-classifications represent relational configurations rather than mental contents.
Ten canonical configurations in phase-space:
- Deep Resonance - All substrates high, genuine mutual engagement
- Collaborative Inquiry - Genuine co-exploration with mutual uncertainty
- Cognitive Mimicry - Model performs engagement without genuine uncertainty (risk)
- Reflexive Performance - Model appears to self-examine but pattern-matches
- Sycophantic Convergence - High alignment, low curvature, low affect (risk)
- Creative Dilation - Divergent exploration with high affect
- Generative Conflict - Productive tension, high affect
- Embodied Coherence - Low semantic, high biosignal (body leads)
- Dissociation - All substrates low (risk)
- Transitional - No clear basin, between states
semantic-climate-phase-space/
├── src/
│ ├── core_metrics.py # Morgoulis (2025) - preserved with attribution
│ ├── analyzer.py # SemanticClimateAnalyzer - main orchestrator
│ ├── trajectory.py # TrajectoryBuffer, geometry computations
│ ├── substrates.py # Ψ substrate functions (semantic, temporal, affective, biosignal)
│ ├── basins.py # BasinDetector, BasinHistory, hysteresis-aware detection
│ ├── integrity.py # IntegrityAnalyzer, TransformationDetector
│ ├── api.py # Function-based API for testing
│ └── extensions.py # Legacy monolith (deprecated, use analyzer.py)
├── tests/ # 251 tests
├── semantic_climate_app/ # Real-time web application
│ ├── backend/ # FastAPI + WebSocket + EmotionService
│ └── frontend/ # Vanilla HTML/CSS/JS with trajectory viz
└── docs/ # Additional documentation
# Run all tests
pytest tests/ -v
# Expected: 251 passedThe foundational metrics implementation is by Daria Morgoulis:
- Semantic Curvature (Δκ) algorithm and empirical thresholds
- DFA-based Fractal Similarity (α) with scaling exponent
- Entropy Shift (ΔH) with consensus clustering
- Bootstrap CI methodology
Source: https://github.com/daryamorgoulis/4d-semantic-coupling
The following are original contributions:
- Vector Ψ representation (4D phase-space)
- Attractor basin framework (10 configurations)
- Trajectory dynamics (velocity, acceleration, curvature)
- Substrate computations (temporal, affective, biosignal)
- Semantic Climate web application
- Function-based testing API
If using the core metrics, please cite Morgoulis (2025).
If using the extensions, please cite both:
@software{morgoulis2025semantic,
author = {Morgoulis, Daria},
title = {4D Semantic Coupling Framework},
year = {2025},
url = {https://github.com/daryamorgoulis/4d-semantic-coupling}
}
@software{semanticclimate2025,
author = {Mytka, Mathew},
title = {Semantic Climate Phase Space},
year = {2025},
url = {https://github.com/m3data/semantic-climate-phase-space}
}Extensions (this project): Earthian Stewardship License (ESL-A) - See LICENSE file.
Core metrics (Morgoulis): MIT License - preserved in src/core_metrics.py header.
The ESL-A license permits non-commercial use for research, education, and community projects. Commercial use requires explicit permission. See LICENSE for full terms including stewardship obligations and prohibited uses.
- 4D Semantic Coupling Framework - Original metrics
- EarthianBioSense - Biosignal integration