Skip to content

Triplets Module

Total files documented: 26


triplets/main.py

Purpose

This file, triplets/main.py, initializes a FastAPI application and includes various routers for different API endpoints. It serves as the entry point for the Process & Deadline API.

Key Responsibilities

  • Initialize a FastAPI application
  • Include routers for different API endpoints
  • Configure CORS middleware for cross-origin resource sharing

Important Functions

  • app = FastAPI(title="Process & Deadline API"): Initializes the FastAPI application with a title.
  • app.add_middleware(CORSMiddleware, ...): Configures CORS middleware for cross-origin resource sharing.
  • app.include_router(...): Includes routers for different API endpoints.

Important Classes

None

System Fit

This file fits into the wider 3-Cubed Python system as the entry point for the Process & Deadline API. It initializes the FastAPI application and includes various routers for different API endpoints, which are likely used to interact with the system's data and functionality. The routers included in this file are: * Process Validation * Deadline Analysis * Project Validation * Project Validation new * NER Replacement * Process Optimization * Rework Optimization * Triplets (subindustry, subfunction, and main triplets)


triplets/models.py

Purpose

This file defines a set of Pydantic models for the 3-Cubed Python system. These models represent various entities such as control activities, risks, objectives, and project data.

Key Responsibilities

  • Define Pydantic models for various entities in the 3-Cubed system
  • Provide validation and data processing functionality through model validators
  • Enable data serialization and deserialization using Pydantic's built-in features

Important Functions

  • calculate_actual_finish: Calculates the actual finish time of an activity based on its start time and AHT (Average Handling Time)
  • calculate_delay_type: Determines the type of delay (Bottleneck, Out of Office, or None) based on the activity's delay and actor presence

Important Classes

  • ControlEffectiveness: Represents the effectiveness of a control activity, including its score, coverage, team segregation, and timeliness
  • ControlActivity: Represents a control activity, including its ID, control type, efficacy, and effort
  • Risk: Represents a risk, including its ID, name, and associated control activities
  • ControlObjective: Represents a control objective, including its ID, text, and associated risks
  • LOD: Represents a Line of Defense, including its objective, risk, and level of defense
  • Form, BR, Product, Activity, Arrow, Team, SchedData, pActor, Peak, ReworkStructure, ProjectData: Represent various entities in the 3-Cubed system, including forms, business requirements, products, activities, arrows, teams, scheduled data, actors, peaks, rework structures, and project data

System Fit

This file is a key component of the 3-Cubed Python system, providing a structured and validated representation of various entities and data. The models defined in this file enable data serialization and deserialization, as well as validation and data processing through model validators. The calculate_actual_finish and calculate_delay_type functions provide additional functionality for processing scheduled data.


triplets/project_validation_new.py

Purpose

This file, project_validation_new.py, is responsible for validating business processes and determining whether they should be modeled as a single project or split into multiple projects. It utilizes the CrewAI framework to analyze process graphs and apply business modeling best practices.

Key Responsibilities

  • Validate business processes using CrewAI agents
  • Determine whether a process map is cohesive and well-formed for modeling as a single project or needs to be split
  • Analyze process graphs to identify industry, sub-industry, and function group
  • Apply business modeling best practices rigorously

Important Functions

  • create_subgraph_model: Generates a subgraph model from activities and arrows in the input project data.
  • prepare_all_inputs: Prepares all necessary inputs for the process validation and classification tasks.
  • run_process_validation_crew: Runs the process validation and classification tasks using the CrewAI framework.

Important Classes

  • Process_Classification: Represents the classification of a business process, including industry, sub-industry, and function group.
  • ProjectSplitSuggestion: Represents a suggested split project, including project name, activities, and industry information.
  • ModelValidationOutput: Represents the output of the process validation task, including decision, rational, and splits.
  • ProcessActivity: Represents an activity in a business process, including ID, name, type, and team ID.
  • Team: Represents a team responsible for an activity, including actor ID and actor name.
  • Arrow: Represents an arrow in a process graph, including predecessor and successor activity IDs.
  • GraphNode: Represents a node in a subgraph, including ID and name.
  • GraphEdge: Represents an edge in a subgraph, including predecessor and successor node IDs.
  • GraphModel: Represents a full subgraph model, including nodes and edges.
  • ProjectData: Represents full project data, including industry, sub-industry, activities, teams, and arrows.

