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 Distribution

isage_examples-0.1.1.2.tar.gz (27.4 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.2-py2.py3-none-any.whl (29.5 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for isage_examples-0.1.1.2.tar.gz
Algorithm Hash digest
SHA256 939b08055f06828eb34547d3569a3b7cd4a7e4ceb4912abef308d80af7dabdf4
MD5 4e1c5b0fef0bd6e6dd24f415fb1a7367
BLAKE2b-256 00a7f293ac2b312ff45c6d0a5299c5da1b882ae6baa0b01c3db4ce671396de52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for isage_examples-0.1.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5c093c9090f3d58a6e2a9d5086dfc6c9ba03e096b973a7a79f3170bacce62b2b
MD5 ac8726560c7a37840726d25b64e7c2f6
BLAKE2b-256 a7b7d48b95c6a0ccecd0486af0b64cc4f264a9e99b5b949af822624c8fbfc600

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