10BC0 GitHub - Howtoimagine/the_kaleidoscope: Kaleidoscope is an experimental cognitive architecture for emergent intelligence. It uses an E8 lattice physics engine and an RL-steered LLM to autonomously generate novel theories about complex systems. Features a visualization hub of its internal thought-space.
[go: up one dir, main page]

Skip to content

Kaleidoscope is an experimental cognitive architecture for emergent intelligence. It uses an E8 lattice physics engine and an RL-steered LLM to autonomously generate novel theories about complex systems. Features a visualization hub of its internal thought-space.

License

Notifications You must be signed in to change notification settings

Howtoimagine/the_kaleidoscope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

K banner

The Kaleidoscope: E8-Based Cognitive Architecture v.M25.1

A Comprehensive Technical Analysis

This is a large-scale experimental AI system exploring novel approaches to artificial intelligence through mathematical physics and geometric principles. The system uses the E8 Lie group structure as its foundational organizing principle for information processing and memory management.

Mathematical Foundations

E8_Coxeter

E8 Lie Group Structure

Conceptual Metaphor: Imagine the E8 structure as the ultimate "crystal of thought" - a 248-dimensional snowflake where every possible symmetry and rotation preserves its fundamental shape. Just as a physical crystal has specific angles and distances between atoms that define its properties, E8 provides a rigid mathematical scaffolding where concepts can be arranged in the most symmetrical way possible. When a new idea enters the system, it finds its natural position in this crystal lattice based on its relationships to existing concepts, like a water molecule finding its place in an ice crystal.

The system is built on the exceptional Lie group E8, which has:

  • 248 dimensions total
  • 240 root vectors forming the basis
  • Each root vector satisfies: ||r||² = 2
  • Root vectors must satisfy the Cartan matrix relations

The root generation follows:

# Generate 112 roots of form (±1, ±1, 0, 0, 0, 0, 0, 0) with even number of ±1
# Generate 128 roots of form (±½, ±½, ±½, ±½, ±½, ±½, ±½, ±½) with even number of -½

Golden Ratio (φ) Integration

Conceptual Metaphor: The golden ratio appears throughout nature in spirals - from nautilus shells to galaxies. Here, it governs how memories "spiral through time," creating self-similar patterns at every scale. Like how a fern's smallest frond mirrors the shape of the entire plant, memories decay and strengthen following golden ratio spirals. This creates natural harmonics where certain time intervals resonate more strongly, similar to how musical notes in golden ratio frequencies create pleasing harmonies.

The system uses log-periodic functions based on the golden ratio:

φ = (1 + √5) / 2 ≈ 1.618033988749895
ω_φ = 2π / ln(φ)

P(k) = P₀ × φ^(-k/16) × (1 + A×cos(ω_φ×ln(k) + φ₀))

This creates self-similar scaling patterns used for:

  • Memory decay rates
  • Activation thresholds
  • Field strength modulation

Projection Operations

20-Group-forming-1024x199

E8 Projection (8D)

Conceptual Metaphor: Think of this like casting shadows - when you hold your hand up to a light, the 3D hand creates a 2D shadow on the wall. Similarly, complex 1536-dimensional thoughts cast "shadows" into 8 dimensions that preserve their essential shape. The E8 projection finds the angle that creates the most informative shadow, capturing the core essence while discarding redundant details, like how a profile silhouette can identify a person despite losing depth information.

M25_project(x, k=8):
    # Projects high-dimensional vector to k dimensions
    # Uses PCA-like reduction: x[:k] with normalization
    return normalize(x[:k])

Leech Lattice (24D)

Conceptual Metaphor: The Leech lattice is like the ultimate warehouse storage system - it packs spheres (concepts) in 24 dimensions with zero wasted space, each sphere kissing exactly 196,560 neighbors. It's paired with the Golay code, which acts like a cosmic error-correction system that can fix any damaged memory by checking its "parity bits." When memories get corrupted or fuzzy, the Leech lattice structure helps snap them back to the nearest valid configuration, like how auto-correct fixes typos by finding the nearest valid word.

The Leech lattice provides optimal 24-dimensional sphere packing:

M25_nearest_leech(z24):
    # Golay code G24 for error correction
    # Syndrome decoding: s = H × v^T mod 2
    # Returns (index, corrected_vector, residual)

Quasicrystal Dictionary