System Fit

This file fits into the wider 3-Cubed Python system by utilizing the CrewAI framework to analyze business processes and apply business modeling best practices. The project_validation_new.py file is responsible for validating business processes and determining whether they should be modeled as a single project or split into multiple projects. The output of this file is used to inform the modeling process and ensure that business processes are well-defined, manageable, and logically integrated for optimal AI modeling.


triplets/project_validator.py

Project Validator

======================

Purpose


This file contains the implementation of a project validator using FastAPI and CrewAI. It evaluates the suitability of a process map as a single project or recommends splitting it into multiple projects based on specific criteria.

Key Responsibilities


  • Evaluate process maps for suitability as a single project
  • Identify irrelevant activities and suggest alternative industries
  • Provide reasoning and recommendations for project structure

Important Functions


  • run_project_suitability_crew: The main function that orchestrates the project validation process

Important Classes


  • IrrelevantActivity: Represents an activity that is not relevant to the industry, including its ID, name, and suggested industry
  • ProjectSuitabilityOutput: The output model containing the project suitability decision, reasoning, recommendation, and irrelevant activities

System Fit


This file is part of the 3-Cubed Python system, which uses FastAPI and CrewAI to provide a project validation API. The project validator is responsible for evaluating process maps and providing recommendations for project structure, which can be used to inform modeling decisions within the 3-Cubed platform.


triplets/triplets.py

triplets/triplets.py

Purpose

This file provides functionality for processing and validating project data using CrewAI. It includes classes and functions for loading project data, building subgraph models, and running process classification tasks.

Key Responsibilities

  • Load project data from a JSON file
  • Build subgraph models from project data
  • Run process classification tasks using CrewAI
  • Validate project data using triplets data

Important Functions

  • create_subgraph_model: Generates a subgraph model from project data
  • prepare_inputs: Prepares inputs for process classification tasks
  • process_validation_agent: Not clear from code
  • model_validation_task: Not clear from code
  • project_validation_crew: Not clear from code

Important Classes

  • ProcessActivity: Represents an activity in a process
  • Team: Represents a team responsible for an activity
  • Arrow: Represents a relationship between activities
  • GraphNode: Represents a node in a graph
  • GraphEdge: Represents an edge in a graph
  • GraphModel: Represents a graph model
  • ProjectData: Represents project data
  • SubIndustryFunctionOption: Represents a sub-industry and function option
  • ProjectValidationOutput: Represents the output of a project validation task
  • ProcessClassificationCrew: A CrewAI crew for process classification tasks

System Fit

This file is part of the 3-Cubed Python system, which uses CrewAI for process classification tasks. The ProcessClassificationCrew class is a CrewAI crew that uses the prepare_inputs function to prepare inputs for process classification tasks. The create_subgraph_model function is used to build subgraph models from project data, which are then used in process classification tasks. The project_validation_crew function is not clear from code, but it is likely used to validate project data using triplets data.


triplets/tripletsfun.py

Purpose

This file, triplets/tripletsfun.py, contains functions and classes for creating subgraph models, preparing inputs for function prediction, and predicting functions based on project data.

Key Responsibilities

  • Create subgraph models from project data
  • Prepare inputs for function prediction tasks
  • Predict functions based on project data and industry/subindustry filters
  • Validate project data and industry/subindustry inputs

Important Functions

create_subgraph_model

Creates a subgraph model from project data, including nodes and edges.

prepare_inputs

Prepares inputs for function prediction tasks, including filtering functions from JSON data and resolving industry and subindustry casing.

function_prediction_agent

Not clear from code.

function_prediction_task

Not clear from code.

function_prediction_crew

Not clear from code.

run_function_prediction

Not clear from code.

Important Classes

ProcessActivity

Represents a process activity with ID, name, type, and team ID.

Team

Represents a team with actor ID and actor name.

Arrow

Represents an arrow with predecessor and successor IDs.

GraphNode

Represents a graph node with ID and name.

GraphEdge

Represents a graph edge with predecessor, successor, and decision percentage.

GraphModel

Represents a graph model with nodes and edges.

ProjectData

Represents project data with activities, teams, and arrows.

