Aroha-Labs / mira-sdk-python

0 stars 1 forks source link

[SDK] Flow Builder Epic #10

Closed happie-chappie closed 1 month ago

happie-chappie commented 1 month ago

Overview

The flow builder part of the SDK is a comprehensive system that allows developers to design, build, and test flows. It provides a structured process for defining flow details, input parameters, multiple components, and output parameters. The system allows for local testing and editing, offering a seamless experience from initial design to functional implementation.

User Story

As a developer, I want to create and test complex flows in a single, intuitive interface so that I can quickly design and implement AI-powered solutions for my applications.

User Journey

┌─────────────────────────────────────────────────────────────────────┐
│                          Start Flow Creation                        │
└───────────────────────────────────┬─────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────┐
│                         Define Flow Details                         │
│  ┌───────────────┐ ┌────────────────────┐ ┌────────────────┐        │
│  │   Flow Name   │ │ Flow Description   │ │  Flow Version  │        │
│  └───────────────┘ └────────────────────┘ └────────────────┘        │
│  ┌───────────────────────────────────────────────────────────────┐  │
│  │                         Flow Privacy                          │  │
│  └───────────────────────────────────────────────────────────────┘  │
└───────────────────────────────────┬─────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────┐
│                          Define Flow Input                          │
│  ┌───────────────┐    ┌────────────────────┐    ┌────────────────┐  │
│  │ Parameter Name│    │     Description    │    │     Format     │  │
│  └───────────────┘    └────────────────────┘    └────────────────┘  │
└───────────────────────────────────┬─────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────┐
│                         Build Components                            │
│  ┌───────────────────────────────────────────────────────────────┐  │
│  │                      For Each Component:                      │  │
│  │  ┌─────────────────────────┐  ┌────────────────────────────┐  │  │
│  │  │    Input Parameters     │  │          Prompt            │  │  │
│  │  │ - Name                  │  │ - Type system prompt       │  │  │
│  │  │ - Reference (Flow input │  └────────────────────────────┘  │  │
│  │  │   or Component output)  │  ┌────────────────────────────┐  │  │
│  │  └─────────────────────────┘  │           Model            │  │  │
│  │  ┌─────────────────────────┐  │ - Specify model to use     │  │  │
│  │  │      Data (Optional)    │  └────────────────────────────┘  │  │
│  │  │ - Reference dataset     │  ┌────────────────────────────┐  │  │
│  │  │   from data manager     │  │     Output Parameter       │  │  │
│  │  └─────────────────────────┘  │ - Name output parameter    │  │  │
│  │                               └────────────────────────────┘  │  │
│  └───────────────────────────────────────────────────────────────┘  │
└───────────────────────────────────┬─────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────┐
│                         Define Flow Output                          │
│  ┌───────────────────────┐    ┌────────────────────────────────┐    │
│  │ Output Parameter Name │    │ Reference (Component Output)   │    │
│  └───────────────────────┘    └────────────────────────────────┘    │
└───────────────────────────────────┬─────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────┐
│                         Test Locally                                │
│  Execute flow in the flow file locally using a single CLI command   │
└───────────────────────────────────┬─────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────┐
│                         Edit Locally                                │
│  Edit flow in one file before testing again                         │
└───────────────────────────────────┬─────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────┐
│                         End Flow Creation                           │
└─────────────────────────────────────────────────────────────────────┘

Elements

Element Sub Element Description
Defining flow details Flow name Feature to type out the flow name
  Flow description Feature to type out the flow descriptiion
  Flow version Feature to type of flow version
  Flow privacy Privte/public
Defining flow input - Feature to define the input parameters for the flow
Name of input parameter    
Description of inout parameter    
Format of inut parameter (string, number, date[dd/mm/yy])    
Building components - Feature to define each component, user may build N number of components
  Adding input parameters Feature to define all the input parameters and their reference
name of input parameter    
reference of that parameter (what that value corelates to, it can be a flow input or output of another component)    
  Adding Prompt Feature to just type out each prompt within the component, this pormopt will be used as the sytem propmt for that component
  Adding Model Feature to type out model for each component
  Linking Data (optional) Feature to type out the data set reference stored in the data manager.
This indexed data, is automatically used as a RAG system for that component.    
  Adding output parameter Feature to add the output parameter for the component -
Output parameter name    
     
Defining flow output   Feature to define flow output parameters(one flow can have multiple outputs) -
Name of output parameter    
Reference of thaty parameter (this can be the output of any component)    
Test locally - Functionality to test the flow in the flow file locally by a single command
Editing locally - Functionality to edit the flow then and there in one file before testing it again

Structure of Each flow :

Tasks