Skip to main content

Golem-GPT

PyPI PyPI - Status Docker Image Size (latest by date)

⚠️ This is an experimental development. Run it on your own risk! ⚠️

Framework for building actionable agents to achieve goals specified by user, powered by OpenAI GPT-4 and GPT-3.5

Usage

The optimal way to run Golem-GPT is to use the Docker image or Docker Compose.

Requirements

  • Docker or Python 3.8+ environment
  • OpenAI API key

Quick start

Put credentials to .env:

OPENAI_API_KEY=...
OPENAI_ORG_ID=...
OPENAI_MODEL=gpt-4

(For gpt-4 model you should have an early access enabled, it's not publicly available yet).

Run it via Docker Compose:

docker compose build && docker compose run app

or via Python:

pip install --upgrade golem-gpt
python -m golemgpt

❗️ It's safer to run it inside Docker to have it isolated. Because Golem can access an environment and filesystem, so it's better to keep it inside a container.

Architecture

We introduce a novel framework for building Golems (actionable agents) which is based on the following high-level concepts:

  • Goals: a set of goals, initially defined by user's input. Goals could be high-level definitions, like "I want to build a web app", or low-level definitions, like "I want to create a new file with content 'Hello, world!'"

  • Cognitron: a language model, which interprets input text and produces an action plan, or other kind of structured output. It runs on top of OpenAI models, which could be potentially replaced with any other language model.

  • Lexicon: a set of rules and dictionary to generate prompts for Cognitron and interpret its structured output.

  • Action plan: a structured output of Cognitron, which is a set of actions to be executed for achieving goals.

  • Actions: a predefined executables or functions, which can interact with the environment to achieve goals. Actions could also be recursive or delegate their execution to other Golems.

  • Memory: a storage for the Golem's current state, which can also be saved and loaded to continue the job later.

  • Codex: a built-in Golem's moderator, which is responsible for checking the agent's actions and preventing it from doing something unexpected. Codex has its own Cognitrion and Lexicon.

NOTE: In our implementation, Actions are implemented as Python functions

Why?

How is it different from AutoGPT?

We build it because we like it. Our implementation is not as advanced as AutoGPT to the moment, but it has some unique focus:

  • Keeping it simple and easy to modify, also with minimal dependencies
  • While keeping the core simple, we aim to make it extensible via custom actions, roles, policies, and other components
  • We think of it as interactive tool, not necessarily to be fully autonomous
  • Also we test it with GPT-3.5, which porbably sounds not super-hyped, but it's waaay cheaper and delivers results good enough for many use cases
  • We are going to utilize it in our own development cycle, and refine it to fit real needs in software development

Actions supported

The pipeline consists of the following actions:

  • ask_human_input(query)
  • get_os_details()
  • get_local_date()
  • read_file(filename)
  • write_file(filename, content)
  • summarize_file(filename, hint, to_filename)
  • http_download(url, method, headers, body, to_filename)
  • create_python_script(name, description, in_files, out_files)
  • create_shell_script(name, description, in_files, out_files)
  • run_script(name)
  • ask_google(query, to_filename)
  • delegate_job(goal, role, in_files, out_files)
  • explain(comment)
  • reject_job(message)
  • finish_job(message)

Development

Setup virtualenv:

python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip pip-tools
pip-compile
pip install -r requirements.txt

Put variables to .env:

OPENAI_API_KEY=...
OPENAI_ORG_ID=...

Start a new job:

python -m golemgpt

Continue saved job:

python -m golemgpt -j <job key>

Terminate simply with ^C or empty input.

License

Golem-GPT is licensed under the Apache-2.0.

Authors:

Metadata

Release files for golem-gpt 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for golem-gpt 0.2.1
File Size Uploaded Provenance Actions
golem_gpt-0.2.1.tar.gz 21.2 kB Without provenance Details for golem_gpt-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for golem-gpt 0.2.1
File Interpreter ABI Platform Actions
golem_gpt-0.2.1-py3-none-any.whl Python 3 none any Details for golem_gpt-0.2.1-py3-none-any.whl

Total release size: 55.3 kB

Release files / golem_gpt-0.2.1.tar.gz

Download URL golem_gpt-0.2.1.tar.gz
Size 21.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1b740e39c502b7126af73aa2f70010c8ddafd551d60b6881eedd1ae83357d8bc
BLAKE2b-256 checksum
How to use checksums
0e0155d2d914c8156184689aec7cee3e7b47e67e5cad35a35123a25da6e50973
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.18

Release files / golem_gpt-0.2.1-py3-none-any.whl

Download URL golem_gpt-0.2.1-py3-none-any.whl
Size 34.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
421d756b333da34e84a6cb1c154fa7689ae23561cb5a62a8dc06d736571b56ab
BLAKE2b-256 checksum
How to use checksums
9e4987feb833f6767ec3fb22eba20b4463bd0d7dd43b456ec0594a8793787290
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.18

Security for golem-gpt 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page