FunctionReq

Represents a function request with industry, subindustry, and project data.

FunctionResult

Represents a function result with resolved industry, subindustry, and function.

FunctionAssignment

Represents a function assignment with predicted function, confidence, and activity IDs.

FunctionPredictionResult

Represents a function prediction result with mode, rationale, single function, and multiple functions.

FunctionalCrew

Represents a functional crew with prepare inputs method.

System Fit

This file fits into the wider 3-Cubed Python system by providing functions and classes for creating subgraph models, preparing inputs for function prediction tasks, and predicting functions based on project data. It is likely used in conjunction with other components of the system to provide a comprehensive solution for function prediction and project analysis.


triplets/tripletssub.py

Purpose

This file, triplets/tripletssub.py, is responsible for analyzing the effort in a process and identifying the different reasons for the effort within a specific industry. It utilizes CrewAI's project framework to create a crew that can perform sub-industry analysis.

Key Responsibilities

  • Prepare inputs for the sub-industry analysis
  • Analyze the effort in a process and identify the different reasons for the effort
  • Select exactly three sub-industries that best fit the activity context
  • Return a validated Pydantic object of type SubindustryTop3Result

Important Functions

  • prepare_inputs: Expects industry and activities as input, and returns a dictionary with the industry, activities, and sub-industries.
  • subindustry_analyst: Returns an Agent that specializes in mapping operational activity signals to business sub-sectors.
  • subindustry_task: Returns a Task that selects exactly three sub-industries that best fit the activity context.

Important Classes

  • ActivityMini: A Pydantic model representing a mini activity with id and name.
  • SubindustryRequest: A Pydantic model representing a request for sub-industry analysis with industry and activities.
  • SubindustryTop3Result: A Pydantic model representing the result of sub-industry analysis with resolved industry and top three sub-industries.
  • UndesiredSolutionCrew: A Crew that performs sub-industry analysis.

System Fit

This file fits into the wider 3-Cubed Python system by utilizing CrewAI's project framework to create a crew that can perform sub-industry analysis. The crew is designed to work with the triplets module, which is responsible for generating triplets for sub-industry analysis. The triplets/tripletssub.py file is a key component of the system, as it provides the necessary functionality for sub-industry analysis.


triplets/analysis/control_analysis.py

Purpose

This file, control_analysis.py, is responsible for analyzing control efficacy in a project. It computes the efficacy of controls in terms of Coverage, Segregation, and Timeliness, and populates objectives, risks, and controls with this computed efficacy.

Key Responsibilities

  • Compute control efficacy for a given control
  • Populate objectives, risks, and controls with computed control efficacy
  • Compute lines of defense for objectives and risks

Important Functions

compute_control_efficacy

Computes the efficacy of a control in terms of Coverage, Segregation, and Timeliness.

  • Parameters:
    • project_graph: The project graph
    • control_data: The control data
    • objective: The objective
    • activity_dict: The activity dictionary
  • Returns: A ControlEffectiveness object with computed efficacy scores

populate_objectives

Populates objectives, risks, and controls with computed control efficacy.

  • Parameters:
    • project_data: The project data
    • activity_dict: The activity dictionary
    • project_graph: The project graph
  • Returns: A list of populated ControlObjective objects

compute_lines_of_defense

Computes lines of defense for objectives and risks in project_data.

  • Parameters:
    • project_data: The project data
  • Returns: A list of lines of defense

System Fit

This file fits into the wider 3-Cubed Python system by providing functionality for analyzing control efficacy and populating objectives, risks, and controls with this computed efficacy. It is likely used in conjunction with other files in the system to provide a comprehensive view of project controls and risks.


triplets/analysis/graph_utils.py

Purpose

This file, graph_utils.py, contains utility functions for working with directed graphs, specifically in the context of project analysis. It provides functions for creating project graphs, computing start and end nodes, performing modified depth-first searches, and computing all possible paths in a project graph.

Key Responsibilities

  • Creating directed graphs from project data
  • Computing start and end nodes for directed graphs
  • Performing modified depth-first searches on graphs
  • Computing all possible paths in a project graph
  • Converting between Pydantic graph models and NetworkX graphs

