Metadata-Version: 2.1
Name: llama-agi
Version: 0.2.0
Summary: Building AGI loops using LlamaIndex and Langchain
Home-page: https://github.com/run-llama/llama-lab/tree/main/llama_agi
License: MIT
Keywords: LLM,LlamaIndex,Langchain,AGI
Requires-Python: >=3.8.1,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: altair (==4.2.2)
Requires-Dist: google-api-python-client (>=2.87.0)
Requires-Dist: langchain (==0.0.154)
Requires-Dist: llama-index (==0.6.13)
Requires-Dist: streamlit (==1.21.0)
Requires-Dist: transformers (>=0.4.29)
Project-URL: Repository, https://github.com/run-llama/llama-lab/tree/main/llama_agi
Description-Content-Type: text/markdown

# 🤖 Llama AGI 🦙

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

## Setup

Install using pip:

```bash
pip install llama-agi
```

Or install from source:

```bash
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."

```python
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

- LlamaIndex (connecting your LLMs to data): https://github.com/jerryjliu/llama_index
- LlamaHub (community library of data loaders): https://llamahub.ai

