🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More
Socket
Book a DemoSign in
Socket

@graphai/agents

Package Overview
Dependencies
Maintainers
2
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphai/agents

Agents for GraphAI.

Source
npmnpm
Version
2.0.6
Version published
Weekly downloads
60
62.16%
Maintainers
2
Weekly downloads
 
Created
Source

@graphai/agents for GraphAI

Agents for GraphAI.

Install

yarn add @graphai/agents

Usage

import { GraphAI } from "graphai";
import * as agents from "@graphai/agents";

const graph = new GraphAI(graph_data, agents);
const result = await graph.run();
  • @graphai/data_agents
  • @graphai/input_agents
  • @graphai/llm_agents
  • @graphai/service_agents
  • @graphai/sleeper_agents
  • @graphai/vanilla

GraphData Example

graphDataLiteral

{
  "version": 0.5,
  "nodes": {
    "source": {
      "value": "apple"
    },
    "source2": {
      "value": {
        "apple": "red"
      }
    },
    "step1": {
      "agent": "stringTemplateAgent",
      "params": {
        "template": "${a}, ${b}, ${c}."
      },
      "inputs": {
        "a": ":source",
        "b": "orange",
        "c": null
      },
      "isResult": true
    },
    "step2": {
      "agent": "sleepAndMergeAgent",
      "inputs": {
        "array": [
          ":source2",
          {
            "lemon": "yellow"
          }
        ]
      },
      "isResult": true
    }
  }
}

graphDataInputs

{
  "version": 0.5,
  "nodes": {
    "apple": {
      "value": {
        "fruits": {
          "apple": "red"
        }
      }
    },
    "lemon": {
      "value": {
        "fruits": {
          "lemon": "yellow"
        }
      }
    },
    "total": {
      "agent": "sleepAndMergeAgent",
      "inputs": {
        "array": [
          ":apple",
          ":lemon",
          ":apple.fruits",
          ":lemon.fruits"
        ]
      }
    }
  }
}

graphDataAny

{
  "version": 0.5,
  "nodes": {
    "source": {
      "value": {}
    },
    "positive": {
      "agent": "sleepAndMergeAgent",
      "anyInput": true,
      "isResult": true,
      "inputs": {
        "array": [
          ":source.yes"
        ]
      }
    },
    "negative": {
      "agent": "sleepAndMergeAgent",
      "anyInput": true,
      "isResult": true,
      "inputs": {
        "array": [
          ":source.no"
        ]
      }
    }
  }
}

graphDataAny2

{
  "version": 0.5,
  "nodes": {
    "source1": {
      "value": {
        "apple": "red"
      }
    },
    "source2": {
      "value": {
        "lemon": "yellow"
      }
    },
    "router1": {
      "agent": "sleepAndMergeAgent",
      "params": {
        "duration": 10
      },
      "isResult": true,
      "inputs": {
        "array": [
          ":source1"
        ]
      }
    },
    "router2": {
      "agent": "sleepAndMergeAgent",
      "params": {
        "duration": 100
      },
      "isResult": true,
      "inputs": {
        "array": [
          ":source2"
        ]
      }
    },
    "receiver": {
      "agent": "sleepAndMergeAgent",
      "anyInput": true,
      "isResult": true,
      "inputs": {
        "array": [
          ":router1",
          ":router2"
        ]
      }
    }
  }
}

graphDataNested

{
  "version": 0.5,
  "nodes": {
    "source": {
      "value": {
        "nodes": {
          "source": {
            "value": 1
          },
          "result": {
            "agent": "copyAgent",
            "inputs": {
              "source": ":source"
            },
            "isResult": true
          }
        }
      }
    },
    "nested": {
      "agent": "nestedAgent",
      "graph": ":source",
      "isResult": true,
      "params": {
        "supressError": true
      }
    },
    "catch": {
      "agent": "propertyFilterAgent",
      "params": {
        "include": [
          "message"
        ]
      },
      "if": ":nested.onError",
      "inputs": {
        "item": ":nested.onError"
      },
      "isResult": true
    }
  }
}

FAQs

Package last updated on 03 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts