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

This version

0.2.6

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.6.tar.gz (4.4 MB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: generalagent-0.2.6.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.6.tar.gz
Algorithm Hash digest
SHA256 a865f9db2eb2f0f6ff9f1e785a35aeca93b4f4ca2fea2f56626c6dfbb6e69e2f
MD5 f78e18ccc27853093aba6d175d025d6a
BLAKE2b-256 372d54634f6a3cb24aaf9cde956e86f1a3c6d90d42e37898e5485dc84d214b69

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