Important Functions

  • create_project_graph(project_data): Creates a directed graph from project data.
  • compute_start_and_end_nodes(G): Computes start nodes (nodes with no predecessor) and end nodes (nodes with no successor) for a directed graph.
  • modified_dfs(G): Performs a modified depth-first search on a graph, ensuring all nodes are visited and computing start and end nodes for directed graphs.
  • compute_paths(graph): Computes all possible paths in a project graph.
  • pydantic_to_networkx(graph_model): Converts a Pydantic graph model to a NetworkX graph.
  • networkx_to_pydantic(graph): Converts a NetworkX graph to a Pydantic graph model.

Important Classes

None

System Fit

This file fits into the wider 3-Cubed Python system as part of the triplets package, which is responsible for analyzing project data. The functions in this file are designed to work with the GraphModel and GraphNode classes from the models1.project_models module, which are used to represent project data in a Pydantic format. The file also uses the networkx library to work with directed graphs.


triplets/analysis/path_analysis.py

Purpose

This file, path_analysis.py, is responsible for analyzing project graphs to compute all possible risk paths. It filters these paths based on key nodes, which are critical activities in the project.

Key Responsibilities

  • Analyze project graphs to identify potential risk paths
  • Filter risk paths based on key nodes
  • Return a list of risk paths containing key nodes

Important Functions

compute_risk_paths(graph, key_nodes)

This function computes all possible risk paths in the project graph, filtered by key nodes. It takes two arguments: * graph: A NetworkX directed graph representing the project. * key_nodes: A set of nodes (key activities) to filter paths. The function returns a list of paths containing key nodes.

Important Classes

None

System Fit

This file fits into the wider 3-Cubed Python system by providing a critical analysis component for project graphs. It is likely used in conjunction with other components to identify and mitigate potential risks in project planning and execution. The output of this file can be used to inform decision-making and resource allocation in project management.


triplets/analysis/rework_analysis.py

Purpose

This file, rework_analysis.py, is responsible for analyzing project data to identify key decision nodes and compute rework structures within a project's workflow.

Key Responsibilities

  • Identify key decision nodes responsible for loops and forward flow within a strongly connected component (SCC) of a project's workflow graph.
  • Compute ReworkStructures for a given project, including:
    • Identifying SCCs that represent rework loops
    • Determining key decision nodes within each SCC
    • Calculating rework volume, effort, and cycle time for each SCC

Important Functions

  • identify_decision_nodes(graph: nx.DiGraph, rw: List[int], activity_dict: dict, arrow_dict: dict): Identifies key decision nodes within a given SCC.
  • compute_rework_structures(project_data, sched_data, activity_dict, arrow_dict): Computes ReworkStructures for a given project.

Important Classes

None

System Fit

This file is part of the wider 3-Cubed Python system, which appears to be a project management and workflow analysis tool. The rework_analysis.py file is likely used in conjunction with other modules to analyze project data and provide insights into workflow efficiency and rework loops. The output of this file, ReworkStructures, is likely used to inform project management decisions and optimize workflow processes.


triplets/analysis/team_peak_analysis.py

Purpose

This file, team_peak_analysis.py, is part of the 3-Cubed Python system and is responsible for analyzing team peaks based on scheduling data. It calculates various metrics, including peak hours, effort per hour, and activity metrics.

Key Responsibilities

  • Populate pActor objects based on scheduling data and calculate Min_FTE.
  • Identify peak hours for a team based on scheduling data.
  • Find tasks causing attendance for an actor.
  • Identify tasks performed during peak hours for a team.
  • Calculate effort per hour for tasks during peak times.
  • Update activity metrics based on scheduling data.
  • Analyze peak hours for all teams in a project and compute peak-related metrics.

Important Functions

  • populate_pactors: Populates pActor objects and calculates Min_FTE.
  • identify_peaks: Identifies peak hours for a team based on scheduling data.
  • tasks_causing_attendance: Finds the task causing the earliest attendance for an actor.
  • tasks_during_peaks: Identifies tasks performed during peak hours for a team.
  • calculate_effort_per_hour: Calculates effort per hour for tasks during peak times.
  • update_activity_metrics: Updates activity metrics based on scheduling data.
  • analyze_team_peaks: Analyzes peak hours for all teams in a project and computes peak-related metrics.

Important Classes

None

System Fit

