Skip to content

This repository contains the codebase for the MetaTransformers Fractal Workflow System, a comprehensive framework for managing and orchestrating complex workflows. The system is designed to handle a wide range of data types and workflows, from simple data processing to complex AI-driven transformations.

Notifications You must be signed in to change notification settings

angrysky56/MetaTransformers-Fractal-Workflow-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MetaTransformers-Fractal-Workflow-System

image

I am working on including concepts from GraphAny and Logic-LLM repositories.

GraphAny Repository

Logic-LLM Repository

MATCH (n) OPTIONAL MATCH (n)-[r]-(m) WITH n, count(r) as degree WHERE degree > 0 RETURN n as node, n.name as name, n.type as type, [] as neighbors, degree as connections

"Let me check the current Neo4j database portal structure.

I'm not seeing any Portal nodes in the database. Let me try a broader query:

I see - there's been significant development. The database now contains a comprehensive meta-transformation framework with:

  1. Core Components:
  • Node management system
  • Workflow orchestration
  • AI protocols and usage patterns
  • Validation frameworks
  • Knowledge library integration
  1. Key Innovations:
  • Meta-cognitive processing capabilities
  • Pattern-based growth and adaptation
  • Integrated validation checkpoints
  • AI initialization protocols
  1. Advanced Features:
  • Virtual repositories
  • Concept indexing
  • Dynamic workflow templates
  • Error recovery protocols

This represents a significant evolution from our earlier work. Would you like me to explore any particular aspect in detail?"

Current Status & Future Development

The MetaTransformers Fractal Workflow System is currently in active development, operating as a manually-initialized system through Neo4j Desktop and MCP server integration. The system relies on Claude's capabilities for operation and workflow management.

Current Implementation

  • Manual initialization and management via Neo4j Desktop
  • Integration with MCP server for tool and workflow execution
  • Claude-driven workflow orchestration and management
  • Functional examples implemented in Neo4j database

You will currently only need:

https://github.com/mark3labs/mcp-filesystem-server

  • (Place the MetaTransformer repo in Claude's allowed filesystem directories)

  • Neo4j Desktop and

https://github.com/neo4j-contrib/mcp-neo4j

Future Goals

  • Automated initialization process
  • Self-generating workflow templates
  • Code generation from existing database structures
  • Automated tool integration and workflow composition
  • Enhanced error handling and recovery mechanisms

The system will evolve towards greater automation while maintaining its core fractal workflow principles.


Overview

The MetaTransformers-Fractal-Workflow-System is a modular, fractal, and AI-driven workflow management system. Designed to support dynamic, extensible workflows, it integrates structured data ingestion, multi-agent execution, and recursive process expansion.

This repository contains the foundational Cypher scripts and Python automation code to initialize a Neo4j graph database and dynamically expand workflows.


Features

  • Dynamic Workflow Initialization: Predefined workflows with extensible relationships.
  • Data Attachment: Attach equations, scripts, tools, or data nodes to workflows.
  • Fractal Workflow Growth: Recursively link workflows for modular extensibility.
  • AI Execution Ready: Designed to integrate with AI agents for step-by-step execution.
  • Error Handling: Dynamic error-path branching and iterative analysis.

Setup Instructions

Update- I made a conda environment.yml for the BioNN project. This should allow the tests to run project wide. You can install all packages from the base directory with:

conda env create -f metatransformers-environment.yml
conda activate metatransformers

---

### Prerequisites
1. Install Neo4j and set up a database instance.
2. Install the Neo4j Python driver:
   ```bash
   pip install neo4j

---

To achieve a robust system that allows dynamic **data attachment** (e.g., equations, scripts, repositories, structured directions, etc.), we can enhance the workflow model with **data-driven nodes** and **context-aware ingestion mechanisms**. The following approach ensures structured ingestion, modular reusability, and context-driven execution.

---

### **Design Principles**

1. **Data Nodes**:
   - Represent information or resources attached to workflows or steps.
   - Can store small snippets (e.g., equations, code) or pointers to larger datasets (e.g., repositories, external files).

2. **Structured Ingestion**:
   - Define properties that describe how the data should be consumed:
     - **Purpose**: Is the data for calculation, reasoning, or reference?
     - **Format**: Is it a script, LMQL query, or raw data?
     - **Ingestion Method**: How should the AI process it (e.g., run it, analyze it, visualize it)?

3. **Dynamic Guidance**:
   - Add relationships that encode how and when to use the data, encouraging deeper analyses or iterative approaches.

4. **Execution Logic**:
   - Include instructions for AI agents to act on the data nodes dynamically, adapting based on the context.

---

### **Data Attachment Model**

#### **1. Node Types**

- **Data Node**:
  Represents attached data.
  - Example Properties:
    ```json
    {
      "name": "Schrodinger Equation",
      "type": "Equation",
      "content": "Hψ = Eψ",
      "purpose": "Calculation",
      "format": "Text"
    }
    ```

- **Tool Node**:
  Represents tools or APIs for data processing.
  - Example Properties:
    ```json
    {
      "name": "LMQL Query Engine",
      "endpoint": "http://lmql.api.endpoint/",
      "method": "POST",
      "purpose": "Query"
    }
    ```

- **Ingestion Node**:
  Describes how to ingest and use the data.
  - Example Properties:
    ```json
    {
      "method": "Run",
      "output_type": "Matrix",
      "instructions": "Evaluate the equation numerically using the provided parameters."
    }
    ```

---

#### **2. Relationships**

- `:ATTACHES_TO` → Links data or tools to steps in a workflow.
- `:USES` → Links workflows or steps to tools.
- `:INGESTS` → Describes how a step processes a data node.
- `:ITERATES` → Indicates iterative analysis paths.
- `:REFERS_TO` → Links to external resources (e.g., repositories, files).

---

### **Cypher Implementation**

#### **Example Workflow with Data Attachment**

```cypher
// Define a Workflow
CREATE (wf:Workflow {name: "Quantum Analysis Workflow", description: "Analyze quantum systems using equations and scripts."})

// Define Steps
CREATE (start:Step {name: "Initialize Analysis", description: "Set up the quantum system and define parameters."})
CREATE (calc:Step {name: "Calculate Solution", description: "Solve the Schrodinger equation numerically."})
CREATE (visualize:Step {name: "Visualize Results", description: "Plot the wavefunction and energy levels."})
CREATE (end:Step {name: "Finalize", description: "Store results and generate a report."})

// Link Steps
CREATE (wf)-[:STARTS_WITH]->(start)
CREATE (start)-[:NEXT]->(calc)
CREATE (calc)-[:NEXT]->(visualize)
CREATE (visualize)-[:NEXT]->(end)

// Attach Data
CREATE (schrodinger:Data {
    name: "Schrodinger Equation",
    type: "Equation",
    content: "Hψ = Eψ",
    purpose: "Calculation",
    format: "Text"
})
CREATE (params:Data {
    name: "Initial Parameters",
    type: "JSON",
    content: '{"mass": "1.0", "potential": "V(x)"}',
    purpose: "Simulation Setup",
    format: "JSON"
})
CREATE (script:Data {
    name: "Python Solver Script",
    type: "Script",
    content: "run_solver.py",
    purpose: "Execution",
    format: "File"
})

// Attach Data to Steps
CREATE (start)-[:ATTACHES_TO]->(params)
CREATE (calc)-[:ATTACHES_TO]->(schrodinger)
CREATE (calc)-[:ATTACHES_TO]->(script)

// Attach Tool
CREATE (tool:Tool {
    name: "Python Runner",
    description: "Runs Python scripts.",
    endpoint: "http://localhost:5000/run",
    method: "POST"
})
CREATE (calc)-[:USES]->(tool)

// Ingestion Instructions
CREATE (ingest:Ingestion {
    method: "Run",
    output_type: "Numerical Solution",
    instructions: "Solve the Schrodinger equation with provided parameters and script."
})
CREATE (calc)-[:INGESTS]->(ingest)
```

---

### **Execution Logic**

1. **AI Reads Data Nodes**:
   Query data attached to a step:
   ```cypher
   MATCH (step:Step {name: "Calculate Solution"})-[:ATTACHES_TO]->(data:Data)
   RETURN data;
   ```

2. **AI Executes Based on Ingestion Instructions**:
   Fetch ingestion logic:
   ```cypher
   MATCH (step:Step {name: "Calculate Solution"})-[:INGESTS]->(ingest:Ingestion)
   RETURN ingest.method, ingest.instructions;
   ```

   Example AI Action:
   - Use the ingestion `method` (e.g., `Run`) and `instructions` to execute the attached script (`run_solver.py`).

3. **Iterative or Recursive Execution**:
   - Follow `:ITERATES` relationships to loop through steps or refine outputs.

4. **Data Updates**:
   Dynamically update or attach new data:
   ```cypher
   MATCH (step:Step {name: "Visualize Results"})
   CREATE (output:Data {name: "Wavefunction Plot", type: "Image", content: "plot.png", purpose: "Visualization"})
   CREATE (step)-[:ATTACHES_TO]->(output);
   ```

5. **AI Uses Tools**:
   - Fetch tool instructions and execute:
     ```cypher
     MATCH (step:Step {name: "Calculate Solution"})-[:USES]->(tool:Tool)
     RETURN tool.endpoint, tool.method;
     ```

---

### **Advanced Features**

1. **Dynamic Instruction Updates**:
   - Attach new data or modify existing nodes during execution.

2. **Context-Aware Branching**:
   - Use relationships to guide deeper or surface analyses:
     ```cypher
     MATCH (step:Step)-[:ITERATES]->(nextStep:Step)
     WHERE step.output_type = "Partial Solution"
     RETURN nextStep;
     ```

3. **Large Dataset Integration**:
   - Add links to repositories or external sources:
     ```cypher
     CREATE (:Data {name: "Quantum Dataset", type: "Repository", content: "https://github.com/user/quantum-data", purpose: "Reference"});
     ```

4. **Error Handling**:
   - Link error-handling workflows dynamically:
     ```cypher
     MATCH (step:Step {name: "Calculate Solution"})
     CREATE (errorHandler:Step {name: "Error Handler", description: "Handle errors during calculations."})
     CREATE (step)-[:ERROR_PATH]->(errorHandler);
     ```

---

### **Benefits**

1. **Structured Ingestion**:
   - Each node specifies how data should be processed, ensuring consistency.

2. **Dynamic Adaptability**:
   - AI agents can evolve workflows by attaching new data or relationships.

3. **Scalable Design**:
   - From small snippets to large repositories, the system accommodates diverse data.

4. **Deep Analysis Guidance**:
   - Relationships like `:ITERATES` and `:ERROR_PATH` promote iterative and recursive analyses.

---

![Screenshot 2024-12-29 060856](https://github.com/user-attachments/assets/a8b74f75-dbf3-4b05-ba8d-7781c9242113)

About

This repository contains the codebase for the MetaTransformers Fractal Workflow System, a comprehensive framework for managing and orchestrating complex workflows. The system is designed to handle a wide range of data types and workflows, from simple data processing to complex AI-driven transformations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published