You love working with AI assistants - writing instructions in plain text, having natural conversations, getting quick results. But sometimes you need more:
- Want to run the same workflow reliably, again and again?
- Need to process data from multiple sources first?
- Want precise control over how the AI thinks?
- Need to integrate with your existing tools?
That's where this framework comes in. It helps you transform your text-based AI workflows into Python code that:
- Runs independently of any AI assistant
- Uses proven open-source libraries
- Gives you complete control over execution
- Adapts to your needs
-
Python Environment
- Python 3.10 or higher
- Poetry (package manager)
-
API Access to AI Models
- You can for example create a free account at Groq and generate an API key
See the FAQ Analysis example for a complete working example.
-
Get the Code
- Clone the repository:
git clone https://github.com/cbardyn/ai-swiss-workflows
- Navigate to package:
cd _ai_workflows_packages/ai_workflows
- Clone the repository:
-
Install Dependencies
- Install with Poetry:
poetry install
- Activate environment:
- Linux/macOS:
source .venv/bin/activate
- Windows:
.\.venv\Scripts\activate
- Linux/macOS:
- Install with Poetry:
-
Verify Installation
- Try running an example:
cd ../../_ai_workflows/code_based/faq_analysis/_code && python run.py
- Try running an example:
Create three main files in your project directory:
- config.yaml (AI configuration)
- instructions.yaml (Your workflow tasks)
- run.py (Python runner)
In instructions.yaml, define:
- Your workflow goal
- Tasks to perform
- Input files to analyze
- Output files to generate
Pro tip: Start with a text-based workflow in instructions_v1.0.0.md and use your AI assistant to convert it to YAML format.
In config.yaml, specify:
- Your AI model choice (e.g., Groq's LLaMA)
- Your API key
- Model parameters (temperature, etc.)
In run.py, use the framework to:
- Set up logging
- Load your configuration
- Execute your workflow
Simply execute: python run.py
- Check the FAQ Analysis example for a complete working example
- Review the code-based workflows tutorial
The framework automatically:
- Loads files and URLs
- Creates searchable vector databases
- Finds relevant information for each task
The framework handles:
- Task sequencing
- Information passing between tasks
- Progress tracking
Built-in handling for:
- Missing files
- API failures
- Invalid configurations
- More connectors to external systems (Dropbox, Google Drive, etc.)
- Better testing: No automated tests yet to ensure everything works perfectly
- Better security: API keys are stored in simple text files
- Better performance: Tasks run one after another instead of in parallel
- Better reliability: No backup AI models if the main one fails
- Better data safety: No automatic backups of your data
- Better monitoring: Can't track how well the system performs
- And more!