Package: ai-symphony

All packages Open in Cursor /Users/friedrichstr/ai-mac-studio/agents/infrastructure/ai-symphony
Status
Description: > *Orchestrate AI instruction pipelines with elegance and power*
Port: —
Venv: venv present /Users/friedrichstr/ai-mac-studio/agents/infrastructure/ai-symphony/.venv/bin/python
Git: git main — 2026-03-14 chore: initial commit (ai-platform v2 git infrastructure)
File tree
ai-symphony/
  ai-instruction/
    analysis/
    basic/
    dialog/
    publication/
    text/
    translation/
  docs/
    {api}/
    api-reference.md
    architecture.md
    examples.md
    installation.md
    quickstart.md
  examples/
    advanced/
    analysis/
    basic/
    multi_model/
    real_world/
    text_processing/
  examples-doc/
    advanced/
    analysis/
    basic/
    multi_model/
    text_processing/
    _quarto.yml
    ai-reporter-example.qmd
    index.qmd
    quickstart-example.qmd
    quickstart-fixes.md
    quickstart-summary.md
    styles.css
  output/
    transcript_publication/
  report/
  src/
    ai_symphony/
  test-reports/
  tests/
  AGENTS.md
  CHANGELOG.md
  CONTRIBUTING.md
  LICENSE
  MANIFEST.in
  PLAN.md
  PROJECT.yaml
  pyproject.toml
  README.md
  REFACTORING_COMPLETE.md
  requirements.txt
  setup.py
  test_ai_symphony.py
  uv.lock
Project Goaldraft

[DRAFT — edit this] A general-purpose package for processing chains of AI-powered instructions with variable substitution Inferred stage: development. Define the specific deliverable, success state, and timeline.

Success criteria:
  • [DRAFT] Define 3–5 checkable criteria for project completion
Code/Users/friedrichstr/ai-mac-studio/agents/infrastructure/ai-symphony
Docs/Users/friedrichstr/ai-mac-studio/agents/infrastructure/ai-symphony/docs
Tests/Users/friedrichstr/ai-mac-studio/agents/infrastructure/ai-symphony/tests
Path & Service Checks
CheckPathStatusDetail
code/Users/friedrichstr/ai-mac-studio/agents/infrastructure/ai-s✓ ok27 items, last_modified=2026-08-24
docs/Users/friedrichstr/ai-mac-studio/agents/infrastructure/ai-s✓ ok6 items, last_modified=2026-08-14
tests/Users/friedrichstr/ai-mac-studio/agents/infrastructure/ai-s? emptyempty directory, last_modified=2025-09-11
Documentation
Dependencies
Used by:
README

🎼 AI Symphony

Orchestrate AI instruction pipelines with elegance and power

Python 3.8+ License: MIT

AI Symphony is a powerful orchestration framework for chaining AI-powered instructions with seamless variable substitution and multi-model support. Create sophisticated AI workflows that combine multiple processing steps into cohesive, intelligent pipelines.

✨ Key Features

  • 🤖 Multi-Model Support - Works with Gemini, Claude, OpenAI, Ollama, and Groq
  • 🔗 Seamless Handshake - Automatic variable passing between pipeline steps
  • 📝 Uniform Syntax - Consistent {{variable}} template format across all instructions
  • 🎯 Flexible Mapping - Custom variable mapping between steps without template modification
  • 🛡️ Error Recovery - Robust error handling and pipeline continuation options
  • 📋 YAML Configuration - Declarative pipeline definitions for complex workflows
  • 🔍 Template Validation - Built-in validation for template variables and pipeline configuration
  • 📊 Progress Tracking - Real-time pipeline execution monitoring and metrics

🚀 Quick Start

Installation

pip install ai-symphony

Basic Usage

from ai_symphony import AISymphony

# Initialize with your instruction templates directory
symphony = AISymphony(instruction_dir="ai-instruction")

# Run a single instruction
result = symphony.run_instruction(
    instruction_file="analyze_text.j2",
    variables={"input": "Your text here", "focus": "main_points"}
)

print(result)

Pipeline Example