This file is part of the 3-Cubed Python system and is used to analyze team peaks based on scheduling data. It is likely used in conjunction with other files in the system to provide insights into team performance and scheduling. The file uses various data structures and algorithms to calculate metrics and identify peak hours, making it a critical component of the system.


triplets/analysis/__init__.py

Purpose

Unable to read this file content.

Extracted Functions

None found.

Extracted Classes

None found.


triplets/crew_agents/automation_crew.py

Purpose

This file, automation_crew.py, is part of the 3-Cubed Python system and defines a crew of automation agents. These agents are designed to identify opportunities for automation in various activities, using different tools and techniques such as Office macros, Robotic Process Automation (RPA), and Artificial Intelligence (AI)/Machine Learning (ML).

Key Responsibilities

  • Define a crew of automation agents with specific roles and goals.
  • Each agent is responsible for identifying automation opportunities in activities using their respective tools and techniques.
  • Agents use the get_activity_details_tool to fetch activity details from the global activity dictionary.
  • Agents return a dictionary containing information about the activity, including whether it can be automated, the automation strategy, and potential AHT reduction.

Important Functions

  • get_activity_details_tool: A tool that fetches activity details from the global activity dictionary.
  • execute_automation_crew: Not clear from code, as it is not defined in this file.

Important Classes

  • Agent: A class representing an automation agent with specific role, goal, and backstory.
  • Crew: Not clear from code, as it is not defined in this file.

System Fit

This file fits into the wider 3-Cubed Python system by providing a crew of automation agents that can be used to identify opportunities for automation in various activities. The agents are designed to work together to provide a comprehensive view of automation opportunities, using different tools and techniques. The output of the agents can be used to inform business decisions and drive automation initiatives.


triplets/crew_agents/automation_crew_v-1.bak.py

Purpose

This file, automation_crew_v-1.bak.py, is part of the 3-Cubed Python system and is responsible for generating automation recommendations for project activities. It utilizes machine learning and specialized agents to analyze activities and provide feasibility assessments.

Key Responsibilities

  • Generate automation recommendations for project activities
  • Delegate automation analysis tasks to specialized agents based on activity automation type
  • Analyze activities for feasibility using machine learning and AI/ML techniques

Important Functions

generate_automation_recommendations

This function generates automation recommendations for each project activity. It takes a GraphModel and ProjectData as input and returns a list of AutomationAnalysis objects.

delegate_automation_tasks_tool

This function delegates a single automation analysis task to a specialized agent based on the activity's automation type. It takes an activity dictionary as input and returns a string indicating the task delegation status.

Important Classes

Not clear from code.

System Fit

This file fits into the wider 3-Cubed Python system as part of the automation crew. It works in conjunction with other components to analyze project activities and provide automation recommendations. The generate_automation_recommendations function is likely called by a higher-level component, and the delegate_automation_tasks_tool function is used to delegate tasks to specialized agents.

Notes

  • The file uses various machine learning and AI/ML techniques to analyze activities and provide feasibility assessments.
  • The delegate_automation_tasks_tool function uses a dictionary to map automation types to specialized agents and tasks.
  • The file uses Pydantic models to represent activity data and automation analysis results.

triplets/crew_agents/automation_crew_v-2.bak.py

Purpose

This file, automation_crew_v-2.bak.py, is part of the 3-Cubed Python system and is responsible for generating automation recommendations for project activities. It utilizes machine learning models and specialized agents to analyze activities and provide specific automation strategies.

Key Responsibilities

  • Generate automation recommendations based on project activities
  • Delegate automation analysis tasks to specialized agents
  • Utilize machine learning models to analyze activities and provide automation strategies

Important Functions

generate_automation_recommendations

This function generates automation recommendations based on project activities. It takes in a GraphModel and ProjectData as input and returns a list of AutomationRecommendations.

  • It first converts the GraphModel to a NetworkX graph using the pydantic_to_networkx tool.
  • It then iterates over the nodes in the graph and generates an AutomationAnalysis object for each activity.
  • The AutomationAnalysis object contains information about the activity, such as its ID, name, AHT, automation type, forms, rules, and systems.
  • It also populates the related activities for each analysis object.
  • Finally, it wraps the list of AutomationAnalysis objects in an AutomationRecommendations object.

