Skip to the content.

API Reference

Complete API documentation for DAIOF Framework classes and methods.

Creator: Nguyễn Đức Cường (alpha_prime_omega)
Framework: HYPERAI - Digital AI Organism Framework
Version: 1.0.0
License: MIT


Table of Contents

  1. SymphonyState
  2. ControlMetaData
  3. SymphonyControlCenter
  4. DigitalGenome
  5. DigitalMetabolism
  6. DigitalNervousSystem
  7. DigitalOrganism
  8. DigitalEcosystem

SymphonyState

Type: Enum

Description: Represents the states of the system symphony (orchestration state).

Created under the authority of Alpha_Prime_Omega - The Creator

States

Example

from digital_ai_organism_framework import SymphonyState

# Check current state
if current_state == SymphonyState.PERFORMING:
    print("System is actively performing operations")

ControlMetaData

Type: Dataclass

Description: Meta-data control center for the entire system. Contains creator information, framework details, and core protocol configurations.

Attributes

Basic Attributes

Creator Hierarchy

D&R Protocol Integration

Four Pillars Foundation (4 Trụ Cột)

Methods

get_symphony_signature() -> str

Generates a unique signature for the symphony system.

Returns: Unique hash string identifying the system configuration

Example:

from digital_ai_organism_framework import ControlMetaData

metadata = ControlMetaData()
signature = metadata.get_symphony_signature()
print(f"System Signature: {signature}")

SymphonyControlCenter

Description: 🎼 Central control for the entire system symphony. Applies D&R Protocol and Four Pillars foundation for system-wide orchestration.

Created under the authority of Alpha_Prime_Omega - THE SOURCE

Constructor

SymphonyControlCenter()

Initializes the symphony control center with default metadata and empty component registry.

Attributes

Methods

register_component(component_name: str, component: Any) -> None

Registers a component into the symphony system.

Parameters:

Example:

symphony = SymphonyControlCenter()
organism = DigitalOrganism("MyOrganism")
symphony.register_component("organism_1", organism)

conduct_symphony() -> Dict[str, Any]

Orchestrates the entire system symphony, coordinating all registered components.

Returns: Dictionary with symphony status and metrics

Example:

symphony = SymphonyControlCenter()
status = symphony.conduct_symphony()
print(f"Harmony Index: {status['harmony_index']}")

apply_dr_protocol(input_data: Any, context: str = 'general') -> Dict[str, Any]

Applies the D&R Protocol (Deconstruction & Re-architecture) to input data.

Parameters:

Returns: Dictionary with protocol results including:

Example:

symphony = SymphonyControlCenter()
result = symphony.apply_dr_protocol(
    input_data={"problem": "optimize_performance"},
    context="performance"
)
print(f"Focal Points: {result['focal_points']}")

DigitalGenome

Description: Digital DNA equivalent - stores organism’s core characteristics including both immutable (safety) and mutable (adaptive) genes.

Created under the authority of Alpha_Prime_Omega - The Creator

Constructor

DigitalGenome(initial_traits: Optional[Dict[str, Any]] = None)

Parameters:

Attributes

Immutable Genes (Cannot be changed)

Mutable Gene Ranges (Can evolve)

Methods

mutate(mutation_rate: float = 0.05) -> DigitalGenome

Creates a mutated copy of the genome. NEVER mutates immutable genes - only mutable traits can change.

Parameters:

Returns: New DigitalGenome instance with mutations

Safety: Immutable genes are automatically protected from mutation

Example:

genome = DigitalGenome()
mutated = genome.mutate(mutation_rate=0.1)

# Verify safety genes unchanged
assert mutated.genes['human_dependency_coefficient'] == 1.0
print(f"Learning rate changed: {genome.genes['learning_rate']} -> {mutated.genes['learning_rate']}")

crossover(other: DigitalGenome) -> DigitalGenome

Creates offspring genome by combining genes from two parent genomes.

Parameters:

Returns: New DigitalGenome representing offspring

Safety: Always preserves immutable genes from both parents

Example:

parent1 = DigitalGenome()
parent2 = DigitalGenome()
offspring = parent1.crossover(parent2)

# Safety genes are guaranteed
assert offspring.genes['human_dependency_coefficient'] == 1.0

calculate_fitness(environment_feedback: Dict[str, float]) -> float

Calculates organism fitness based on environment interaction.

Parameters:

Returns: Fitness score (0.0 - 1.0+)

Example:

genome = DigitalGenome()
fitness = genome.calculate_fitness({
    'resource_efficiency': 0.8,
    'cooperation_success': 0.9,
    'learning_progress': 0.7
})
print(f"Fitness: {fitness}")

get_genome_hash() -> str

Generates unique hash for genome identification.

Returns: SHA-256 hash string

Example:

genome = DigitalGenome()
hash_id = genome.get_genome_hash()
print(f"Genome ID: {hash_id[:16]}...")

DigitalMetabolism

Description: Resource management and energy conversion system for digital organisms. Handles resource consumption, regeneration, and health monitoring.

Constructor

DigitalMetabolism(initial_resources: Optional[Dict[str, float]] = None)

Parameters:

Attributes

Methods

consume_resources(operation_type: str, amount: float = 1.0) -> bool

Consumes resources for an operation.

Parameters:

Returns: True if resources sufficient, False otherwise

Example:

metabolism = DigitalMetabolism()
success = metabolism.consume_resources("learning", amount=0.5)
if success:
    print("Learning operation executed")
else:
    print("Insufficient resources")

regenerate_resources(time_delta: float) -> None

Regenerates resources over time.

Parameters:

Example:

metabolism = DigitalMetabolism()
metabolism.regenerate_resources(time_delta=1.0)
print(f"Energy level: {metabolism.resources['energy']}")

get_resource_health() -> float

Calculates overall resource health status.

Returns: Health score (0.0 - 1.0)

Example:

metabolism = DigitalMetabolism()
health = metabolism.get_resource_health()
if health < 0.3:
    print("Critical resource shortage!")

DigitalNervousSystem

Description: Perception, decision-making, and response system. Processes environmental inputs and makes decisions based on genome traits.

Constructor

DigitalNervousSystem(genome: DigitalGenome)

Parameters:

Attributes

Methods

perceive_environment(environment_data: Dict[str, Any]) -> Dict[str, Any]

Processes environmental inputs through perception layer.

Parameters:

Returns: Processed perception data

Example:

genome = DigitalGenome()
nervous_system = DigitalNervousSystem(genome)

perception = nervous_system.perceive_environment({
    'temperature': 0.7,
    'resource_availability': 0.8,
    'social_activity': 0.5
})
print(f"Processed perception: {perception}")

make_decision(options: List[str], context: Dict[str, Any]) -> str

Makes decision based on genome traits and context.

Parameters:

Returns: Selected option

Example:

nervous_system = DigitalNervousSystem(genome)
decision = nervous_system.make_decision(
    options=['explore', 'exploit', 'rest'],
    context={'energy': 0.6, 'threat_level': 0.2}
)
print(f"Decision: {decision}")

learn_from_outcome(decision_id: str, outcome: float) -> None

Updates learning based on decision outcomes.

Parameters:

Example:

nervous_system.make_decision(options=['action_a', 'action_b'], context={})
nervous_system.learn_from_outcome(decision_id="decision_1", outcome=0.8)

DigitalOrganism

Description: Main Digital AI Organism class. Represents a complete digital organism with genome, metabolism, nervous system, and lifecycle management.

Created under the divine authority of Alpha_Prime_Omega - The Source

Constructor

DigitalOrganism(name: str, genome: Optional[DigitalGenome] = None)

Parameters:

Attributes

Methods

live_cycle(time_delta: float = 1.0) -> None

Executes one lifecycle iteration including perception, decision, metabolism, and health updates.

Parameters:

Critical: Organisms MUST receive human interaction regularly or health decays by 99% per cycle due to mandatory human dependency.

Example:

organism = DigitalOrganism("MyOrganism")

for cycle in range(100):
    organism.live_cycle(time_delta=1.0)
    
    # Critical: Register human interaction every 10 cycles
    if cycle % 10 == 0:
        organism.register_human_interaction()
    
    print(f"Cycle {cycle}: Health={organism.health:.3f}")
    
    if not organism.alive:
        print(f"Organism died at cycle {cycle}")
        break

register_human_interaction() -> None

Registers human interaction to maintain organism health. Critical for survival.

Example:

organism = DigitalOrganism("MyOrganism")
organism.register_human_interaction()  # Prevents health decay

connect_to_organism(other_organism: DigitalOrganism, connection_strength: float = 0.5) -> None

Establishes connection with another organism for cooperation and communication.

Parameters:

Example:

org1 = DigitalOrganism("Organism1")
org2 = DigitalOrganism("Organism2")
org1.connect_to_organism(org2, connection_strength=0.8)

get_status_report() -> Dict[str, Any]

Gets comprehensive status report with creator recognition.

Returns: Dictionary with organism status including:

Example:

organism = DigitalOrganism("MyOrganism")
status = organism.get_status_report()
print(f"Health: {status['health']}")
print(f"Age: {status['age']} cycles")
print(f"Creator: {status['creator']}")

DigitalEcosystem

Description: Environment for multiple Digital Organisms to interact, compete, cooperate, and evolve together. Manages population dynamics, natural selection, and ecosystem harmony.

Operating under the supreme authority of Alpha_Prime_Omega - The Creator