# Define a multi-step pipeline
steps = [
    {
        "name": "extract",
        "instruction_file": "extract_facts.j2",
        "temperature": 0.1
    },
    {
        "name": "analyze", 
        "instruction_file": "analyze_facts.j2",
        "variables": {"analysis_type": "comprehensive"},
        "temperature": 0.3
    },
    {
        "name": "summarize",
        "instruction_file": "create_summary.j2",
        "variables": {"max_sentences": "3"}
    }
]

# Execute the pipeline
result = symphony.execute_pipeline(
    steps=steps,
    initial_input="Your document content...",
    pipeline_name="document_analysis"
)

if result.success:
    print("Final output:", result.final_output)
    print(f"Completed in {result.total_duration_seconds:.1f} seconds")

YAML Configuration

# pipeline.yaml
name: "content_processor"
description: "Process and enhance content through AI pipeline"
continue_on_error: false
enable_handshake: true

steps:
  - name: "extract_key_points"
    instruction_file: "extract_points.j2"
    temperature: 0.2

  - name: "enhance_content"
    instruction_file: "enhance_writing.j2"
    variables:
      style: "professional"
      tone: "engaging"
    temperature: 0.4
# Execute YAML pipeline
result = symphony.execute_pipeline_from_yaml("pipeline.yaml")

🎯 Use Cases

📝 Content Processing

  • Document summarization and analysis
  • Language translation and localization
  • Writing enhancement and style transformation
  • Content generation and editing workflows

🔍 Data Analysis

  • Sentiment analysis and classification
  • Information extraction from unstructured data
  • Pattern recognition and insight generation
  • Multi-step analytical workflows

🤖 AI Workflow Automation

  • Multi-model AI chains for complex tasks
  • Fallback strategies and error recovery
  • Dynamic pipeline generation
  • Batch processing with consistent quality

🏢 Enterprise Integration

  • Document processing pipelines
  • Customer support automation
  • Content moderation workflows
  • Research and analysis automation

🏗️ Architecture

AI Symphony is built around several core components:

  • 🎼 AISymphony Core - Main orchestrator coordinating all components
  • 📝 Composer - Template engine with uniform variable substitution
  • 🔄 Pipeline Executor - Manages multi-step pipeline execution with handshake mechanisms
  • 🤝 Handshake Manager - Enables flexible variable mapping between steps
  • 🔌 Client System - Unified interface for multiple AI providers
  • ✅ Validation System - Template and pipeline configuration validation

📚 Documentation

  • 📖 Quick Start Guide - Get up and running in minutes
  • 🏗️ Architecture Overview - Understand how AI Symphony works
  • 🎯 Examples Collection - Comprehensive examples and case studies
  • 📋 API Reference - Detailed API documentation

🌟 Examples

Explore our comprehensive example collection:

  • 🚀 Basic Examples - Learn the fundamentals
  • 📝 Text Processing - Document manipulation workflows
  • 🔍 Analysis & Insights - Extract insights from data
  • 🔄 Multi-Model Workflows - Leverage multiple AI providers
  • ⚡ Advanced Techniques - Push the boundaries

🛠️ Supported AI Providers

Provider Status Models
Google Gemini ✅ Gemini Pro, Gemini Flash
Anthropic Claude ✅ Claude 3 Sonnet, Claude 3 Haiku
OpenAI ✅ GPT-4, GPT-3.5 Turbo
Ollama ✅ Llama 2, Mistral, CodeLlama
Groq ✅ Llama 2 70B, Mixtral 8x7B

⚙️ Configuration

Set up your AI provider API keys:

# Choose one or more providers
export GEMINI_API_KEY="your-gemini-key"
export ANTHROPIC_API_KEY="your-claude-key"  
export OPENAI_API_KEY="your-openai-key"
export GROQ_API_KEY="your-groq-key"
# Ollama runs locally, no API key needed

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

# the repository is not published; the code lives in ~/ai-mac-studio/agents/infrastructure/ai-symphony
cd ai-symphony
pip install -e ".[dev]"

Running Tests

python test_ai_symphony.py

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Built with ❤️ by Gerd Graßhoff
  • Inspired by the need for elegant AI workflow orchestration
  • Thanks to all contributors and the AI community

🔗 Links


Ready to orchestrate your AI workflows? Start with our Quick Start Guide and join the AI Symphony! 🎼

Recent commits
SHADateSubject
56b2b482026-03-14chore: initial commit (ai-platform v2 git infrastructure)