Skip to main content

Building AGI loops using LlamaIndex and Langchain

Project description

🤖 Llama AGI 🦙

This python package allows you to quickly create Auto-GPT-like agents, using LlamaIndex and Langchain.

Setup

Install using pip:

pip install llama-agi

Or install from source:

git clone https://github.com/run-llama/llama-lab.git
cd llama-lab/llama_agi
pip install -e .

Example Usage

The following shows an example of setting up the AutoAGIRunner, which will continue completing tasks (nearly) indefinitely, trying to achieve it's initial objective of "Solve world hunger."

from langchain.agents import load_tools
from langchain.llms import OpenAI

from llama_agi.execution_agent import ToolExecutionAgent
from llama_agi.runners import AutoAGIRunner
from llama_agi.task_manager import LlamaTaskManager
from llama_agi.tools import search_notes, record_note, search_webpage

from llama_index import ServiceContext, LLMPredictor

# LLM setup
llm = OpenAI(temperature=0, model_name='text-davinci-003')
service_context = ServiceContext.from_defaults(llm_predictor=LLMPredictor(llm=llm), chunk_size_limit=512)

# llama_agi setup
task_manager = LlamaTaskManager([args.initial_task], task_service_context=service_context)

tools = load_tools(["google-search-results-json"])
tools = tools + [search_notes, record_note, search_webpage]
execution_agent = ToolExecutionAgent(llm=llm, tools=tools)

# launch the auto runner
runner = AutoAGIRunner(task_manager, execution_agent)
objective = "Solve world hunger"
initial_task = "Create a list of tasks"
sleep_time = 2 
runner.run(objective, initial_task, sleep_time)

More examples can be found in the examples folder!

Llama Ecosystem

Project details


Download files

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

Source Distribution

llama_agi-0.1.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

llama_agi-0.1.0-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file llama_agi-0.1.0.tar.gz.

File metadata

  • Download URL: llama_agi-0.1.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.0 Linux/5.10.102.1-microsoft-standard-WSL2

File hashes

Hashes for llama_agi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6872aa5405dfb615d61886e3e395b820dccc7f7ad47231599408b363ad39b83c
MD5 5dd2529b3a2a72589c00a4c124aab9c6
BLAKE2b-256 0dbb054bb8f05be2ac67f8e34aac0ea8f62e9bdd0b2a95481f6f117e69440bda

See more details on using hashes here.

File details

Details for the file llama_agi-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: llama_agi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.0 Linux/5.10.102.1-microsoft-standard-WSL2

File hashes

Hashes for llama_agi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c46638e3b691f3084575b6c87801789a6c682dbf90c7c25df242b31623c74874
MD5 75b56c880db55414878399ab2772b73e
BLAKE2b-256 ff4b746b0d6ae091507e0e3901f3789c82c384b1c32e5b42e95e33d0be8cb681

See more details on using hashes here.

Supported by

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