delegate_automation_tasks_tool

This function delegates automation analysis tasks to specialized agents based on the automation type. It takes in a dictionary of automation activities as input and returns a string.

  • It reconstructs an AutomationRecommendations object from the input dictionary.
  • It then iterates over the activities in the recommendations and creates a task description for each activity.
  • The task description includes information about the activity, such as its ID, name, AHT, automation type, forms, rules, and systems.
  • It also includes a description of the task, including the automation strategy, feasibility, and AHT reduction.
  • Finally, it returns a string containing the task descriptions.

Important Classes

Not clear from code.

System Fit

This file fits into the wider 3-Cubed Python system by providing a mechanism for generating automation recommendations for project activities. It utilizes machine learning models and specialized agents to analyze activities and provide specific automation strategies.

The file is part of the crew_agents module, which is responsible for providing automation recommendations for project activities. The generate_automation_recommendations function is used to generate recommendations, and the delegate_automation_tasks_tool function is used to delegate tasks to specialized agents.

The file also utilizes the crewai and crewai_tools modules, which provide a framework for building and deploying machine learning models and specialized agents. The networkx library is used to represent the graph of activities, and the pydantic library is used to define the data models for the activities and recommendations.


triplets/crew_agents/crew_llm.py

Purpose

This file, crew_llm.py, initializes and configures various Large Language Models (LLMs) from different providers, including OpenAI, Gemini, and Groq, using the CrewAI library.

Key Responsibilities

  • Load environment variables for API keys and model names
  • Initialize LLM instances with specified models, temperatures, and API keys
  • Handle errors if required environment variables are not set

Important Functions

Not clear from code. This file primarily consists of variable assignments and LLM instance creations.

Important Classes

Not clear from code. This file does not define any custom classes.

System Fit

This file fits into the wider 3-Cubed Python system by providing a centralized location for initializing and configuring LLM instances. These LLM instances can then be used throughout the system for various tasks, such as natural language processing and text generation. The CrewAI library is used to interact with the LLMs, allowing for a standardized interface across different providers.


triplets/crew_agents/digitization_crew v-1.bak.py

Purpose

This file, digitization_crew_v-1.bak.py, is part of the 3-Cubed Python system and is responsible for automating the digitization process of forms in business processes. It uses CrewAI to classify uncertain forms, identify non-digitizable forms, and recommend digitization strategies.

Key Responsibilities

  • Classify uncertain forms using CrewAI
  • Identify non-digitizable forms across activities requiring digitization
  • Recommend digitization strategies for non-digitizable forms
  • Update activities with classification results and digitization recommendations

Important Functions

  • automation_classification: Classifies activities based on their automation status
  • get_unique_uncertain_forms: Finds unique form-mode combinations that need classification
  • classify_uncertain_forms: Runs CrewAI to classify unique form-modes
  • apply_classification_results: Updates activities with classification results
  • get_non_digitized_forms: Finds unique non-automatable forms across activities requiring digitization
  • execute_digitization_crew: Executes CrewAI to determine digitization strategies

Important Classes

None

System Fit

This file fits into the wider 3-Cubed Python system by providing a digitization crew that can be executed to automate the digitization process of forms in business processes. It uses CrewAI to classify uncertain forms, identify non-digitizable forms, and recommend digitization strategies, making it an integral part of the system's automation capabilities.

Notes

  • The execute_digitization_crew function is the main entry point for the digitization crew, and it orchestrates the entire process.
  • The activity_lookup function is a tool used by the digitization agent to fetch details for a given activity ID.
  • The FORM_CLASSIFICATION dictionary is used to classify forms based on their mode.
  • The DigitizationRecommendation and DigitizationRecommendations models are used to store and return digitization recommendations.

triplets/crew_agents/digitization_crew.py

Purpose

This file, digitization_crew.py, is part of the CrewAI project and is responsible for digitization tasks. It provides functions and classes for preparing inputs, processing results, and managing digitization crews.

Key Responsibilities

  • Prepare inputs for digitization tasks
  • Process results from digitization tasks
  • Manage digitization crews and their tasks
  • Integrate with other components of the CrewAI project

