Package: lionagi
PyPI|Documentation|DiscordLionAGIPowerful Intelligent Workflow AutomationLionAGI is anintelligent agent framework. Tailored forbig data analysisin conjunction with advancedmachine learningtools, 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 asLarge 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 LLMshallucinate.What goes inside of a LLM is more akin to ablack-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.Another approach of using LLM is to treat them asintelligent 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 theagentmade to perform actions. This approach, though we still cannot pinpoint how LLM output what it outputs, but the flow itself isexplainable.LionAGIagentcan manage and direct other agents, can also use multiple different tools in parallel.Install LionAGI with pip:pipinstalllionagiDownload the.env_templatefile, input your appropriateAPI_KEY, save the file, rename as.envand put in your project's root directory.
by default we useOPENAI_API_KEY.Quick StartThe following example shows how to use LionAGI'sSessionobject to interact withgpt-4-turbomodel:# define system messages, context and user instructionsystem="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}# in interactive environment (.ipynb for example)importlionagiaslicalculator=li.Session(system=system)result=awaitcalculator.chat(instruction=instruction,context=context,model="gpt-4-turbo-preview")print(f"Calculation Result:{result}")# or otherwise, you can useimportasynciofromdotenvimportload_dotenvload_dotenv()importlionagiasliasyncdefmain():calculator=li.Session(system=system)result=awaitcalculator.chat(instruction=instruction,context=context,model="gpt-4-turbo-preview")print(f"Calculation Result:{result}")if__name__=="__main__":asyncio.run(main())Visit our notebooks for examples.LionAGI is designed to beasynchronousonly, please check python official documentation on howasyncwork:hereNotice:calling API with maximum throughput over large set of data with advanced models i.e. gpt-4 can getEXPENSIVE IN JUST SECONDS,please know what you are doing, and check the usage on OpenAI regularlydefault rate limits are set to be 1,000 requests, 100,000 tokens per miniute, please check theOpenAI usage limit documentationyou can modify token rate parameters to fit different use cases.if you would like to build from source, please download thelatest release,CommunityWe encourage contributions to LionAGI and invite you to enrich its features and capabilities. Engage with us and other community membersJoin Our DiscordCitationWhen 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},}RequirementsPython 3.10 or higher.