• Stars
    star
    754
  • Rank 60,205 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 1 year ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An LLM-based Agent for the New Automation Paradigm - Agentic Process Automation

ProAgent: From Robotic Process Automation to Agentic Process Automation

From water wheels to Robotic Process Automation (RPA), automation technology has evolved throughout history to liberate human beings from arduous tasks. Yet, RPA struggles with tasks needing human-like intelligence, especially in elaborate design of workflow construction and dynamic decision-making in workflow execution. As Large Language Models (LLMs) have emerged human-like intelligence, this paper introduces Agentic Process Automation(APA), a groundbreaking automation paradigm using LLM-based agents for advanced automation by offloading the human labor to agents associated with construction and execution. We then instantiate ProAgent, an LLM-based agent designed to craft workflows from human instructions and make intricate decisions by coordinating specialized agents. Empirical experiments are conducted to detail its construction and execution procedure of workflow, showcasing the feasibility of APA, unveiling the possibility of a new paradigm of automation driven by agents

And this is the official code of Agentic Process Automation paper, you can download our paper here.

Code Setup

1. Install packages

pip install -r requirements.txt

especially, We use the OpenAI version before Dev Day, so you can't use the latest version of OpenAI

2. Prepare for n8n

Our projects use a self-host n8n, you can either prepare a n8n environment and connect ProAgent with a realworld APP service.

Or you can load our record to re-produce the case reported in our paper without n8n environment

prepare a n8n service is not an eazy thing, you may face some problems or bug that we haven't encountered before, and you must handle the situation. For example, you may find some GFW problems in China when connecting your APP accounts with n8n

install n8n

Our projects use a self-host n8n, you must first install a n8n following the guide . You can use this command in linux/macOS

npm install n8n -g

self-host n8n doesn't support https service. However, we have already built a redirect-service, you can temporally use our service(may not be very stable, and we will opensource the redirect-service code)

export WEBHOOK_URL=https://n8n.x-agent.net/redirect/http%3A%2F%2Flocalhost%3A5678/
n8n

Connect your account in n8n

You need to regist or connect an existing APP with n8n before launching ProAgent. Connecting an APP may have some APP-specific operations, you can follow the n8n credential guide here

Save credentials

Our code base needs to load the workflow ID and credential ID. So you must make some workflow and regist some apps before, then do the following commands to decode the credentials from n8n service

n8n export:credentials --all --decrypted --output=./ProAgent/n8n_tester/credentials/c.json

move c.json to ./ProAgent/n8n_tester/credentials/c.json

n8n export:workflow --all --output=./ProAgent/n8n_tester/credentials/w.json

move w.json to ./ProAgent/n8n_tester/credentials/w.json

Code Running

The running depends on a config, which is in ProAgent/config.py, you can set the running environment:

  • development: This is the mode reported in paper, .
  • refine: load from an existing workflow, and then refine the workflow with some new request
  • production: load from an existing workflow, you can use this mode to re-produce an existing run of ProAgent

we have provide the case reported in our paper in ./apa_case, you can use production mode to load the run directly

we disable the test-on-change feature in production mode, And the APA-code will be test only once in the end of the run

In the opposite, the refine mode enable test-on-change feature

use the following command to start ProAgent, if you use development mode, remember to start n8n before

python main.py

Note that we have wrote a readable record system. All of the ProAgent runs will generate a new record in ./records, so you can load the run from record in refine or production mode.

If you use the development mode, you must prepare OpenAI key first. Set the following vars in your envirnoment

OPENAI_API_KEY, OPENAI_API_BASE

The method in our code is almost the same as descripted in our paper. However something have changed after the paper released:

  • HCI: we observed some problems when ProAgent has some misunderstood of the problem, so we developed a feature to enable ProAgent to ask human for help by a new function-call (like XAgent). This proactive manner encourage ProAgent to build and test workflows together with human.

  • n8n-feature: n8n have rapidly released some new feature in parallel of our work. Our code is basically built upon an older version of n8n and we have wrote an n8n-compiler in our code base. So that compiler may not be compatible with the newer verison of n8n

  • OpenAI: ProAgent is based on GPT4-0613. However OpenAI have released GPT4-1106-preview in Dev Day, which has a 38% improvment in function-calling. So you may find ProAgent better than our paper thanks to OpenAI's update~

