Skip to main content

Towards automated general intelligence.

Project description

PyPI - Version PyPI - Downloads

PyPI | Documentation | Discord

Documentation for v0.0.300+ is in progress

To contribute, you need to make a fork first, and then make pull request from your fork. 

LionAGI

Powerful Intelligent Workflow Automation

LionAGI is an intelligent agent framework. Tailored for big data analysis in conjunction with advanced machine learning tools, designed for data-centric, production-level projects. Lionagi provides a set of robust tools, enabling flexible and rapid design of agentic workflow, for your own data.

Why Automating Workflows?

Intelligent AI models such as Large Language Model (LLM), introduced new possibilities of human-computer interaction. LLMs is drawing a lot of attention worldwide due to its “one model fits all”, and incredible performance. One way of using LLM is to use as search engine, however, this usage is complicated by the fact that LLMs hallucinate.

What goes inside of a LLM is more akin to a black-box, lacking interpretability, meaning we don’t know how it reaches certain answer or conclusion, thus we cannot fully trust/rely the output from such a system.

ReAct flow

Another approach of using LLM is to treat them as intelligent agent, that are equipped with various tools and data sources. A workflow conducted by such an intelligent agent have clear steps, and we can specify, observe, evaluate and optimize the logic for each decision that the agent made to perform actions. This approach, though we still cannot pinpoint how LLM output what it outputs, but the flow itself is explainable.

LionAGI agent can manage and direct other agents, can also use multiple different tools in parallel.

parallel agents

Install LionAGI with pip:

pip install lionagi

Download the .env_template file, input your appropriate API_KEY, save the file, rename as .env and put in your project's root directory. by default we use OPENAI_API_KEY.

Quick Start

The following example shows how to use LionAGI's Session object to interact with gpt-4-turbo model:

# define system messages, context and user instruction
system = "You are a helpful assistant designed to perform calculations."
instruction = {"Addition":"Add the two numbers together i.e. x+y"}
context = {"x": 10, "y": 5}

model="gpt-4-turbo-preview"
# in interactive environment (.ipynb for example)
from lionagi import Session

calculator = Session(system)
result = await calculator.chat(instruction, context=context, model=model)

print(f"Calculation Result: {result}")
# or otherwise, you can use
import asyncio
from dotenv import load_dotenv

load_dotenv()

from lionagi import Session

async def main():
    calculator = Session(system)
    result = await calculator.chat(instruction, context=context, model=model)

    print(f"Calculation Result: {result}")

if __name__ == "__main__":
    asyncio.run(main())

Visit our notebooks for examples.

LionAGI is designed to be asynchronous only, please check python official documentation on how async work: here


Notice:

  • calling API with maximum throughput over large set of data with advanced models i.e. gpt-4 can get EXPENSIVE IN JUST SECONDS,
  • please know what you are doing, and check the usage on OpenAI regularly
  • default rate limits are set to be 1,000 requests, 100,000 tokens per miniute, please check the OpenAI usage limit documentation you can modify token rate parameters to fit different use cases.
  • if you would like to build from source, please download the latest release,

Community

We encourage contributions to LionAGI and invite you to enrich its features and capabilities. Engage with us and other community members Join Our Discord

Citation

When referencing LionAGI in your projects or research, please cite:

@software{Li_LionAGI_2023,
  author = {Haiyang Li},
  month = {12},
  year = {2023},
  title = {LionAGI: Towards Automated General Intelligence},
  url = {https://github.com/lion-agi/lionagi},
}

Requirements

Python 3.10 or higher.

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

lionagi-0.0.308.tar.gz (134.0 kB view details)

Uploaded Source

Built Distribution

lionagi-0.0.308-py3-none-any.whl (167.7 kB view details)

Uploaded Python 3

File details

Details for the file lionagi-0.0.308.tar.gz.

File metadata

  • Download URL: lionagi-0.0.308.tar.gz
  • Upload date:
  • Size: 134.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for lionagi-0.0.308.tar.gz
Algorithm Hash digest
SHA256 70e751377dd1423b70a9d38763e800985566e5170925fe11808a7c9b5c94edc3
MD5 1ad21d27c571f485ef830f4483efc3f0
BLAKE2b-256 fe28679c265c584ad36e9b0d44e6726327534a4e9f08c16360eb38a22183b9fb

See more details on using hashes here.

File details

Details for the file lionagi-0.0.308-py3-none-any.whl.

File metadata

  • Download URL: lionagi-0.0.308-py3-none-any.whl
  • Upload date:
  • Size: 167.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for lionagi-0.0.308-py3-none-any.whl
Algorithm Hash digest
SHA256 3637ad69ef7e3f20e9660c7aef40dfa9bc2a35fbb94c5fcf234d5aaa0d73519e
MD5 ae3a6a89448ea18dd5bc06cda9bf5f47
BLAKE2b-256 0bfd4f1631b69baf3be6e900d3f30d5b2b1e9855346f09dde70929a1b0075689

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