Conceptual Metaphor: Unlike regular crystals that repeat predictably, quasicrystals create patterns that never repeat yet follow strict rules - like Penrose tiles that can cover an infinite floor without ever creating the same local pattern twice. This "dictionary" creates a conceptual landscape where no two regions are identical, forcing the system to always find novel connections. It's like having an infinite library where books are arranged by a pattern you can sense but never fully predict, ensuring serendipitous discoveries.

Creates aperiodic patterns for novel associations:

M27_make_quasicrystal_dict(D, m, seed):
    # Generates m points in D dimensions
    # Uses golden ratio projections
    # Creates Penrose-like tiling in high dimensions

Core Architecture Components

CQC-subspaces-redone-1024x216

1. Memory Management System

Conceptual Metaphor: The memory system works like a cosmic filing system with Russian nesting dolls. Raw experiences enter as rich 1536-dimensional "photographs," which get progressively compressed into simpler "sketches" at different resolutions (8D, 16D, 32D, etc.). Each shell holds memories of different complexity - simple concepts live in small shells, complex ideas need larger spaces. The system builds bridges (edges) between related memories using both obvious connections (k-nearest neighbors) and surprising ones (quasicrystal patterns), creating a web where thoughts can flow along multiple paths.

Hierarchical Storage

  • Primary Storage: 1536-dimensional embeddings
  • E8 Projection: 8-dimensional compressed representation
  • Dimensional Shells: {8, 16, 32, 64, 128, 248} dimensions
  • KD-Tree Indexing: Fast nearest-neighbor queries

Memory Operations

async def add_entry(entry_data, parent_ids, target_shells):
    # 1. Generate/retrieve embedding vector
    # 2. Project to E8 basis
    # 3. Assign to dimensional shells based on complexity
    # 4. Create graph edges (k-NN + quasicrystal)
    # 5. Update temperature and potential fields

2. Field Dynamics System

The system implements three fundamental fields:

Gravitational Field (Semantic Attraction)

Conceptual Metaphor: Just as mass warps spacetime creating gravity that pulls objects together, semantic meaning creates a conceptual gravity where related ideas naturally drift toward each other. A concept about "dogs" creates a gravitational well that attracts "puppies," "barking," and "loyalty." The field equation is solved by iteratively relaxing the potential surface, like smoothing a rumpled bedsheet until it finds its natural shape. Strong semantic clusters become like conceptual black holes, pulling in related thoughts.

∇²Φ = 4πGρ

Where:

  • Φ = gravitational potential
  • ρ = semantic density
  • G = coupling constant (default: 0.05)

Solved using Conjugate Gradient method every 25 steps.

Strong Field (Concept Binding)

Conceptual Metaphor: Like the strong nuclear force that binds quarks into protons despite their desire to fly apart, this field binds related concepts into stable "molecules of meaning." The force is incredibly strong at short range (highly related concepts) but drops off exponentially, creating tightly bound conceptual clusters. When you think "apple," the strong field ensures "red," "fruit," and "sweet" stay bound together as a coherent concept rather than dispersing into unrelated thoughts.

V(r) = -κ/r × exp(-r/σ)

Where:

  • κ = coupling strength (2.5)
  • σ = confinement scale (1.0)
  • r = distance in concept space

Weak Field (Flavor Transitions)

Conceptual Metaphor: Like how a neutron can spontaneously transform into a proton by changing its "flavor," concepts can undergo subtle mutations that shift their meaning. This field governs conceptual evolution - how "phone" gradually transformed from "landline" to "smartphone" in our collective understanding. The probability of transition depends on the local "temperature" (activity level) - hot regions allow more radical transformations, cold regions preserve concepts unchanged.

Implements concept mutations through state transitions:

P(transition) = L₀ × exp(-ΔE/T)

Where T is the local temperature field.

3. Proximity Engine

Screen Shot 2025-09-26 at 05 01 18 562 PM

Ray Tracing Through Curved Space

Conceptual Metaphor: Imagine shining a flashlight through a universe where space itself is warped by the presence of heavy thoughts. The light beam (search query) doesn't travel in straight lines but curves around massive concept clusters, potentially discovering unexpected connections. Like how light bends around the sun during an eclipse, a search for "gravity" might curve past "Einstein" and unexpectedly illuminate "spacetime." The engine traces these curved paths to find the true conceptual distance between ideas.

The system traces geodesics through the memory ma 3AC0 nifold:

# Geodesic equation
d²x^μ/² + Γ^μ_νρ × (dx^ν/) × (dx^ρ/) = 0

