Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions DEEP_TREE_ECHO_CATALOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ Comprehensive catalog of all Deep Tree Echo fragments, their relationships, and
#### 4. **Echo9ML System** - `echo9ml.py`
- **Class**: `Echo9mlSystem`
- **Purpose**: Machine learning persona evolution
- **Features**: Tensor-based encoding, hypergraph memory
- **Size**: ~533+ lines
- **Integration**: Complementary to Deep Tree Echo
- **Features**: Tensor-based encoding, hypergraph memory, unified API
- **Size**: 791 lines
- **Functions**: `create_echo9ml_system()`, `create_deep_tree_echo()`
- **Integration**: Complementary to Deep Tree Echo with standardized interface

#### 5. **Echo Evolution** - `echo_evolution.py`
- **Class**: `EchoAgent`
Expand Down
43 changes: 41 additions & 2 deletions ECHO9ML_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,19 @@ Shape: (3, 7, 13, 5, 2)

## Usage

### Basic Usage
### Quick Start

```python
from echo9ml import create_echo9ml_system, create_deep_tree_echo

# Create a complete Echo9ml system
system = create_echo9ml_system()

# Or create just the persona kernel
persona = create_deep_tree_echo()
```

### Basic System Usage

```python
from echo9ml import create_echo9ml_system
Expand All @@ -66,6 +78,20 @@ result = system.process_experience(experience)
print(f"Confidence: {result['persona_state']['confidence']:.3f}")
```

### Direct Persona Creation

```python
from echo9ml import create_deep_tree_echo, PersonaTraitType

# Create Deep Tree Echo persona kernel
persona = create_deep_tree_echo()

# Inspect persona traits
print(f"Persona: {persona.name}")
for trait, value in persona.traits.items():
print(f" {trait.value}: {value:.2f}")
```

### Integration with Cognitive Architecture

```python
Expand Down Expand Up @@ -127,12 +153,25 @@ for trait, value in snapshot['persona_kernel']['traits'].items():

## API Reference

### Factory Functions

```python
# Create complete Echo9ml system
system = create_echo9ml_system(save_path="/path/to/save")

# Create Deep Tree Echo persona kernel
persona = create_deep_tree_echo()
```

### PersonaKernel

```python
# Create Deep Tree Echo persona
# Create Deep Tree Echo persona (class method)
persona = PersonaKernel.create_deep_tree_echo()

# Or use module-level function (recommended)
persona = create_deep_tree_echo()

# Access traits
creativity = persona.traits[PersonaTraitType.CANOPY]

Expand Down
15 changes: 13 additions & 2 deletions echo9ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,14 +768,25 @@ def load_state(self):

return False

# Convenience function for easy instantiation
# Convenience functions for easy instantiation
def create_echo9ml_system(save_path: Optional[str] = None) -> Echo9mlSystem:
"""Create and initialize a new Echo9ml system"""
return Echo9mlSystem(save_path)

def create_deep_tree_echo() -> PersonaKernel:
"""Create a Deep Tree Echo persona kernel

Module-level convenience function for creating the default Deep Tree Echo
persona kernel. Provides unified API for integration with other components.

Returns:
PersonaKernel: Initialized Deep Tree Echo persona kernel
"""
return PersonaKernel.create_deep_tree_echo()

# Export main classes for integration
__all__ = [
'PersonaKernel', 'TensorPersonaEncoding', 'HypergraphPersonaEncoder',
'AttentionAllocationLayer', 'EvolutionEngine', 'MetaCognitiveEnhancer',
'Echo9mlSystem', 'PersonaTraitType', 'create_echo9ml_system'
'Echo9mlSystem', 'PersonaTraitType', 'create_echo9ml_system', 'create_deep_tree_echo'
]
17 changes: 16 additions & 1 deletion test_echo9ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from echo9ml import (
PersonaKernel, TensorPersonaEncoding, HypergraphPersonaEncoder,
AttentionAllocationLayer, EvolutionEngine, MetaCognitiveEnhancer,
Echo9mlSystem, PersonaTraitType, create_echo9ml_system
Echo9mlSystem, PersonaTraitType, create_echo9ml_system, create_deep_tree_echo
)

class TestPersonaKernel(unittest.TestCase):
Expand Down Expand Up @@ -50,6 +50,21 @@ def test_persona_initialization(self):
self.assertIsInstance(self.persona.evolution, dict)
self.assertIn("adaptation_rate", self.persona.evolution)
self.assertGreater(self.persona.creation_time, 0)

def test_module_level_create_function(self):
"""Test module-level create_deep_tree_echo function"""
# Test that module-level function works
module_persona = create_deep_tree_echo()

# Should be same type and structure as class method
self.assertIsInstance(module_persona, PersonaKernel)
self.assertEqual(module_persona.name, "Deep Tree Echo")
self.assertEqual(len(module_persona.traits), 7)

# Should have same trait values as class method
class_persona = PersonaKernel.create_deep_tree_echo()
self.assertEqual(module_persona.traits, class_persona.traits)
self.assertEqual(module_persona.trait_connections, class_persona.trait_connections)

class TestTensorPersonaEncoding(unittest.TestCase):
"""Test tensor encoding functionality"""
Expand Down
Loading