# 🤖 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
Raw data
{
"_id": null,
"home_page": "https://github.com/run-llama/llama-lab/tree/main/llama_agi",
"name": "llama-agi",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8.1,<4.0",
"maintainer_email": "",
"keywords": "LLM,LlamaIndex,Langchain,AGI",
"author": "",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/f8/b7/20855bcbc142911eb5364ee75fd5b8dfd0848ff79c08fa08d09685ad67dd/llama_agi-0.1.2.tar.gz",
"platform": null,
"description": "# \ud83e\udd16 Llama AGI \ud83e\udd99\n\nThis python package allows you to quickly create Auto-GPT-like agents, using LlamaIndex and Langchain.\n\n## Setup\n\nInstall using pip:\n\n```bash\npip install llama-agi\n```\n\nOr install from source:\n\n```bash\ngit clone https://github.com/run-llama/llama-lab.git\ncd llama-lab/llama_agi\npip install -e .\n```\n\n## Example Usage\n\nThe 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.\"\n\n```python\nfrom langchain.agents import load_tools\nfrom langchain.llms import OpenAI\n\nfrom llama_agi.execution_agent import ToolExecutionAgent\nfrom llama_agi.runners import AutoAGIRunner\nfrom llama_agi.task_manager import LlamaTaskManager\nfrom llama_agi.tools import search_notes, record_note, search_webpage\n\nfrom llama_index import ServiceContext, LLMPredictor\n\n# LLM setup\nllm = OpenAI(temperature=0, model_name='text-davinci-003')\nservice_context = ServiceContext.from_defaults(llm_predictor=LLMPredictor(llm=llm), chunk_size_limit=512)\n\n# llama_agi setup\ntask_manager = LlamaTaskManager([args.initial_task], task_service_context=service_context)\n\ntools = load_tools([\"google-search-results-json\"])\ntools = tools + [search_notes, record_note, search_webpage]\nexecution_agent = ToolExecutionAgent(llm=llm, tools=tools)\n\n# launch the auto runner\nrunner = AutoAGIRunner(task_manager, execution_agent)\nobjective = \"Solve world hunger\"\ninitial_task = \"Create a list of tasks\"\nsleep_time = 2 \nrunner.run(objective, initial_task, sleep_time)\n```\n\nMore examples can be found in the `examples` folder!\n\n## Llama Ecosystem\n\n- LlamaIndex (connecting your LLMs to data): https://github.com/jerryjliu/llama_index\n- LlamaHub (community library of data loaders): https://llamahub.ai\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Building AGI loops using LlamaIndex and Langchain",
"version": "0.1.2",
"split_keywords": [
"llm",
"llamaindex",
"langchain",
"agi"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "64af882752f847ca9a0f8bb39e6a1c94af46fd4196951a6fb32c5fce7d17acec",
"md5": "7a9af636de12dafe72745d63371bfda2",
"sha256": "597ca24f65b645910c8380a78d60f66733e529195eca8b5bacbb93788ba159e6"
},
"downloads": -1,
"filename": "llama_agi-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7a9af636de12dafe72745d63371bfda2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8.1,<4.0",
"size": 17043,
"upload_time": "2023-04-25T01:31:34",
"upload_time_iso_8601": "2023-04-25T01:31:34.844028Z",
"url": "https://files.pythonhosted.org/packages/64/af/882752f847ca9a0f8bb39e6a1c94af46fd4196951a6fb32c5fce7d17acec/llama_agi-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f8b720855bcbc142911eb5364ee75fd5b8dfd0848ff79c08fa08d09685ad67dd",
"md5": "78601ef1abf4d0e75e883d8d93a64146",
"sha256": "7a9f0d2fd1fe154e8cae4ea4860fa74be02d77d36a95c71c1c465a12739becb1"
},
"downloads": -1,
"filename": "llama_agi-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "78601ef1abf4d0e75e883d8d93a64146",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.1,<4.0",
"size": 10382,
"upload_time": "2023-04-25T01:31:36",
"upload_time_iso_8601": "2023-04-25T01:31:36.222747Z",
"url": "https://files.pythonhosted.org/packages/f8/b7/20855bcbc142911eb5364ee75fd5b8dfd0848ff79c08fa08d09685ad67dd/llama_agi-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-25 01:31:36",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "llama-agi"
}