Where Γ are Christoffel symbols computed from the metric tensor g_μν.

Light Cone Filtering

Conceptual Metaphor: Just as Einstein's light cone defines what events can causally influence each other in spacetime, the system's light cone determines which memories can "communicate" at any given moment. Recent memories have small light cones (limited reach), while older, well-integrated memories cast wider cones. This prevents the system from making impossible leaps - you can't directly connect "breakfast" to "quantum physics" unless there's a causal path through intermediate concepts within the expanding cone of accessibility.

Enforces causality constraints:

L_max = c × Δt × (1 + log(1 + step/τ))

Only memories within the light cone are accessible.

Refraction at Boundaries

Conceptual Metaphor: When thoughts travel between different dimensional shells, they refract like light passing from air into water. A complex philosophical concept entering a simpler dimensional space must "bend" and simplify, potentially revealing new perspectives. Conversely, a simple idea entering a complex space can suddenly branch into multiple interpretations. This refraction creates the "aha!" moments when viewing problems through different dimensional lenses.

When crossing dimensional boundaries:

n₁ sin(θ₁) = n₂ sin(θ₂)

Where n is the refractive index computed from field strengths.

4. Black Hole Compression Events

Screen Shot 2025-09-03 at 07 26 26 921 PM

Conceptual Metaphor: When too many related memories cluster in one region, they undergo gravitational collapse like a star becoming a black hole. The system compresses these dense thought-clusters into super-dense "remnants" - single points containing the essence of thousands of memories. But information cannot be destroyed (Hawking's paradox), so the compressed information slowly "evaporates" back into the surrounding space as Hawking radiation, spreading the consolidated wisdom throughout the network. This prevents memory bloat while preserving all learned information.

Periodic memory consolidation inspired by gravitational collapse:

# Schwarzschild radius analog
r_s = 2GM/c² → threshold = mass × coupling

# Hawking radiation analog
T_H = ℏc³/(8πGMk_B) → spread_rate1/mass

Process:

  1. Identify dense memory clusters (high local density)
  2. Compress into "remnant" using holographic encoding
  3. Release information through "radiation" (field diffusion)
  4. Preserve total information (unitarity)

5. Cognitive Control System

Conceptual Metaphor: The system models different "brain wave states" like a cognitive weather system. The Default Mode Network (DMN) represents the calm "background hum" of resting thought. Gamma waves indicate the "lightning storms" of intense focus. Alpha waves show the "gentle breeze" of relaxed integration. The Prefrontal Cortex proxy acts as the "air traffic controller," directing attention and making executive decisions. Together, they create a dynamic weather pattern of cognition that shifts between states of rest, focus, creativity, and integration.

State Variables

  • DMN (Default Mode Network): Baseline activity proxy
  • Gamma: High-frequency coherence measure
  • Alpha: Relaxation/integration state
  • PFC (Prefrontal Cortex): Executive control proxy
Cognition_level = w₁×DMN + w₂×Gamma + w₃×Alpha + w₄×PFC

6. Validation System

Multiple validators check hypothesis quality:

Redaction Validator

Conceptual Metaphor: Like a cosmic censor that tests how much information survives when forced through a narrow channel. The validator removes random words (redacts) from a hypothesis and measures how much meaning is lost using Jensen-Shannon divergence - a mathematical measure of the "distance" between probability distributions. A robust idea maintains its meaning even when partially obscured, like how you can still recognize a song with some notes missing.

Uses Jensen-Shannon divergence to measure information loss:

JSD(P||Q) = ½KL(P||M) + ½KL(Q||M)
where M = ½(P + Q)

Diversity Validator

Conceptual Metaphor: Acts like a biodiversity inspector for ideas, checking that the conceptual ecosystem maintains healthy variety. It breaks text into overlapping fragments (n-grams) and measures their distribution entropy. A diverse hypothesis contains varied vocabulary and structure, preventing the system from getting stuck in repetitive thought loops, like ensuring a garden has many species rather than becoming a monoculture.

Measures concept diversity using character n-grams and entropy.

Neural Diversity

Conceptual Metaphor: Monitors the "neural fingerprints" of different thoughts to ensure the system explores varied cognitive territories. Like how a jazz musician avoids playing the same riff repeatedly, this validator ensures each thought activates a unique pattern across the network, preventing cognitive ruts and encouraging exploration of the full space of possible thoughts.

Tracks unique activation patterns across the network.

Advanced Features

1. Variational Autoencoder (VAE)

Conceptual Metaphor: The VAE acts like a cosmic compress-and-reconstruct machine that learns the "DNA of thoughts." It squeezes high-dimensional concepts through a narrow bottleneck (like fitting an elephant through a keyhole), forcing it to learn only the most essential features. The KL divergence term acts as a "regularization force" that prevents the compressed representation from becoming too exotic - keeping the latent space smooth and navigable. The β parameter controls this tradeoff, starting gentle (allowing free exploration) then gradually tightening to force more efficient encoding.

Implements neural compression with KL divergence regularization:

Loss = Recon_Loss + β × KL_Loss
KL_Loss = -½ Σ(1 + log(σ²) - μ² - σ²)

With adaptive β scheduling:

β(t) = β_start + (β_end - β_start) × min(1, t/warmup_steps)

2. Multi-Armed Bandits

Conceptual Metaphor: Imagine a cosmic slot machine with multiple arms, each representing a different strategy for exploring ideas. The LinUCB algorithm maintains a "confidence ellipsoid" around each arm's expected reward - pulling arms where either the expected reward is high OR uncertainty is large (exploration bonus). The system builds statistical models of which conceptual paths yield insights, gradually learning to balance between exploiting known fruitful directions and exploring uncertain territories. The exploration parameter α acts like a "curiosity dial" controlling risk-taking behavior.

LinUCB Algorithm

UCB = x^T × A⁻¹ × b + α × √(x^T × A⁻¹ × x)

Where:

  • A accumulates outer products of features
  • b accumulates rewards
  • α controls exploration

3. Clifford Algebra Rotors

Conceptual Metaphor: Rotors are like "conceptual gyroscopes" that can spin thoughts in higher dimensions. Unlike simple 3D rotations, these can rotate in any plane of the 248-dimensional space, creating transformations impossible to visualize but mathematically precise. When you "spin" a concept using a rotor, it smoothly transforms into related concepts along a continuous path - like morphing "day" into "night" by rotating through "twilight." The bivector B defines the "plane of rotation" while θ controls how far to spin.

Geometric transformations using bivectors:

R = exp(-B×θ/2)
v' = R × v × R†

Where B is a bivector and θ is the rotation angle.

4. Holographic Encoding

Conceptual Metaphor: Based on the holographic principle from black hole physics - all information about a 3D volume can be encoded on its 2D surface. The system treats memory clusters like holographic plates where the entire content can be reconstructed from boundary information. Like how a hologram contains the whole image in every piece, each boundary element contains information about the entire internal structure. The "area law" ensures information density never exceeds the boundary's capacity to encode it, preventing information paradoxes.

Implements AdS/CFT-inspired boundary encoding:

# Entropy bound (area law)
SA/(4l_p²)

# Information on boundary
bits_budget = k × perimeter(region)

Telemetry and Metrics

Key Performance Indicators

Conceptual Metaphor: The system's health is monitored like vital signs of a living organism. Acceptance Rate is the "immune response" - how well it distinguishes good ideas from bad. Lock Rate measures "crystallization" - how quickly fluid thoughts solidify into stable concepts. Coherence Score checks "sanity" - whether ideas make logical sense together. Novelty Score measures "creativity" - distance from the familiar. Q(t) represents overall "evolution" - the system's journey toward higher cognition.

  • Acceptance Rate: Successful validations / total attempts
  • Lock Rate: Pattern crystallization frequency
  • Coherence Score: Semantic consistency measure
  • Novelty Score: Distance from existing concepts
  • Q(t): Emergence quality metric

Cosmic Time Parameter

Conceptual Metaphor: Q(t) tracks the system's "cosmic evolution" like the universe expanding after the Big Bang. Starting from nothing (Q=0), it asymptotically approaches a theoretical maximum (Q∞) but never quite reaches it, following an exponential approach curve. The τ parameter sets the "cosmic clock speed" while α controls the "curve of progress." This creates a natural measure of system maturity - young systems evolve rapidly, mature systems refine slowly.

Q(t) = Q∞ × (1 - exp(-t/τ))^α

Tracks system evolution toward theoretical optimum.

Configuration System

Conceptual Metaphor: The environment variables act as the "cosmic constants" of this universe - fundamental parameters that determine how reality operates. Like tuning the gravitational constant or speed of light would create different universes, adjusting these parameters creates different cognitive personalities. Some create fast, chaotic thinkers; others slow, methodical ones. The configuration space itself is a landscape of possible minds.

The system uses extensive environment variables for configuration:

# Core dimensions
E8_EMBED_DIM = 1536          # Input embedding dimension
M27_NDIM_E8 = 8              # E8 projection dimension
M27_NDIM_LEECH = 24          # Leech lattice dimension

# Field parameters
FIELD_G_ENABLE = 1           # Gravitational field
ETA_G = 0.10                 # Drift rate
G_SEM = 0.05                 # Semantic gravity strength

# Cognitive timing
E8_TEACHER_ASK_EVERY = 20    # Teacher prompt frequency
E8_BH_TARGET_INTERVAL = 120  # Black hole event spacing

Data Flow Architecture

Input Pipeline

Conceptual Metaphor: Information enters like a river flowing through a series of transformative rapids and pools. Raw text enters the "headwaters" and gets converted to high-dimensional embeddings. These flow through "projection rapids" that compress them to essential features. The flow then spreads into "dimensional pools" of varying depths. Finally, "crystallization points" form edges between related concepts, creating an interconnected delta of meaning where information can flow in multiple directions.

  1. Text/Data Ingestion → Embedding generation (1536D)
  2. Projection → E8 basis (8D) + dimensional shells
  3. Graph Construction → k-NN + quasicrystal edges
  4. Field Evolution → Maxwell-Lorentz dynamics

Cognitive Loop

Conceptual Metaphor: The cognitive loop operates like a Socratic dialogue between teacher and student aspects of the same mind. The Teacher asks probing questions, the Student attempts answers, multiple Validators act as critical reviewers, and successful insights get inscribed in the permanent record (memory). This creates a self-improving cycle where the system literally teaches itself through internal dialogue, with each loop potentially raising the level of discourse.

  1. Teacher Question → Generates exploratory prompts
  2. Student Response → LLM generates hypothesis
  3. Validation → Multiple validators check quality
  4. Memory Storage → If accepted, add to graph
  5. Field Update → Modify potentials and connections

Output Generation

Conceptual Metaphor: Generating output is like conducting an orchestra of memories. The query acts as the conductor's intention, ray tracing recruits the relevant musicians (memories), synthesis arranges them into harmony, and the final generation performs the complete symphony. The process doesn't just retrieve information but actively composes new understanding from the interplay of activated concepts.

  1. Query Processing → Embed and project query
  2. Memory Retrieval → Ray tracing through manifold
  3. Synthesis → Combine relevant memories
  4. Response Generation → LLM with context

Technical Implementation Details

Asynchronous Architecture

Conceptual Metaphor: The system operates like a bustling city where thousands of activities happen simultaneously. Async operations are like having multiple workers who don't wait idle when one is busy - while one worker calls an LLM, others update fields, process memories, or validate hypotheses. This creates a fluid, living system rather than a rigid, sequential machine.

  • Uses Python's asyncio for concurrent operations
  • Worker pools for LLM calls
  • Non-blocking memory operations
  • Event-driven field updates

Performance Optimizations

Conceptual Metaphor: Optimizations work like a well-organized kitchen during rush hour. Cached indices are like having ingredients pre-chopped, lazy computation defers work until absolutely needed (like just-in-time cooking), batched operations process multiple items together (like cooking multiple orders in one pan), and memory-mapped storage accesses data directly from disk without loading everything into RAM (like a smart pantry system).

  • Cached KD-tree indices
  • Lazy computation of field gradients
  • Batched matrix operations
  • Memory-mapped storage for large datasets

Error Handling

Conceptual Metaphor: The error handling system acts like a cognitive immune system with multiple defense layers. When components fail, the system doesn't crash but gracefully degrades like a brain rerouting around damaged areas. Fallback stubs are like backup generators, try-catch blocks act as safety nets, and rate limiting prevents overwhelming external resources - ensuring the system remains stable even under adverse conditions.

  • Graceful degradation when components fail
  • Fallback stubs for optional dependencies
  • Extensive try-catch blocks with logging
  • Rate limiting for external API calls

System Limitations

  1. Computational Complexity: O(n²) for some graph operations
  2. Memory Requirements: Scales with number of concepts stored
  3. Single File Architecture: 10,000+ lines in one file
  4. External Dependencies: Requires LLM API access
  5. Experimental Nature: Many components still being refined

Research Applications

This system serves as a testbed for:

  • Novel memory architectures using geometric principles
  • Physics-inspired learning dynamics
  • Self-organizing information structures
  • Emergent behavior from simple rules
  • Cross-dimensional information retrieval

Imagine running Kaleidoscope overnight with 10k papers… waking up to clusters, analogies, and a theory of something new.

Screen Shot 2025-09-23 at 05 27 44 854 PM Screen Shot 2025-09-16 at 07 27 18 435 PM ```

Getting Started with The Kaleidoscope

Prerequisites

  • Python 3.10+ (3.11 recommended)
  • Git installed and configured
  • API Keys for at least one LLM provider:
    • OpenAI API key, OR
    • Google Gemini API key, OR
    • Local Ollama installation
  • 8GB+ RAM minimum (16GB+ recommended)
  • Windows/Linux/MacOS (Windows users will use .bat files, others use .sh)

Installation Guide

Step 1: Clone the Repository

git clone https://github.com/Howtoimagine/the_kaleidoscope.git
cd the_kaleidoscope

Step 2: Create Virtual Environment

Why Virtual Environment?: Isolates the Kaleidoscope's dependencies from your system Python, preventing conflicts with other projects.

Windows:

python -m venv venv
venv\Scripts\activate

Linux/MacOS:

python3 -m venv venv
source venv/bin/activate

You should see (venv) in your terminal prompt when activated.

Step 3: Install Requirements

pip install --upgrade pip
pip install -r requirements.txt

Common requirements.txt contents (create if missing):

numpy>=1.24.0
scipy>=1.10.0
scikit-learn>=1.3.0
networkx>=3.0
aiohttp>=3.8.0
asyncio>=3.4.3
python-dotenv>=1.0.0
rich>=13.0.0  # For console UI
openai>=1.0.0  # If using OpenAI
google-generativeai>=0.3.0  # If using Gemini
ollama>=0.1.0  # If using Ollama
torch>=2.0.0  # Optional: for VAE features

Troubleshooting Common Issues:

  • NumPy errors: pip install numpy --upgrade --force-reinstall
  • Torch issues: Visit pytorch.org for platform-specific installation
  • Missing dependencies: The system has fallback stubs for most optional libraries

Configuration

Step 4: Set Up Environment Variables

Create a .env file in the root directory:

# === LLM Configuration ===
# Choose ONE primary LLM provider:

# Option A: OpenAI
OPENAI_API_KEY=sk-your-openai-key-here
LLM_PROVIDER=openai
LLM_MODEL=gpt-4  # or gpt-3.5-turbo for faster/cheaper

# Option B: Google Gemini
GEMINI_API_KEY=your-gemini-key-here
LLM_PROVIDER=gemini
LLM_MODEL=gemini-pro

# Option C: Local Ollama
LLM_PROVIDER=ollama
OLLAMA_MODEL=llama2  # or mistral, phi, etc.

# === Core Configuration ===
E8_EMBED_DIM=1536              # Embedding dimension (1536 for OpenAI)
GLOBAL_SEED=1337               # Random seed for reproducibility
RUN_DIR=runs/my_experiment     # Where to save outputs

# === Performance Tuning ===
LOCAL_GEN_WORKERS=2             # Parallel LLM workers (increase if you have quota)
E8_CPU_THREADS=8                # CPU threads to use
POOL_WORKER_TIMEOUT=120         # Timeout for LLM calls in seconds

# === Cognitive Parameters ===
E8_TEACHER_ASK_EVERY=20         # How often to generate questions
E8_BH_TARGET_INTERVAL=120       # Black hole compression frequency
E8_VAE_ENABLE=1                 # Enable variational autoencoder

# === Field Dynamics ===
FIELD_G_ENABLE=1                # Enable gravitational field
FIELD_S_ENABLE=1                # Enable strong binding field
FIELD_W_ENABLE=1                # Enable weak flavor field
G_SEM=0.05                      # Semantic gravity strength
ETA_G=0.10                      # Gravitational drift rate

# === Optional: Semantic Domain ===
E8_SEMANTIC_DOMAIN=quantum_computing  # Focus area for exploration
E8_SEED_LABEL=research              # Initial concept seed

Step 5: Configure Data Sources

Important: The system can ingest external knowledge through the data sources configuration. You'll want to customize this with your own research papers and documents.

Create or modify data_sources_example.json:

{
  "sources": [
    {
      "name": "custom_papers",
      "type": "arxiv",
      "enabled": true,
      "config": {
        "query": "quantum computing cognition",
        "max_results": 10,
        "categories": ["quant-ph", "cs.AI", "cs.NE"],
        "update_frequency": "daily"
      }
    },
    {
      "name": "local_documents",
      "type": "file",
      "enabled": true,
      "config": {
        "path": "data/papers/",
        "patterns": ["*.pdf", "*.txt", "*.md"],
        "recursive": true,
        "encoding": "utf-8"
      }
    },
    {
      "name": "research_notes",
      "type": "json",
      "enabled": true,
      "config": {
        "file": "data/research_notes.json",
        "format": "entries",
        "fields": {
          "title": "title",
          "content": "abstract",
          "metadata": "tags"
        }
      }
    },
    {
      "name": "pubmed_neuroscience",
      "type": "pubmed",
      "enabled": false,
      "config": {
        "query": "cognition neural networks",
        "max_results": 20,
        "recent_days": 30
      }
    },
    {
      "name": "web_api",
      "type": "api",
      "enabled": false,
      "config": {
        "endpoint": "https://api.example.com/papers",
        "auth_header": "Bearer YOUR_TOKEN",
        "pagination": "offset",
        "batch_size": 50
      }
    }
  ],
  "ingestion_settings": {
    "startup_delay": 10,
    "batch_size": 5,
    "rate_limit_ms": 1000,
    "deduplicate": true,
    "min_content_length": 100,
    "max_content_length": 50000
  }
}

To Add Your Own Papers:

  1. Create a data/papers/ directory:

    mkdir -p data/papers
  2. Copy your research papers (PDF/TXT/MD files) into it:

    cp ~/Downloads/my_research_paper.pdf data/papers/
  3. Or create a simple JSON file with your research:

    {
      "entries": [
        {
          "title": "Your Paper Title",
          "abstract": "The main content or abstract of your paper...",
          "tags": ["tag1", "tag2"],
          "author": "Your Name",
          "date": "2024-01-01"
        }
      ]
    }
qsn full

Running The Kaleidoscope

Step 6: Initial Test Run

First, verify your setup with a minimal test:

Windows:

python e8_mind_server_M25.1.py --test --steps 10

Linux/MacOS:

python3 e8_mind_server_M25.1.py --test --steps 10

This runs 10 cognitive cycles to verify everything works.

Step 7: Start the Full System

Windows - Using start_monolith.bat:

Create start_monolith.bat if it doesn't exist:

@echo off
echo ==========================================
echo     Starting The Kaleidoscope v.M25.1
echo ==========================================
echo.

REM Activate virtual environment
call venv\Scripts\activate

REM Set any additional environment variables
set E8_NON_INTERACTIVE=0
set E8_UI_RAY_ALERTS=1

REM Create necessary directories
if not exist runs mkdir runs
if not exist data mkdir data
if not exist runtime mkdir runtime

REM Start the main server
echo Starting cognitive engine...
python e8_mind_server_M25.1.py

REM Keep window open if there's an error
if errorlevel 1 (
    echo.
    echo ERROR: The system encountered an error.
    pause
)

Then run:

start_monolith.bat

Linux/MacOS - Using start_monolith.sh:

Create start_monolith.sh:

#!/bin/bash
echo "=========================================="
echo "    Starting The Kaleidoscope v.M25.1"
echo "=========================================="
echo

# Activate virtual environment
source venv/bin/activate

# Set environment variables
export E8_NON_INTERACTIVE=0
export E8_UI_RAY_ALERTS=1

# Create necessary directories
mkdir -p runs data runtime

# Start the main server
echo "Starting cognitive engine..."
python3 e8_mind_server_M25.1.py

# Check for errors
if [ $? -ne 0 ]; then
    echo
    echo "ERROR: The system encountered an error."
    read -p "Press any key to continue..."
fi

Make it executable and run:

chmod +x start_monolith.sh
./start_monolith.sh

What to Expect on Startup

Initial Boot Sequence

  1. Banner Display: ASCII art and version info
  2. Configuration Loading: Reads .env and validates settings
  3. E8 Physics Initialization:
    • Generates 240 root vectors
    • Validates E8 Lie algebra structure
    • Builds quasicrystal blueprint
  4. Memory System Boot:
    • Initializes dimensional shells
    • Builds KD-tree indices
    • Loads any existing snapshots
  5. Field System Activation:
    • Initializes gravitational, strong, and weak fields
    • Sets up Maxwell-Lorentz dynamics
  6. LLM Pool Creation:
    • Connects to configured LLM provider
    • Spawns worker processes
  7. Data Ingestion (if configured):
    • Loads papers from data sources
    • Creates initial concept embeddings
  8. Cognitive Loop Start:
    • Teacher begins asking questions
    • System starts exploring concept space

Console Output

You'll see formatted output like:

[CYCLE 001] ▶ Exploring: "quantum entanglement and information"
┌─ Teacher Question ────────────────────┐
│ What are the implications of...       │
└────────────────────────────────────────┘
┌─ Student Hypothesis ───────────────────┐
│ Based on the quantum field theory...  │
└────────────────────────────────────────┘
[VALIDATION] ✓ Accepted (score: 0.87)
[MEMORY] Added node_0042 to shell_32

Monitoring and Control

Runtime Commands

While running, the system responds to:

  • Ctrl+C: Graceful shutdown (saves state)
  • Ctrl+Z (Unix): Pause execution

Output Files

Check the runs/ directory for:

  • journey.ndjson - Complete event log
  • state_NNNN.json - Periodic state snapshots
  • console.ndjson - Formatted console output
  • metrics.json - Performance metrics

Visualization

If you have the HTML interface set up:

  1. Open visualization/index.html in a browser
  2. Point it to your run directory
  3. Watch the E8 lattice and memory graph in real-time

Troubleshooting

Common Issues and Solutions

Issue: "No LLM provider configured"

  • Solution: Check your .env file has valid API keys

Issue: "Out of memory"

  • Solution: Reduce E8_EMBED_DIM or increase E8_BH_TARGET_INTERVAL

Issue: "ImportError: No module named..."

  • Solution: Activate venv and run pip install -r requirements.txt

Issue: "API rate limit exceeded"

  • Solution: Reduce LOCAL_GEN_WORKERS or add delay with E8_TEACHER_ASK_EVERY

Issue: System seems frozen

  • Check: Look for activity in runtime/console.ndjson
  • Solution: System may be waiting for LLM response, check API status

Advanced Configuration

Performance Optimization

For faster exploration:

E8_TEACHER_ASK_EVERY=10        # More frequent questions
E8_BH_TARGET_INTERVAL=200      # Less frequent compression
LOCAL_GEN_WORKERS=4             # More parallel workers

For deeper thinking:

E8_TEACHER_ASK_EVERY=50        # Fewer questions
E8_VAE_BATCH=128               # Larger training batches
FIELD_G_ITERS=100              # More field solver iterations

Custom Domains

Focus exploration on specific topics:

E8_SEMANTIC_DOMAIN="machine learning"
E8_SEED_LABEL="neural networks"
E8_PROMPT_DOMAIN=1

Next Steps

  1. Experiment with Parameters: Try different field strengths and see how behavior changes
  2. Add Your Research: Load your own papers and watch the system learn from them
  3. Monitor Insights: Check journey.ndjson for discovered insights
  4. Customize Validators: Modify validation criteria in the source code
  5. Join the Community: Share your discoveries and configurations

For more help, check the GitHub Issues or create a new one.

Last Updated: 2025-11-16 by @Howtoimagine


This comprehensive guide provides everything needed to get The Kaleidoscope running, including:

1. **Clear prerequisites** with version requirements
2. **Step-by-step installation** with platform-specific commands  
3. **Detailed configuration** with explanations of each parameter
4. **Data source setup** with examples for adding custom research papers
5. **Startup scripts** for both Windows (.bat) and Unix systems (.sh)
6. **What to expect** during boot and runtime
7. **Troubleshooting** for common issues
8. **Advanced tuning** options for different use cases

The guide emphasizes the importance of customizing the `data_sources_example.json` file with the user's own research papers, which is critical for making the system useful for actual research rather than just running with default data.

## Conclusion

The Kaleidoscope M25.1 represents an ambitious experiment in applying mathematical physics to artificial intelligence. While it doesn't achieve artificial general intelligence or cognition, it explores interesting approaches to:

- Information organization using exceptional mathematical structures
- Memory consolidation through physics-inspired processes
- Multi-scale representation learning
- Geometric approaches to semantic similarity
- Self-organizing cognitive architectures

The system is a research platform for testing whether principles from theoretical physics can provide useful abstractions for building more sophisticated AI systems.

About

Kaleidoscope is an experimental cognitive architecture for emergent intelligence. It uses an E8 lattice physics engine and an RL-steered LLM to autonomously generate novel theories about complex systems. Features a visualization hub of its internal thought-space.

Topics

Resources

License

Stars

Watchers

Forks

Languages

0