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
๐Ÿ“š Literature Recommendation Personalized scientific paper recommendation examples/run_literature_report_assistant.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.19.tar.gz (35.5 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.19-py2.py3-none-any.whl (20.3 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: isage_examples-0.1.1.19.tar.gz
  • Upload date:
  • Size: 35.5 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.19.tar.gz
Algorithm Hash digest
SHA256 c4acbd393d85672c729e167a38541a394796c103ee0d585c354724594e5e5614
MD5 a69834f1ed35531c368db4e4a1328411
BLAKE2b-256 7562854635c24124e95789a1b2ee44a9526c694c9e95f8d363340c304d918410

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for isage_examples-0.1.1.19-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4fef144c84494174b8717a0347069025f4efedec7986921a7ce40307e755ffb4
MD5 9c1bf1ae8b2d9e4ff0d1b10a20f2b082
BLAKE2b-256 398b0fbfd8bff0eec3d6f868c89e0f3b6012e79725bf08d26bdae909902021c4

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