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

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

isage_examples-0.1.1.1-py3-none-any.whl (35.8 kB view details)

Uploaded Python 3

isage_examples-0.1.1.1-py2.py3-none-any.whl (35.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file isage_examples-0.1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for isage_examples-0.1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e56f9c2a884c6f07f88d8db1125518be8adb25911f8cd579baf33ceb281bf371
MD5 058046f7b8fccfdd48f32a97a3159e45
BLAKE2b-256 3738fd0ac1842fa564682f607df7ca7b30f203964285f77d75e3eb425c55dbb6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for isage_examples-0.1.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2fc549f574f03089da0437f90c2b41fc1006aa04d80a1376d17cb87d9a28c2ce
MD5 7829612bcf834316adef8c5c0b2ec6bf
BLAKE2b-256 ee348c305e761349cc067e5416e93dd54da0acf4735af524646c9097f7acb961

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