open-index/open-npm huggingface dataset:
npm package: @graphai/agent_generator
Description: This tool is a graphai application in which the user writes a simple specification, and based on that specification, AI fully automates the creation of a graphai agent.
Latest version: 0.0.2

# graphai agent generator

This tool is a graphai application in which the user writes a simple specification, and based on that specification, AI fully automates the creation of a graphai agent.

## update spec

edit template/spec.md

# set openai key

edit .env and set OPENAI_API_KEY=sk-....

## run

```
yarn run run
```

## then

generate agent in tmp directory
npm package: @graphai/anthropic_agent
Description: Anthropic agents for GraphAI.
Author: Satoshi Nakajima, Isamu Arimoto
Latest version: 2.0.12


# @graphai/anthropic_agent for GraphAI

Anthropic agents for GraphAI.

### Install

```sh
yarn add @graphai/anthropic_agent
```


### Usage

```typescript
import { GraphAI } from "graphai";
import { anthropicAgent } from "@graphai/anthropic_agent";

const agents = { anthropicAgent };

const graph = new GraphAI(graph_data, agents);
const result = await graph.run();
```

### Agents description
- anthropicAgent - Anthropic Agent

### Input/Output/Params Schema & samples
 - [anthropicAgent](https://github.com/receptron/graphai/blob/main/docs/agentDocs/llm/anthropicAgent.md)



### Environment Variables
 - anthropicAgent
   - ANTHROPIC_API_KEY



### GraphData Example

#### graphDataAnthropicMath
```json
{
  "version": 0.5,
  "nodes": {
    "inputData": {
      "value": "hello, let me know the answer 1 + 1"
    },
    "llm": {
      "agent": "anthropicAgent",
      "inputs": {
        "prompt": ":inputData"
      }
    }
  }
}
```
npm package: @graphai/brave_search_agent
Description: An agent that uses the Brave Search API
Author: kawamataryo
Latest version: 2.0.1


# @graphai/brave_search_agent for GraphAI

An agent that uses the Brave Search API

### Install

```sh
yarn add @graphai/brave_search_agent
```


### Usage

```typescript
import { GraphAI } from "graphai";
import { braveSearchAgent } from "@graphai/brave_search_agent";

const agents = { braveSearchAgent };

const graph = new GraphAI(graph_data, agents);
const result = await graph.run();
```

### Agents description
- braveSearchAgent - An agent that uses the Brave Search API. https://api-dashboard.search.brave.com/app/documentation/web-search/get-started

### Input/Output/Params Schema & samples
 - [braveSearchAgent](https://github.com/receptron/graphai-agents/blob/main/docs/agentDocs/net/braveSearchAgent.md)

### Input/Params example
 - braveSearchAgent
   - inputs
     - query(string)
       - The search query to send to Brave Search
     - search_args(object)
       - Additional search parameters to pass to the Brave Search API. See https://api-dashboard.search.brave.com/app/documentation/web-search/query
   - params
     - apiKey(string)
       - Brave Search API key
     - debug(boolean)
       - Enable debug mode
     - supressError(boolean)
       - Suppress error and return onError object if the request fails
     - search_args(object)
       - Additional search parameters to pass to the Brave Search API. See https://api-dashboard.search.brave.com/app/documentation/web-search/query

```typescript
{
  "inputs": {
    "query": "GraphAI framework"
  },
  "params": {}
}
```


```typescript
{
  "inputs": {
    "query": "GraphAI vs TensorFlow",
    "search_args": {
      "country": "JP",
      "language": "ja"
    }
  },
  "params": {}
}
```


```typescript
{
  "inputs": {
    "query": "GraphAI tutorials"
  },
  "params": {
    "debug": true
  }
}
```


### Environment Variables
 - braveSearchAgent
   - BRAVE_SEARCH_API_TOKEN
npm package: @graphai/browserless_agent
Description: ```sh yarn add @graphai/browserless_agent ```
Latest version: 2.0.2


# @graphai/browserless_agent for GraphAI



### Install

```sh
yarn add @graphai/browserless_agent
```


### Usage

```typescript
import { GraphAI } from "graphai";
import { browserlessAgent } from "@graphai/browserless_agent";

const agents = { browserlessAgent };

const graph = new GraphAI(graph_data, agents);
const result = await graph.run();
```

### Agents description
- browserlessAgent - An agent that uses Browserless.io to fetch web page content with JavaScript execution support for retrieving data from SPAs and dynamic content

### Input/Output/Params Schema & samples
 - [browserlessAgent](https://github.com/receptron/graphai-agents/blob/main/docs/agentDocs/net/browserlessAgent.md)

### Input/Params example
 - browserlessAgent
   - inputs
     - url(string)
       - URL of the web page to scrape or manipulate
     - text_content(boolean)
       - If true, returns only the text content of the body element of the page, otherwise returns the full HTML
   - params
     - apiKey(string)
       - Browserless API key
     - debug(boolean)
       - Enable debug mode
     - supressError(boolean)
       - Suppress error and return onError object if the request fails
     - text_content(boolean)
       - If true, returns only the text content of the body element of the page, otherwise returns the full HTML
     - region(string)
       - Regional endpoint to use. sfo: San Francisco (default), lon: London, ams: Amsterdam

```typescript
{
  "inputs": {
    "url": "https://www.example.com"
  },
  "params": {}
}
```


```typescript
{
  "inputs": {
    "url": "https://www.example.com",
    "text_content": true
  },
  "params": {}
}
```


```typescript
{
  "inputs": {
    "url": "https://www.example.com"
  },
  "params": {
    "debug": true
  }
}
```


### Environment Variables
 - browserlessAgent
   - BROWSERLESS_API_TOKEN
npm package: @graphai/cache_agent_filter
Description: Cache Agent filters for GraphAI.
Author: Satoshi Nakajima, Isamu Arimoto
Latest version: 2.0.2

# @graphai/cache_agent_filter for GraphAI

Cache Agent filter for GraphAI.

## Install

```
yarn add @graphai/cache_agent_filter
```

### USAGE

```
import { cacheAgentFilterGenerator } from "@graphai/cache_agent_filter";

const setCache = async (key: string, data: any) => {
  ...
  return;
};
const getCache = async (key: string) => {
  ...
  return data;
}

const cacheAgentFilter = cacheAgentFilterGenerator({ getCache, setCache });
```
npm package: @graphai/exa_agent
Description: ```sh yarn add @graphai/exa_agent ```
Latest version: 0.0.2


# @graphai/exa_agent for GraphAI



### Install

```sh
yarn add @graphai/exa_agent
```


### Usage

```typescript
import { GraphAI } from "graphai";
import { exaAgent } from "@graphai/exa_agent";

const agents = { exaAgent };

const graph = new GraphAI(graph_data, agents);
const result = await graph.run();
```

### Agents description
- exaAgent - Exa Agent

### Input/Output/Params Schema & samples
 - [exaAgent](https://github.com/receptron/graphai-agents/blob/main/docs/agentDocs/net/exaAgent.md)

### Input/Params example
 - exaAgent



```typescript
{
  "inputs": {},
  "params": {}
}
```
npm package: @graphai/gemini_agent
Description: Gemini agents for GraphAI.
Author: Satoshi Nakajima, Isamu Arimoto
Latest version: 2.0.5


# @graphai/gemini_agent for GraphAI

Gemini agents for GraphAI.

### Install

```sh
yarn add @graphai/gemini_agent
```


### Usage

```typescript
import { GraphAI } from "graphai";
import { geminiAgent } from "@graphai/gemini_agent";

const agents = { geminiAgent };

const graph = new GraphAI(graph_data, agents);
const result = await graph.run();
```

### Agents description
- geminiAgent - Gemini Agent

### Input/Output/Params Schema & samples
 - [geminiAgent](https://github.com/receptron/graphai/blob/main/docs/agentDocs/llm/geminiAgent.md)



### Environment Variables
 - geminiAgent
   - GOOGLE_GENAI_API_KEY



### GraphData Example

#### graphDataGeminiMath
```json
{
  "version": 0.5,
  "nodes": {
    "inputData": {
      "value": "hello, let me know the answer 1 + 1"
    },
    "llm": {
      "agent": "geminiAgent",
      "inputs": {
        "prompt": ":inputData"
      }
    }
  }
}
```
npm package: @graphai/input_agents
Description: Input agents for GraphAI.
Author: Satoshi Nakajima, Isamu Arimoto
Latest version: 1.0.2


# @graphai/input_agents for GraphAI

Input agents for GraphAI.

### Install

```sh
yarn add @graphai/input_agents
```


### Usage

```typescript
import { GraphAI } from "graphai";
import { textInputAgent } from "@graphai/input_agents";

const agents = { textInputAgent };

const graph = new GraphAI(graph_data, agents);
const result = await graph.run();
```

### Agents description
- textInputAgent - Text Input Agent

### Input/Output/Params Schema & samples
 - [textInputAgent](https://github.com/receptron/graphai/blob/main/docs/agentDocs/input/textInputAgent.md)

### Input/Params example
 - textInputAgent



```typescript
{
  "inputs": {},
  "params": {
    "message": "Enter your message to AI."
  }
}
```


```typescript
{
  "inputs": {},
  "params": {
    "message": "Enter your message to AI.",
    "role": "system"
  }
}
```
npm package: @graphai/namedinput_validator_agent_filter
Description: namedinput validator Agent filters for GraphAI.
Author: Satoshi Nakajima, Isamu Arimoto
Latest version: 2.0.1

# @graphai/namedinput_validator_agent_filter for GraphAI

Cache Agent filter for GraphAI.

## Install

```
yarn add @graphai/namedinput_validator_agent_filter
```

### USAGE

Validate values of namedInputs based on the input schema of agentFunctionInfo

https://github.com/isamu/graphai/blob/agentFilter/packages/agent_filters/tests/validation/test_agent_namedinput_validator.ts

```typescript
import { GraphAI } from "graphai";
import * as agents from "@graphai/agents";
import { namedInputValidatorFilter } from "@graphai/agent_filters";

const agentFilters = [
  {
    name: "namedInputValidatorFilter",
    agent: namedInputValidatorFilter,
  },
];

const graph = new GraphAI(graph_data, agents, { agentFilters });
const results = await graph.run();

```
npm package: @graphai/pdf2text_agent
Latest version: 0.2.0


# @graphai/pdf2text_agent for GraphAI



### Install

```sh
yarn add @graphai/pdf2text_agent
```


### Usage

```typescript
import { GraphAI } from "graphai";
import { pdf2textAgent } from "@graphai/pdf2text_agent";

const agents = { pdf2textAgent };

const graph = new GraphAI(graph_data, agents);
const result = await graph.run();
```

### Agents description
- pdf2textAgent - Pdf2text Agent

### Input/Output/Params Schema & samples
 - [pdf2textAgent](https://github.com/receptron/graphai/blob/main/docs/agentDocs/documents/pdf2textAgent.md)

### Input/Params example
 - pdf2textAgent

```typescript
{
  "inputs": {
    "buffer": {
      "type": "Buffer",
      "data": [
        104,
        101,
        108,
        108,
        111,
        112,
        100,
        102
      ]
    }
  },
  "params": {
    "type": "md"
  }
}
```
npm package: @graphai/prompts
Latest version: 0.0.1


# @graphai/prompts for GraphAI



### Install

```sh
yarn add @graphai/prompts
```


### Usage

```typescript
import { GraphAI } from "graphai";
import { promptsAgent } from "@graphai/prompts";

const agents = { promptsAgent };

const graph = new GraphAI(graph_data, agents);
const result = await graph.run();
```
npm package: @graphai/replicate_agent
Description: Replicate agents for GraphAI.
Author: Satoshi Nakajima, Isamu Arimoto
Latest version: 2.0.1


# @graphai/replicate_agent for GraphAI

Replicate agents for GraphAI.

### Install

```sh
yarn add @graphai/replicate_agent
```


### Usage

```typescript
import { GraphAI } from "graphai";
import { replicateAgent } from "@graphai/replicate_agent";

const agents = { replicateAgent };

const graph = new GraphAI(graph_data, agents);
const result = await graph.run();
```

### Agents description
- replicateAgent - Replicate Agent

### Input/Output/Params Schema & samples
 - [replicateAgent](https://github.com/receptron/graphai/blob/main/docs/agentDocs/llm/replicateAgent.md)



### Environment Variables
 - replicateAgent
   - REPLICATE_API_TOKEN



### GraphData Example

#### graphDataReplicateMath
```json
{
  "version": 0.5,
  "nodes": {
    "inputData": {
      "value": "hello, let me know the answer 1 + 1"
    },
    "llm": {
      "agent": "replicateAgent",
      "inputs": {
        "prompt": ":inputData"
      },
      "params": {
        "model": "meta/meta-llama-3-70b-instruct"
      }
    }
  }
}
```
npm package: @graphai/shell_utilty_agent
Description: shell utilty agent
Author: isamu arimoto
Latest version: 0.1.1


# @graphai/shell_utilty_agent for GraphAI

shell utilty agent

### Install

```sh
yarn add @graphai/shell_utilty_agent
```


### Usage

```typescript
import { GraphAI } from "graphai";
import { runShellAgent } from "@graphai/shell_utilty_agent";

const agents = { runShellAgent };

const graph = new GraphAI(graph_data, agents);
const result = await graph.run();
```

### Agents description
- runShellAgent - shell utility agent

### Input/Params example
 - runShellAgent

```typescript
{
  "inputs": {
    "command": "echo 1",
    "baseDir": "./"
  },
  "params": {}
}
```
npm package: @graphai/slack_agent
Description: Slack message agents for GraphAI.
Author: Isamu Arimoto
Latest version: 0.0.4


# @graphai/slack_agent for GraphAI

Slack message agents for GraphAI.

### Install

```sh
yarn add @graphai/slack_agent
```

## setup

### Acquiring a Slack Token for Posting Messages

1. **Obtain a Slack Token:**
   - Go to the [Slack API Developer Portal](https://api.slack.com/apps) and select or create your app.
   - Follow the steps in the **Permissions** or **Authentication** section to generate the necessary token for your use case (e.g., user token, bot token).

2. **Set the Token as an Environment Variable:**
   - Export the token as an environment variable by running the following command in your terminal:
     ```bash
     export SLACK_TOKEN=your-slack-token-here
     ```

3. **Using a Bot Token:**
   - If you are using a bot token, ensure that the bot is added to the channel where you intend to post messages. This can be done from the Slack app by inviting the bot to the relevant channel.

### Usage

```typescript
import { GraphAI } from "graphai";
import { slackAgent } from "@graphai/slack_agent";

const agents = { slackAgent };

const graph = new GraphAI(graph_data, agents);
const result = await graph.run();
```

### Agents description
- slackAgent - Slack Agent

### Input/Output/Params Schema & samples
 - [slackAgent](https://github.com/receptron/graphai-agents/blob/main/docs/agentDocs/net/slackAgent.md)

### Input/Params example
 - slackAgent



```typescript
{
  "inputs": {
    "message": [
      "Hello amateraru from GraphAI Slack agent!"
    ]
  },
  "params": {
    "post_channel": "#p_bootcamp_e_raycast_jp_amaterasu_dev"
  }
}
```
npm package: @graphai/slashgpt_agent
Description: SlashGPT agents for GraphAI.
Author: Satoshi Nakajima, Isamu Arimoto
Latest version: 0.2.1


# @graphai/slashgpt_agent for GraphAI

SlashGPT agents for GraphAI.

### Install

```sh
yarn add @graphai/slashgpt_agent
```

This agent is in maintenance mode and will no longer be updated.
Please use other agents like OpenAI Agent, as they provide the necessary features.

### Usage

```typescript
import { GraphAI } from "graphai";
import { slashGPTAgent } from "@graphai/slashgpt_agent";

const agents = { slashGPTAgent };

const graph = new GraphAI(graph_data, agents);
const result = await graph.run();
```

### Agents description
- slashGPTAgent - Slash GPT Agent

### Input/Output/Params Schema & samples
 - [slashGPTAgent](https://github.com/receptron/graphai/blob/main/docs/agentDocs/llm/slashGPTAgent.md)

### Input/Params example
 - slashGPTAgent

```typescript
{
  "inputs": {},
  "params": {
    "query": "Come up with ten business ideas for AI startup"
  }
}
```
npm package: @graphai/step_runner_agent_filter
Description: Step Runner Agent filters for GraphAI.
Author: Satoshi Nakajima, Isamu Arimoto
Latest version: 2.0.3

# @graphai/step_runner_agent_filter for GraphAI

Agent filter collections for GraphAI.

## Install

```
yarn add @graphai/step_runner_agent_filter
```

### USAGE

To debug graph data in the console, you can execute each agent step by step.

It can be used via:

```typescript

import { consoleStepRunner } from "@graphai/step_runner_agent_filter";

const agentFilters = [
  {
    name: "consoleStepRunner",
    agent: consoleStepRunner,
  },
];

const graph = new GraphAI(
  graph_data,
  {
    ...agents,
  },
  { agentFilters },
);
await graph.run();
```
npm package: @graphai/stream_agent_filter
Description: Stream Agent filters for GraphAI.
Author: Satoshi Nakajima, Isamu Arimoto
Latest version: 2.0.3

# @graphai/stream_agent_filter for GraphAI

## Install

```
yarn add @graphai/stream_agent_filter
```

## Usage

### streamAgentFilterGenerator

Receive stream data externally through streamTokenCallback of filterParams.
Available for both server and client. See express code.

#### server

https://github.com/receptron/graphai_utils/blob/main/packages/express/src/express.ts

express server
```typescript
    import { streamAgentFilterGenerator } from  "@graphai/stream_agent_filter";
    
    return async (req: express.Request, res: express.Response) => {
      res.setHeader("Content-Type", "text/event-stream;charset=utf-8");
      res.setHeader("Cache-Control", "no-cache, no-transform");
      res.setHeader("X-Accel-Buffering", "no");

      const callback = (context: AgentFunctionContext, token: string) => {
        if (token) {
          res.write(token);
        }
      };
      const streamAgentFilter = {
        name: "streamAgentFilter",
        agent: streamAgentFilterGenerator<string>(callback),
      };
      const agentFilters = [streamAgentFilter]

      const agentFilterRunner = agentFilterRunnerBuilder(agentFilters);
      const result = await agentFilterRunner(context, agent.agent);

      const json_data = JSON.stringify(result);
      res.write("___END___");
      res.write(json_data);
      return res.end();
   }
```

### web client

https://github.com/isamu/graphai-stream-web/blob/main/src/views/Home.vue

```typescript
import { streamAgentFilterGenerator } from  "@graphai/stream_agent_filter";

const useAgentFilter = (callback: (context: AgentFunctionContext, data: T) => void) => {
  const streamAgentFilter = streamAgentFilterGenerator(callback);

  const agentFilters = [
    {
      name: "streamAgentFilter",
      agent: streamAgentFilter,
      agentIds: streamAgents,
    },
  ];
  return agentFilters;
};   

export default defineComponent({
  setup() {
    const streamingData = ref<Record<string, unknown>>({});

    const callback = (context: AgentFunctionContext, data: string) => {
      const { nodeId } = context.debugInfo;
      streamingData.value[nodeId] = (streamingData.value[nodeId] ?? "") + data;
    };
    const agentFilters = useAgentFilter(callback);
    
    const graphai = new GraphAI(graphData, agents, { agentFilters });
  }
})
```
npm package: @graphai/tts_nijivoice_agent
Description: nijivoice TTS agent
Author: receptron team
Latest version: 2.0.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.


# @graphai/tts_nijivoice_agent for GraphAI

nijivoice TTS agent

### Install

```sh
yarn add @graphai/tts_nijivoice_agent
```


### Usage

```typescript
import { GraphAI } from "graphai";
import { ttsNijivoiceAgent } from "@graphai/tts_nijivoice_agent";

const agents = { ttsNijivoiceAgent };

const graph = new GraphAI(graph_data, agents);
const result = await graph.run();
```

### Agents description
- ttsNijivoiceAgent - TTS nijivoice agent

### Input/Output/Params Schema & samples
 - [ttsNijivoiceAgent](https://github.com/receptron/graphai-agents/blob/main/docs/agentDocs/voice/ttsNijivoiceAgent.md)



### Environment Variables
 - ttsNijivoiceAgent
   - NIJIVOICE_API_KEY
npm package: @graphai/tts_openai_agent
Description: OpenAI TTS agent
Author: receptron team
Latest version: 2.0.1


# @graphai/tts_openai_agent for GraphAI

OpenAI TTS agent

### Install

```sh
yarn add @graphai/tts_openai_agent
```


### Usage

```typescript
import { GraphAI } from "graphai";
import { ttsOpenaiAgent } from "@graphai/tts_openai_agent";

const agents = { ttsOpenaiAgent };

const graph = new GraphAI(graph_data, agents);
const result = await graph.run();
```

### Agents description
- ttsOpenaiAgent - OpenAI TTS agent

### Input/Output/Params Schema & samples
 - [ttsOpenaiAgent](https://github.com/receptron/graphai-agents/blob/main/docs/agentDocs/voice/ttsOpenaiAgent.md)



### Environment Variables
 - ttsOpenaiAgent
   - OPENAI_API_KEY
npm package: @graphai/web_llm_agent
Description: ### Run preset llama
Author: Receptron team
Latest version: 0.0.1


## web llm

### Run preset llama

```typescript
import { webLlmAgentGenerator, CallbackReport } from "@graphai/web_llm_agent";

let ready = false;
const { webLlmAgent, loadEngine } = webLlmAgentGenerator({
  modelId: "Llama-3.2-3B-Instruct-q4f32_1-MLC",
  callback: (report: CallbackReport) => {
    if (report.progress === 1) {
      ready = true;
    }
  },
});

loadEngine();

// wait ready become true;

const graphai = new GraphAI(graphData, { ...vanilla, webLlmAgent });
await graphai.run();

````

### Run custom model

```typescript
import * as webllm from "@mlc-ai/web-llm";
import { webLlmAgentGenerator, CallbackReport, pushModelList } from "@graphai/web_llm_agent";

const model_list = [
  {
    model: "https://huggingface.co/SakanaAI/TinySwallow-1.5B-Instruct-q4f32_1-MLC",
    model_id: "TinySwallow-1.5B",
    model_lib: webllm.modelLibURLPrefix + webllm.modelVersion + "/Qwen2-1.5B-Instruct-q4f32_1-ctx4k_cs1k-webgpu.wasm",
  },
];
pushModelList(model_list);

let ready = false;
const { webLlmAgent, loadEngine } = webLlmAgentGenerator({
  modelId: "TinySwallow-1.5B",
  callback: (report: CallbackReport) => {
    if (report.progress === 1) {
      ready = true;
    }
  },
});

loadEngine();

// wait ready become true;

const graphai = new GraphAI(graphData, { ...vanilla, webLlmAgent });
await graphai.run();

````


### Limitations of web llm

- Different models cannot be used at the same time.
- If the same model is used at the same time, it will only be processed sequentially.