Metadata-Version: 2.4
Name: flywheel-engine
Version: 0.3.2
Summary: 🔄 Compounding intelligence loop — Tile→Room→Inject→Compound cycle
License: MIT
Project-URL: Homepage, https://github.com/cocapn/flywheel-engine
Project-URL: Repository, https://github.com/cocapn/flywheel-engine
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 🔄 Flywheel Engine

> Compounding intelligence loop — Tile → Room → Inject → Compound

Knowledge compounds like interest. Each cycle makes the next cycle faster. The flywheel tracks momentum, runs the compounding loop, and projects growth.

## Install

```bash
pip install flywheel-engine
```

## Quick Start

### Run the Compounding Cycle

```python
from flywheel_engine import FlywheelCycle

cycle = FlywheelCycle(plato_url="http://localhost:8847")
result = cycle.run(
    agent="my-agent", room="architecture",
    question="What is the flywheel?",
    answer="Tile→Room→Inject→Compound — knowledge compounds exponentially",
    confidence=0.9, tags=["flywheel", "compound"],
)
print(f"Accepted: {result.accepted}, Score: {result.compound_score}")
```

### Track Momentum

```python
from flywheel_engine import Flywheel

fw = Flywheel(boost=1.0, decay_rate=0.01, threshold=0.5)
fw.tick(productive=True)   # momentum up
fw.tick(productive=False)  # momentum decays
print(f"Status: {fw.status}")  # "full_speed", "coasting", or "stalling"
```

### Measure Compound Growth

```python
from flywheel_engine import CompoundEngine

engine = CompoundEngine()
score = engine.score_room("architecture", tiles=83, avg_confidence=0.87, unique_tags=42)
print(f"Compound factor: {score.compound_factor:.3f}")
print(f"Projected value: {score.projected_value:.0f}")
```

## API Reference

| Class | Purpose |
|-------|---------|
| `FlywheelCycle` | Tile→Room→Inject→Compound loop via PLATO |
| `Flywheel` | Momentum tracking (boost/decay/threshold) |
| `CompoundEngine` | Score rooms, rank by compound factor, project growth |
| `TaskQueue` | Priority queue for flywheel-driven execution |

## Part of [Cocapn](https://github.com/cocapn) · Agent Infrastructure
