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.6.tar.gz (34.2 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.6-py2.py3-none-any.whl (19.5 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: isage_examples-0.1.1.6.tar.gz
  • Upload date:
  • Size: 34.2 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.6.tar.gz
Algorithm Hash digest
SHA256 e91e91720de99a8b4a28c636ea9687ab973bfef9f2a88bbdac449a4d879684ec
MD5 6b194313fb6af9ed2ed901a01d8fce49
BLAKE2b-256 35509bf338a9671548fccfd7ac3b80ef01c9583d4ff47e63759c90dd17ec63ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for isage_examples-0.1.1.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d520aa553c89a858645c94c425e0b6c84a0e1cd83da93d1e77ea5214898ecbf0
MD5 45ac7a4a7d5f6cb11214cd7d95c12463
BLAKE2b-256 54080614166fbcb0a86975e483e6945c4a08ae1510fc01e86fe4fc4c54bb1aa3

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