Important Functions

  • lookup_activities_by_ids: Retrieves activities from the automation_activities_list based on provided activity IDs.
  • lookup_activity_details: Retrieves details for a given activity.
  • prepare_inputs: Prepares inputs for digitization tasks, including filtering digitized forms and creating a subgraph model.
  • process_results: Processes results from digitization tasks, including merging original and reviewed forms.

Important Classes

  • DigitizationCrew: A class representing a digitization crew, responsible for preparing inputs and processing results.

System Fit

This file fits into the wider 3-Cubed Python system as part of the CrewAI project, which is designed to manage and automate digitization tasks. The digitization_crew.py file interacts with other components of the project, such as the crew_agents module, to provide a comprehensive digitization solution.

Notes

  • The file uses various tools and libraries from the CrewAI project, including Agent, Task, Crew, and Process.
  • The DigitizationCrew class uses the CrewBase class as a base class, indicating that it inherits certain properties and methods from CrewBase.
  • The file uses various data structures, such as dictionaries and lists, to store and manipulate data.
  • The file includes error handling and logging mechanisms to ensure robustness and debugging capabilities.

triplets/crew_agents/digitization_crew_old.py

Purpose

This file, digitization_crew_old.py, is part of the 3-Cubed Python system and is responsible for executing the digitization crew process. It takes in various inputs, including activity IDs, project data, and subgraph models, and outputs digitized forms and automation suggestions.

Key Responsibilities

  • Execute the digitization crew process
  • Get unique attributes from the input data
  • Get digitized forms and automation activities
  • Merge original and digitized forms
  • Update automation activity forms
  • Classify activity automation type
  • Execute automation crew

Important Functions

  • execute_digitization_crew: The main function that executes the digitization crew process.
  • get_dfs_order: Converts a subgraph model to a NetworkX graph and returns its DFS order.
  • split_activities: Splits activities into segments based on the DFS order and graph structure.
  • split_segment_by_digitization_point: Splits a segment into old and new subsegments based on the digitization point.

Important Classes

Not clear from code.

System Fit

This file fits into the wider 3-Cubed Python system as part of the crew agents module. It is designed to work with other modules and components to provide a comprehensive digitization and automation solution. The file uses various dependencies, including CrewAI, LangChain, and NetworkX, to perform its tasks.


triplets/crew_agents/reengineering_crew.py

Purpose

This file, reengineering_crew.py, is part of the 3-Cubed Python system and is responsible for defining the re-engineering crew, which is a collection of agents and tasks that work together to analyze and optimize business processes.

Key Responsibilities

  • Define the re-engineering crew, including its agents and tasks
  • Execute the re-engineering crew using the execute_reengineering_crew function
  • Provide a way to analyze and optimize business processes using the re-engineering crew

Important Functions

  • pydantic_to_networkx_tool: Converts a dictionary representing a GraphModel to a networkx.DiGraph.
  • identify_rework_tool: Processes rework structures for a given project.
  • execute_reengineering_crew: Executes the re-engineering crew and returns the results.

Important Classes

  • Agent: Represents an agent in the re-engineering crew, with attributes such as role, goal, backstory, and tools.
  • Task: Represents a task in the re-engineering crew, with attributes such as description and expected output.
  • Crew: Represents the re-engineering crew, with attributes such as planning, planning_llm, agents, tasks, and process.

System Fit

This file fits into the wider 3-Cubed Python system by providing a way to analyze and optimize business processes using the re-engineering crew. The re-engineering crew is composed of agents and tasks that work together to identify opportunities for rework reduction, redundancy removal, and process consolidation. The execute_reengineering_crew function is used to execute the re-engineering crew and return the results. The output of the re-engineering crew can be used to inform business decisions and improve process efficiency.

Notes

  • The pydantic_to_networkx_tool function is used to convert a dictionary representing a GraphModel to a networkx.DiGraph, which is used by the re-engineering crew to analyze the process subgraph.
  • The identify_rework_tool function is used to process rework structures for a given project, which is used by the re-engineering crew to identify opportunities for rework reduction.
  • The execute_reengineering_crew function is used to execute the re-engineering crew and return the results, which can be used to inform business decisions and improve process efficiency.

triplets/crew_agents/__init__.py

Purpose

Unable to read this file content.

Extracted Functions

None found.

Extracted Classes

None found.


triplets/models1/output_models.py

Purpose

