Skip to content

intellistream/sage-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

86 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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
🧭 Patent Landscape Mapper Patent clustering and whitespace opportunity mapping examples/run_patent_landscape_mapper.py
πŸŽ“ Student Improvement Stateful learning diagnosis and score improvement MVP examples/run_student_improvement.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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors