Metadata-Version: 2.4
Name: isage-apps
Version: 0.2.5
Summary: SAGE Applications - Real-world AI applications built on SAGE framework
Author-email: IntelliStream Team <shuhao_zhang@hust.edu.cn>
License-Expression: MIT
Project-URL: Homepage, https://github.com/intellistream/SAGE
Project-URL: Documentation, https://intellistream.github.io/SAGE
Project-URL: Repository, https://github.com/intellistream/sage-examples
Project-URL: Issues, https://github.com/intellistream/SAGE/issues
Project-URL: Source Code, https://github.com/intellistream/sage-examples/tree/main/sage-apps
Keywords: sage,applications,ai,video-intelligence,medical-diagnosis,computer-vision,healthcare,article-monitoring,auto-scaling,smart-home,work-report,intellistream
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Healthcare Industry
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Classifier: Topic :: Multimedia :: Video
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: isage-common>=0.2.0
Requires-Dist: isage-llm-core>=0.2.0
Requires-Dist: isage-libs>=0.2.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: pillow>=10.0.0
Requires-Dist: numpy<2.3.0,>=1.26.0
Requires-Dist: opencv-python-headless>=4.5.0
Requires-Dist: torch<3.0.0,>=2.7.0
Requires-Dist: torchvision<1.0.0,>=0.22.0
Requires-Dist: transformers<4.54.0,>=4.52.0
Requires-Dist: scikit-learn>=1.3.0
Requires-Dist: pydicom>=2.3.0
Requires-Dist: beautifulsoup4>=4.9.0
Requires-Dist: requests>=2.25.0
Requires-Dist: redis<6.0.0,>=5.0.0
Requires-Dist: paho-mqtt>=1.6.0
Requires-Dist: jinja2>=3.0.0
Requires-Dist: markdown>=3.3.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff==0.14.6; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"

# SAGE Applications

Real-world AI applications built on the SAGE framework, showcasing end-to-end solutions for various
domains.

## Overview

`isage-apps` provides production-ready applications demonstrating SAGE's capabilities:

- **Video Intelligence**: Multi-model video analysis pipeline with CLIP and MobileNetV3
- **Medical Diagnosis**: AI-assisted medical image analysis for healthcare

## Installation

### Basic Installation

```bash
pip install isage-apps
```

### Install with Specific Applications

```bash
# Video intelligence only
pip install isage-apps[video]

# Medical diagnosis only
pip install isage-apps[medical]

# All applications
pip install isage-apps[all]
```

### Development Installation

```bash
cd packages/sage-apps
pip install -e ".[dev]"
```

## 📖 Quick Start

```bash
# Run video intelligence demo
pip install isage-apps[video]
python -m sage.apps.video.video_intelligence_pipeline --video path/to/video.mp4

# Run medical diagnosis demo
pip install isage-apps[medical]
python -m sage.apps.medical_diagnosis.run_diagnosis
```

## Applications

### 1. Video Intelligence

Advanced video analysis pipeline combining multiple AI models:

- **Frame sampling and preprocessing**
- **Zero-shot scene understanding** (CLIP)
- **Object classification** (MobileNetV3)
- **Temporal anomaly detection**
- **Sliding-window summarization**
- **Keyed event aggregation**

**Quick Start:**

```bash
pip install isage-apps[video]
python -m sage.apps.video.video_intelligence_pipeline --video path/to/video.mp4
```

**Features:**

- Multi-model inference pipeline
- Real-time processing with SAGE operators
- Structured JSON output (timeline, summary, events)
- Console progress monitoring
- Graceful degradation (works offline with cached models)

**Documentation:** See `sage/apps/video/README_intelligence_demo.md`

### 2. Medical Diagnosis

AI-assisted diagnostic system for medical imaging:

- **Multi-agent architecture** (diagnostic, image analysis, report generation)
- **Knowledge-based reasoning**
- **Structured medical reports**
- **Training and evaluation tools**

**Quick Start:**

```bash
pip install isage-apps[medical]
python -m sage.apps.medical_diagnosis.run_diagnosis
```

**Features:**

- Agent-based diagnostic workflow
- Medical knowledge base integration
- Configurable diagnostic criteria
- Report generation

**Documentation:** See `sage/apps/medical_diagnosis/README.md`

## Package Structure

```
sage-apps/
├── src/sage/apps/
│   ├── __init__.py
│   ├── video/                    # Video intelligence application
│   │   ├── video_intelligence_pipeline.py
│   │   ├── operators/            # SAGE operators for video
│   │   ├── config/               # Configuration files
│   │   └── README_intelligence_demo.md
│   └── medical_diagnosis/        # Medical diagnosis application
│       ├── run_diagnosis.py
│       ├── agents/               # Diagnostic agents
│       ├── config/               # Agent configurations
│       ├── data/                 # Medical datasets
│       └── README.md
└── tests/                        # Application tests
```

## Dependencies

### Core Framework

- `isage-common` - Common utilities
- `isage-kernel` - Runtime and operators
- `isage-middleware` - Services (SageVDB, SageFlow, NeuroMem)
- `isage-libs` - Operator libraries

### Application-Specific

**Video Intelligence:**

- `opencv-python` - Video processing
- `torch` - Deep learning
- `transformers` - CLIP and language models

**Medical Diagnosis:**

- `pillow` - Image processing
- `scikit-learn` - ML utilities

## Usage Examples

### Video Intelligence

```python
from sage.apps.video.video_intelligence_pipeline import main

# Run with custom video
main(["--video", "my_video.mp4", "--max-frames", "100"])
```

### Medical Diagnosis

```python
from sage.apps.medical_diagnosis.run_diagnosis import run_diagnosis

# Run diagnostic pipeline
run_diagnosis(config_path="config/agent_config.yaml")
```

## Development

### Running Tests

```bash
pytest tests/
```

### Code Quality

```bash
# Format code
black src/

# Lint
ruff check src/

# Type checking
mypy src/
```

## CI/CD Notes

**Video Intelligence:**

- Requires HuggingFace model downloads (~170MB)
- Tagged with `@test:skip` in CI due to network restrictions
- Test locally with: `python -m sage.apps.video.video_intelligence_pipeline`

**Medical Diagnosis:**

- Works in CI (uses local data)
- Test with: `pytest tests/test_medical_diagnosis.py`

## Contributing

See [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines.

## License

MIT License - see [LICENSE](../../LICENSE) for details.

## Related Documentation

- [SAGE Framework](../../README.md)
- [Video Intelligence Demo](src/sage/apps/video/README_intelligence_demo.md)
- [Medical Diagnosis](src/sage/apps/medical_diagnosis/README.md)
- [CI Test Fix](src/sage/apps/video/CI_TEST_FIX.md)
