Giter Club home page Giter Club logo

localagi's Introduction

babyagi

Objective

This Python script is an example of an AI-powered task management system. The system uses HuggingFace Models and an SQLite database to create, prioritize, and execute tasks. The main idea behind this system is that it creates tasks based on the result of previous tasks and a predefined objective.

This README will cover the following:

How It Works

The script works by running an infinite loop that does the following steps:

  1. Pulls the first task from the task list.
  2. Sends the task to the execution agent, which uses HuggingFace Language Model to complete the task based on the context.
  3. Enriches the result and stores it in SQLite3.
  4. Creates new tasks and reprioritizes the task list based on the objective and the result of the previous task. The execution_agent() function is where the H API is used. It takes two parameters: the objective and the task. It then sends a prompt to OpenAI's API, which returns the result of the task. The prompt consists of a description of the AI system's task, the objective, and the task itself. The result is then returned as a string.

The task_creation_agent() function is where HuggingFace Model is used to create new tasks based on the objective and the result of the previous task. The function takes four parameters: the objective, the result of the previous task, the task description, and the current task list. It then sends a prompt to HuggingFace Model, which returns a list of new tasks as strings. The function then returns the new tasks as a list of dictionaries, where each dictionary contains the name of the task.

The prioritization_agent() function is where HuggingFace Model is used to reprioritize the task list. The function takes one parameter, the ID of the current task. It sends a prompt to HuggingFace Model, which returns the reprioritized task list as a numbered list.

Finally, the script uses Pinecone to store and retrieve task results for context. The script creates a Pinecone index based on the table name specified in the YOUR_TABLE_NAME variable. Pinecone is then used to store the results of the task in the index, along with the task name and any additional metadata.

How to Use

To use the script, you will need to follow these steps:

  1. Clone the repository via git clone https://github.com/Veritas83/localagi.git and cd into the cloned repository.
  2. Install the required packages: pip install -r requirements.txt
  3. Copy the .env.example file to .env: cp .env.example .env. This is where you will set the following variables.
  4. Set your HuggingFace API key in the HUGGINGFACE_API_KEY variables.
  5. Set the name of the table where the task results will be stored in the TABLE_NAME variable.
  6. (Optional) Set the objective of the task management system in the OBJECTIVE variable.
  7. (Optional) Set the first task of the system in the INITIAL_TASK variable.
  8. Run the script.

All optional values above can also be specified on the command line.

Supported Models

This script works with all HuggingFace models, as well as Llama through Llama.cpp. Default model is gpt-3.5-turbo. To use a different model, specify it through HUGGINGFACE_API_MODEL or use the command line.

Llama

Download the latest version of Llama.cpp and follow instructions to make it. You will also need the Llama model weights.

  • Under no circumstances share IPFS, magnet links, or any other links to model downloads anywhere in this repository, including in issues, discussions or pull requests. They will be immediately deleted.

After that link llama/main to llama.cpp/main and models to the folder where you have the Llama model weights. Then run the script with OPENAI_API_MODEL=llama or -l argument.

Warning

This script is designed to be run continuously as part of a task management system. Running this script continuously can result in high API usage, so please use it responsibly.

Contribution

Needless to say, BabyAGI is still in its infancy and thus we are still determining its direction and the steps to get there. Currently, a key design goal for BabyAGI is to be simple such that it's easy to understand and build upon. To maintain this simplicity, we kindly request that you adhere to the following guidelines when submitting PRs:

  • Focus on small, modular modifications rather than extensive refactoring.
  • When introducing new features, provide a detailed description of the specific use case you are addressing.

Backstory

BabyAGI is a pared-down version of the original Task-Driven Autonomous Agent (Mar 28, 2023) shared on Twitter. This version is down to 140 lines: 13 comments, 22 blanks, and 105 code. The name of the repo came up in the reaction to the original autonomous agent - the author does not mean to imply that this is AGI.

localagi's People

Contributors

francip avatar yoheinakajima avatar malikmalna avatar davidbyttow avatar fxchen avatar vtstech avatar rellfy avatar jdban avatar peteoxenham avatar micromysore avatar tooktheredbean avatar amrrs avatar tmcpa avatar pronoym99 avatar korben00 avatar joedevon avatar eltociear avatar sanity avatar farhanahmad15 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.