This file (output_models.py) contains Pydantic models for representing output data from the 3-Cubed Python system. These models are used to structure and validate data related to automation analysis, digitization recommendations, and other system outputs.

Key Responsibilities

  • Define Pydantic models for output data
  • Validate and structure output data
  • Provide a standardized interface for accessing and manipulating output data

Important Functions

None

Important Classes

The following classes are important in this file:

  • AutomationAnalysis: Represents analysis of each activity, including activity ID, name, average handling time, automation type, and more.
  • AutomationRecommendations: Represents automation recommendations for the project, including a list of AutomationAnalysis objects.
  • DigitizationRecommendation: Represents a single digitization recommendation, including activity ID, name, form mode, and recommended digitization method.
  • DigitizationRecommendations: Represents a list of digitization recommendations.
  • DigitizedForm: Represents a digitized form, including form name, mode, and digitization details.
  • DigitizedForms: Represents a list of digitized forms.
  • AutomationSystem: Represents an automation system, including system name and office automation status.
  • AutomationSystems: Represents a list of automation systems.
  • DigitizedBR: Represents a digitized business rule, including business rule name and skill required.
  • DigitizedBRs: Represents a list of digitized business rules.
  • AutomationActivity: Represents analysis of each activity, similar to AutomationAnalysis, but with additional fields.

System Fit

This file is part of the 3-Cubed Python system, which is designed to analyze and optimize business processes. The output models in this file are used to structure and validate data related to automation analysis, digitization recommendations, and other system outputs. The data is then used to inform business decisions and drive process improvements.


triplets/models1/project_constants.py

Purpose

This file, project_constants.py, is responsible for loading and defining classification systems used in the project. It loads a classification system from an Excel file and defines a form classification system.

Key Responsibilities

  • Load a classification system from an Excel file
  • Define a form classification system
  • Provide constants for the project

Important Functions

load_classification_system_from_excel

Loads a classification system from an Excel file. It reads the Excel file, renames columns to match the expected format, and returns a ClassificationSystem object.

Important Classes

ClassificationSystem

Represents a classification system. It is a Pydantic model that contains a dictionary of classifications, where each key is an industry and each value is another dictionary with subindustries as keys and lists of function groups as values.

System Fit

This file fits into the wider 3-Cubed Python system by providing a classification system that can be used to categorize data. The load_classification_system_from_excel function can be used to load the classification system from an Excel file, and the ClassificationSystem class can be used to represent the classification system in the application. The form classification system defined in this file can be used to classify forms in the application.


triplets/models1/project_models.py

Purpose

This file (project_models.py) defines Pydantic models for various entities in the 3-Cubed Python system, including ControlEffectiveness, ControlActivity, Risk, ControlObjective, LOD, Form, BR, Product, and Activity. These models provide a structured way to represent and validate data for these entities.

Key Responsibilities

  • Define Pydantic models for various entities in the system
  • Provide data validation and type checking for these entities
  • Enable the creation of instances of these entities with validated data

Important Functions

  • clean_product_name: Ensures that the ProductName is stripped and converted to lowercase.

Important Classes

  • ControlEffectiveness: Represents the effectiveness score of a control based on Coverage, TeamSegregation, and Timeliness.
  • ControlActivity: Represents a control activity with its ID, type, efficacy, and effort.
  • Risk: Represents a risk with its ID, name, and associated controls.
  • ControlObjective: Represents a control objective with its ID, text, and associated risks.
  • LOD: Represents the Lines of Defense score for a control objective and risk combination.
  • Form: Represents a physical or digital form used in processing an activity.
  • BR: Represents a data element of a form used in processing an activity.
  • Product: Represents an activity output with its ID, name, parent ID, root ID, and conversion factors.
  • Activity: Represents an activity with its ID, name, team ID, and type.

System Fit

This file fits into the wider 3-Cubed Python system by providing a standardized way to represent and validate data for various entities. These models can be used to create instances of these entities, which can then be used to perform calculations, make decisions, or generate reports. The models defined in this file are likely used in conjunction with other files in the system, such as triplets/models1/project_data.py, to provide a comprehensive view of the system's data.


triplets/models1/__init__.py

Purpose

Unable to read this file content.

Extracted Functions

None found.

Extracted Classes

None found.


🤖