
Research
NPM targeted by malware campaign mimicking familiar library names
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
Documentation | Discord | PyPI | Roadmap
LionAGI is a robust framework for orchestrating multi-step AI operations with precise control. Bring together multiple models, advanced ReAct reasoning, tool integrations, and custom validations in a single coherent pipeline.
pip install lionagi
Dependencies: • aiocahce • aiohttp • jinja2 • pandas • pillow • pydantic • python-dotenv • tiktoken
from lionagi import Branch, iModel
# Pick a model
gpt4o = iModel(provider="openai", model="gpt-4o")
# Create a Branch (conversation context)
hunter = Branch(
system="you are a hilarious dragon hunter who responds in 10 words rhymes.",
chat_model=gpt4o,
)
# Communicate asynchronously
response = await hunter.communicate("I am a dragon")
print(response)
You claim to be a dragon, oh what a braggin'!
Use Pydantic to keep outputs structured:
from pydantic import BaseModel
class Joke(BaseModel):
joke: str
res = await hunter.communicate(
"Tell me a short dragon joke",
response_format=Joke
)
print(type(response))
print(response.joke)
<class '__main__.Joke'>
With fiery claws, dragons hide their laughter flaws!
LionAGI supports advanced multi-step reasoning with ReAct. Tools let the LLM invoke external actions:
from lionagi.tools.types import ReaderTool
branch = Branch(chat_model=gpt4o, tools=ReaderTool)
result = await branch.ReAct(
instruct={
"instruction": "Summarize my PDF and compare with relevant papers.",
"context": {"paper_file_path": "/path/to/paper.pdf"},
},
extension_allowed=True, # allow multi-round expansions
max_extensions=5,
verbose=True, # see step-by-step chain-of-thought
)
print(result)
The LLM can now open the PDF, read in slices, fetch references, and produce a final structured summary.
df = branch.to_df()
print(df.tail())
from lionagi import Branch, iModel
gpt4o = iModel(provider="openai", model="gpt-4o")
sonnet = iModel(
provider="anthropic",
model="claude-3-5-sonnet-20241022",
max_tokens=1000, # max_tokens is required for anthropic models
)
branch = Branch(chat_model=gpt4o)
# Switch mid-flow
analysis = await branch.communicate("Analyze these stats", imodel=sonnet)
Seamlessly route to different models in the same workflow.
pip install "lionagi[tools]"
pip install "lionagi[llms]"
pip install "lionagi[ollama]"
We welcome issues, ideas, and pull requests:
@software{Li_LionAGI_2023,
author = {Haiyang Li},
month = {12},
year = {2023},
title = {LionAGI: Towards Automated General Intelligence},
url = {https://github.com/lion-agi/lionagi},
}
🦁 LionAGI
Because real AI orchestration demands more than a single prompt. Try it out and discover the next evolution in structured, multi-model, safe AI.
FAQs
An Intelligence Operating System.
We found that lionagi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.