Citation

If you find this repo helpful, feel free to cite us.

@article{ye2023proagent,
  title={ProAgent: From Robotic Process Automation to Agentic Process Automation},
  author={Ye, Yining and Cong, Xin and Tian, Shizuo and Cao, Jiannan and Wang, Hao and Qin, Yujia and Lu, Yaxi and Yu, Heyang and Wang, Huadong and Lin, Yankai and others},
  journal={arXiv preprint arXiv:2311.10751},
  year={2023}
}

More Repositories

1

ChatDev

Create Customized Software using Natural Language Idea (through LLM-powered Multi-Agent Collaboration)
Shell
24,842
star
2

MiniCPM-V

MiniCPM-V 2.6: A GPT-4V Level MLLM for Single Image, Multi Image and Video on Your Phone
Python
12,088
star
3

XAgent

An Autonomous LLM Agent for Complex Task Solving
Python
8,102
star
4

MiniCPM

MiniCPM3-4B: An edge-side LLM that surpasses GPT-3.5-Turbo.
Jupyter Notebook
7,009
star
5

ToolBench

[ICLR'24 spotlight] An open platform for training, serving, and evaluating large language model for tool learning.
Python
4,789
star
6

AgentVerse

🤖 AgentVerse 🪐 is designed to facilitate the deployment of multiple LLM-based agents in various applications, which primarily provides two frameworks: task-solving and simulation
JavaScript
4,095
star
7

BMTools

Tool Learning for Big Models, Open-Source Solutions of ChatGPT-Plugins
Python
2,884
star
8

CPM-Bee

百亿参数的中英文双语基座大模型
Python
2,686
star
9

VisCPM

[ICLR'24 spotlight] Chinese and English Multimodal Large Model Series (Chat and Paint) | 基于CPM基础模型的中英双语多模态大模型系列
Python
1,075
star
10

BMInf

Efficient Inference for Big Models
Python
573
star
11

IoA

An open-source framework for collaborative AI agents, enabling diverse, distributed agents to team up and tackle complex tasks through internet-like connectivity.
Python
556
star
12

BMTrain

Efficient Training (including pre-training and fine-tuning) for Big Models
Python
554
star
13

CPM-Live

Live Training for Open-source Big Models
Python
512
star
14

BMList

A List of Big Models
Python
339
star
15

RepoAgent

An LLM-powered repository agent designed to assist developers and teams in generating documentation and understanding repositories quickly.
Python
336
star
16

UltraFeedback

A large-scale, fine-grained, diverse preference dataset (and models).
Python
302
star
17

ModelCenter

Efficient, Low-Resource, Distributed transformer implementation based on BMTrain
Python
234
star
18

BMPrinciples

A collection of phenomenons observed during the scaling of big foundation models, which may be developed into consensus, principles, or laws in the future
222
star
19

UltraEval

[ACL 2024 Demo] Official GitHub repo for UltraEval: An open source framework for evaluating foundation models.
Python
215
star
20

InfiniteBench

100k+ Long-Context Benchmark for Large Language Models (paper upcoming)
Python
105
star
21

OlympiadBench

[ACL 2024]Official GitHub repo for OlympiadBench: A Challenging Benchmark for Promoting AGI with Olympiad-Level Bilingual Multimodal Scientific Problems.
Python
89
star
22

MobileCPM

A Toolkit for Running On-device Large Language Models (LLMs) in APP
C++
53
star
23

RAGEval

Python
47
star
24

DecT

Source code for ACL 2023 paper Decoder Tuning: Efficient Language Understanding as Decoding
Python
42
star
25

XAgent-doc

Document for XAgent.
19
star
26

UltraLink

An Open-Source Knowledge-Enhanced Multilingual Supervised Fine-tuning Dataset
Python
17
star
27

BMInf-demos

BMInf demos.
JavaScript
13
star
28

General-Model-License

6
star
29

VisRAG

Python
1
star