Skip to main content

SAGE Examples - Production application examples for SAGE framework

Project description

SAGE Examples

CI Status Code Quality Python 3.10+ License: MIT

Production-ready application examples for the SAGE framework.

๐ŸŽฏ What is This?

sage-examples showcases production application examples for SAGE:

  • ๐ŸŽฏ Examples: Complete, runnable application demonstrations
  • ๐Ÿ“ฆ apps Package: Installable application library (published to PyPI as iapps)

๏ฟฝ Looking for tutorials? Visit SAGE/tutorials for learning materials.

๐Ÿš€ Quick Start

# Clone this repository
git clone https://github.com/intellistream/sage-examples.git
cd sage-examples

# Install (all dependencies included)
pip install -e .

# Run an application example
python examples/run_video_intelligence.py

New to SAGE? Start with SAGE/tutorials first.

๐Ÿ“ Repository Structure

sage-examples/
โ”œโ”€โ”€ examples/                  # ๐ŸŽฏ Production application examples
โ”‚   โ”œโ”€โ”€ run_video_intelligence.py
โ”‚   โ”œโ”€โ”€ run_medical_diagnosis.py
โ”‚   โ”œโ”€โ”€ run_smart_home.py
โ”‚   โ””โ”€โ”€ ...
โ”‚
โ”œโ”€โ”€ apps/                 # ๐Ÿ“ฆ Installable application package
โ”‚   โ”œโ”€โ”€ src/sage/apps/         # Application implementations
โ”‚   โ””โ”€โ”€ tests/                 # Package tests
โ”‚
โ”œโ”€โ”€ docs/                      # ๐Ÿ“– Project documentation
โ””โ”€โ”€ pyproject.toml             # Project configuration

๐Ÿ“š Learning vs Examples

Your Goal Repository
Learn SAGE basics SAGE/tutorials
See production examples sage-examples (this repo)
Install applications pip install iapps

๐ŸŽฏ Application Examples

Complete, runnable applications demonstrating real-world use cases:

Application Description Script
๐ŸŽฌ Video Intelligence Multi-model video analysis examples/run_video_intelligence.py
๐Ÿฅ Medical Diagnosis AI medical image analysis examples/run_medical_diagnosis.py
๐Ÿ  Smart Home IoT automation system examples/run_smart_home.py
๐Ÿ“ฐ Article Monitoring News monitoring pipeline examples/run_article_monitoring.py
๐Ÿ’ฌ Auto-scaling Chat Dynamic scaling chat examples/run_auto_scaling_chat.py
โš™๏ธ Runtime API Layering Facade vs Local/FlownetEnvironment contract demo examples/run_runtime_api_layering.py

See examples/README.md for details.

๐Ÿ“ฆ Installation

# Clone repository
git clone https://github.com/intellistream/sage-examples.git
cd sage-examples

# Install (all dependencies included by default)
pip install -e .

# Or install from PyPI
pip install isage-examples

# Development mode (includes pytest, ruff, mypy)
pip install -e .[dev]

Note: Following SAGE principles, all application dependencies are installed by default. No need for extra flags like [video] or [medical].

๐Ÿ—๏ธ SAGE Architecture Overview

SAGE uses a strict 6-layer architecture with unidirectional dependencies:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ L6: Interface                                โ”‚  CLI, Web UI, Tools
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ L5: Applications                             โ”‚  Production Apps
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ L4: Middleware                               โ”‚  Domain Operators
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ L3: Core                                     โ”‚  Execution + Algorithms
โ”‚     โ”œโ”€ Kernel (Batch/Stream Engine)         โ”‚
โ”‚     โ””โ”€ Libs (RAG/Agents/Algorithms)         โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ L2: Platform                                 โ”‚  Scheduler, Storage
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ L1: Foundation                               โ”‚  Config, Logging, LLM
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Dependency Rule: Upper layers can depend on lower layers (L6โ†’L5โ†’...โ†’L1), but never the reverse.

๐Ÿ› ๏ธ Development

Setup

# Install development dependencies
pip install -e ".[dev]"

# Install pre-commit hooks
pre-commit install

# Run all checks
pre-commit run --all-files

Code Quality

# Format code
ruff format .

# Lint code
ruff check .

# Auto-fix issues
ruff check --fix .

# Type checking
mypy .

Testing

# Run all tests
pytest

# Run specific tests
pytest examples/test_apps.py
pytest apps/tests/

# With coverage
pytest --cov=. --cov-report=html

See docs/DEVELOPMENT.md for complete development guide.

๐Ÿ“– Documentation

๐Ÿค Contributing

We welcome contributions! Please see:

  1. Development Guide: docs/DEVELOPMENT.md
  2. Code of Conduct: Follow respectful collaboration
  3. Issue Tracker: https://github.com/intellistream/sage-examples/issues

Adding Examples

  1. Tutorials: Add to SAGE/tutorials
  2. Applications:
    • Implementation โ†’ apps/src/sage/apps/your_app/
    • Entry script โ†’ examples/run_your_app.py
  3. Tests: Add tests and ensure they pass
  4. Dependencies: Update pyproject.toml

๐Ÿ”— Related Repositories

๐Ÿ“„ License

MIT License - see LICENSE for details.

๐Ÿ™‹ Getting Help

  • GitHub Issues: Bug reports and feature requests
  • GitHub Discussions: Questions and community support
  • GitHub Copilot: Use "SAGE Examples Assistant" chat mode

๐ŸŒŸ Star History

If you find this project helpful, please consider giving it a โญ๏ธ!


Made with โค๏ธ by the IntelliStream Team

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

isage_examples-0.1.1.4.tar.gz (37.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

isage_examples-0.1.1.4-py2.py3-none-any.whl (23.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file isage_examples-0.1.1.4.tar.gz.

File metadata

  • Download URL: isage_examples-0.1.1.4.tar.gz
  • Upload date:
  • Size: 37.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for isage_examples-0.1.1.4.tar.gz
Algorithm Hash digest
SHA256 6c8f15be4af40a2ecb5517fc087b12c867ea58a220bc2779c30a8169e6c78182
MD5 3c727c531567c1d82cf82ce5c57a5d54
BLAKE2b-256 d7def4e466baad8eedc1e354a73ae5983baa9f2fc7b8b6361acac2d397191913

See more details on using hashes here.

File details

Details for the file isage_examples-0.1.1.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for isage_examples-0.1.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 154dfc2eced9ff61ebfef69eb20e2c4b9f0252a4adf831ac80491278c7109246
MD5 e1bb2c233c71bb6ea37c11f17bb2904a
BLAKE2b-256 f78d66dfa79c0da6b1ba988d8e9685389869bf0e5fde4344f5a69ee8e9d8d31f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page