Skip to main content

General Agent: From LLM to Agent

Project description

GeneralAgent: From LLM to Agent

GeneralAgent can control itself and use stack memory, to finish complex tasks automatically.

Self-Call

DEMO

Stack Memory

DEMO

Features

  • GeneralAgent support serialization, include python state.
  • Build-in interpreters: Python, AppleScript, Shell, File, Plan, Retrieve Embedding etc.
  • Agent Builder: Create agents using natural language and use them immediately, without coding.
  • Self-Control & Stack Memory: GeneralAgent can control itself and has a stack memory. More detail in paper
  • Function Search and Use: search from thousands of functions and use them.
  • AthenaAgent is a TypeScript port of GeneralAgent.

DEMO

DEMO

Usage

Set Enviroment

wget https://github.com/CosmosShadow/GeneralAgent/blob/main/.env.example
cp .env.example .env
vim .env
# Then configure environment variables in the .env file.
# OPENAI_API_KEY is necessary.
# SERPER_API_KEY is necessary for google search.

docker

# pull docker
docker pull cosmosshadow/general-agent

# run
docker run \
-p 3000:3000 \
-p 7777:7777 \
-v `pwd`/.env:/workspace/.env \
-v `pwd`/data:/workspace/data \
--name=agent \
--privileged=true \
-d cosmosshadow/general-agent

# open web with localhost:3000

Local installation and usage

Installation

pip install GeneralAgent

WebUI

# export Enviroment Variable in .env
export $(grep -v '^#' .env | sed 's/^export //g' | xargs)

git clone https://github.com/CosmosShadow/GeneralAgent
cd GeneralAgent

# Web npm install
cd webui/web/ && npm install && cd ../../
cd webui/server/server/ts_builder && npm install && cd ../../../../

# Start Server
cd webui/server/server/
uvicorn app:app --host 0.0.0.0 --port 7777

# Start Web
cd webui/web
npm run start

Python usage

Basic Use

A Music Generation Agent

from GeneralAgent.agent import Agent
from GeneralAgent import skills
role_prompt = """You are a music creator."""
functions = [skills.generate_music]
agent = Agent.with_functions(functions, role_prompt)
result = agent.run("Soft piano sound")
print(result)

# The execution of the python code is completed, and the result is as follows:
# ff4bc8c264cf.wav
# The music has been generated. You can download the audio file from the following link:
# [Download the music](./ff4bc8c264cf.wav)

More Examples

Development

License

The intended purpose and licensing of GeneralAgent is solely for research use.

The source code is licensed under Apache 2.0.

Paper

General Agent: Self-Call and Stack Memory

Join us

Scan the QR code below with WeChat

wechat

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

generalagent-0.2.18.tar.gz (4.4 MB view details)

Uploaded Source

File details

Details for the file generalagent-0.2.18.tar.gz.

File metadata

  • Download URL: generalagent-0.2.18.tar.gz
  • Upload date:
  • Size: 4.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.9.12 Darwin/22.1.0

File hashes

Hashes for generalagent-0.2.18.tar.gz
Algorithm Hash digest
SHA256 4adbc6d0b8fe29bbd8528c59390a2e2b417a45ad7a8db219a9f615d4ea4cd3f6
MD5 bafc492a30b181f19c7d618c46d18fd1
BLAKE2b-256 951c815ad53f33da57ce27dca4e3bd8d44442c9bbd276416dc676ec2fe3e3741

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page