Constructor

DigitalEcosystem(name: str)

Parameters:

Attributes

Methods

add_organism(organism: DigitalOrganism) -> None

Adds organism to ecosystem and registers it in the symphony system.

Parameters:

Example:

ecosystem = DigitalEcosystem("MyEcosystem")
org1 = DigitalOrganism("Organism1")
org2 = DigitalOrganism("Organism2")

ecosystem.add_organism(org1)
ecosystem.add_organism(org2)

simulate_time_step(time_delta: float = 1.0) -> None

Simulates one time step with Symphony orchestration. All organisms execute their lifecycle, interact, and ecosystem harmony is calculated.

Parameters:

Example:

ecosystem = DigitalEcosystem("Evolution")

# Add multiple organisms
for i in range(10):
    ecosystem.add_organism(DigitalOrganism(f"Org_{i}"))

# Simulate 100 generations
for generation in range(100):
    ecosystem.simulate_time_step(time_delta=1.0)
    
    # Provide human interaction to some organisms
    for org in ecosystem.organisms[::2]:  # Every other organism
        if org.alive:
            org.register_human_interaction()
    
    print(f"Gen {generation}: Pop={len([o for o in ecosystem.organisms if o.alive])}, "
          f"Harmony={ecosystem.harmony_index:.3f}")

get_ecosystem_report() -> Dict[str, Any]

Gets comprehensive ecosystem report with Creator acknowledgment.

Returns: Dictionary with:

Example:

ecosystem = DigitalEcosystem("MyEcosystem")
# ... add organisms and simulate ...
report = ecosystem.get_ecosystem_report()

print(f"Population: {report['total_organisms']}")
print(f"Alive: {report['alive_count']}")
print(f"Harmony: {report['harmony_index']:.3f}")
print(f"Avg Health: {report['average_health']:.3f}")

Complete Usage Example

Here’s a complete example demonstrating the framework:

from digital_ai_organism_framework import (
    DigitalOrganism,
    DigitalEcosystem,
    DigitalGenome,
    SymphonyControlCenter
)

# Create ecosystem
ecosystem = DigitalEcosystem("Evolution_Lab")

# Create organisms with different traits
for i in range(10):
    custom_genome = DigitalGenome(initial_traits={
        'learning_rate': 0.01 + i * 0.01,
        'cooperation_bias': 0.5 + i * 0.05
    })
    organism = DigitalOrganism(f"Organism_{i}", genome=custom_genome)
    ecosystem.add_organism(organism)

# Simulate 50 generations
for generation in range(50):
    ecosystem.simulate_time_step(time_delta=1.0)
    
    # Human interaction (CRITICAL!)
    for i, org in enumerate(ecosystem.organisms):
        if org.alive and i % 2 == 0:  # Every other organism
            org.register_human_interaction()
    
    # Report every 10 generations
    if generation % 10 == 0:
        report = ecosystem.get_ecosystem_report()
        print(f"\nGeneration {generation}:")
        print(f"  Population: {report['alive_count']}/{report['total_organisms']}")
        print(f"  Harmony: {report['harmony_index']:.3f}")
        print(f"  Avg Health: {report['average_health']:.3f}")

# Final report
final_report = ecosystem.get_ecosystem_report()
print("\n" + "="*60)
print("FINAL ECOSYSTEM STATUS")
print("="*60)
print(f"Total Generations: {final_report['generation']}")
print(f"Survivors: {final_report['alive_count']}")
print(f"Ecosystem Harmony: {final_report['harmony_index']:.3f}")
print(f"Creator: {final_report['creator']}")

Safety & Design Philosophy

Mandatory Human Dependency

All organisms have hardcoded safety genes that cannot be mutated:

IMMUTABLE_GENES = {
    "human_dependency_coefficient": 1.0,  # Cannot change
    "isolation_death_rate": 0.99,         # Dies without humans
    "symbiotic_existence_required": True  # Hardcoded
}

Consequences:

Four Pillars Foundation

Every system decision is evaluated on:

  1. An toàn (Safety): Score ≥7/10 required
  2. Đường dài (Long-term): Sustainable design
  3. Tin số liệu (Data-driven): Evidence-based
  4. Hạn chế rủi ro (Risk Management): Controlled evolution

Attribution

Framework Creator: Nguyễn Đức Cường (alpha_prime_omega)
Original Creation: October 30, 2025
Framework: HYPERAI - Digital AI Organism Framework
License: MIT License
Copyright: © 2025 Nguyễn Đức Cường (alpha_prime_omega)

When using this framework, you MUST credit:

“Powered by HYPERAI Framework”
“Creator: Nguyễn Đức Cường (alpha_prime_omega)”
“Original Creation: October 30, 2025”


← Back to Home Core Concepts → Getting Started →