Skip to main content

Release Notes Python 3.9+ PyPI - Python Version License GitHub star chart

Paper | Key Features | Installation | Quick Start | Examples | Tutorials | Benchmark


AgentLite is a research-oriented library designed for building and advancing LLM-based task-oriented agent systems. It simplifies the implementation of new agent/multi-agent architectures, enabling easy orchestration of multiple agents through a manager agent. Whether you're building individual agents or complex multi-agent systems, AgentLite provides a straightforward and lightweight foundation for your research and development. Check more details in our paper.

🎉 News

🌟 Key Features

  • Lightweight Codebase: Designed for easy implementation of new Agent/Multi-Agent architectures.
  • Task-oriented LLM-based Agents: Focus on building agents for specific tasks, enhancing their performance and capabilities.
  • Research-oriented Design: A perfect tool for exploring advanced concepts in LLM-based multi-agent systems.

🤖 Framework

AgentLite Framework

🛠️ Installation

To get started with AgentLite, clone the repository and install the package using the following commands:

git clone https://github.com/SalesforceAIResearch/AgentLite.git
cd AgentLite
pip install -e .

Ensure you check the package dependencies and requirements in requirements.txt and setup.py.

🚀 Quick Start

To use AgentLite, set your OpenAI API key and run one of the example scripts:

export OPENAI_API_KEY=<INSERT YOUR OpenAI API KEY HERE>
python ./example/SearchManager.py

🖥️ UI Supporting

We provide a simple UI feature with AgentLite for demo purpose. To enable this capbility, uncomment the UI parts in requirements.txt to install the steamlite package. After installation, start with

streamlit run app/Homepage.py

Check our recorded UI demo. UI demo

🔍 Examples

Building Individual Agents

Build a Wikipedia search agent by providing a specific search action. For the full source, see SearchAgent.py.

1. Define the Action of an Agent

from agentlite.actions.BaseAction import BaseAction
from langchain_community.tools import WikipediaQueryRun

class WikipediaSearch(BaseAction):
    def __init__(self) -> None:
        action_name = "Wikipedia_Search" 
        action_desc = "Using this API to search Wiki content." # LLM uses action_name and action_desc to understand this action
        params_doc = {"query": "the search string. be simple."} # LLM uses this params_doc to understand the parameters in self.__call__() function
        self.search = WikipediaQueryRun(api_wrapper=WikipediaAPIWrapper())
        super().__init__(
            action_name=action_name,
            action_desc=action_desc,
            params_doc=params_doc,
        )

    def __call__(self, query):
        return self.search.run(query)

2. Define an Agent with the Search Action

# get the llm for agent. Should already export OPENAI_API_KEY="" in the your terminal if you use OPENAI_API.
llm_config_dict = {"llm_name": "gpt-3.5-turbo", "temperature": 0.9}
llm_config = LLMConfig(llm_config_dict)
llm = get_llm_backend(llm_config)
# define an individual agent
search_agent_info = {
    "name": "search_agent",
    "role": "you can search wikipedia to get the information."
}
search_agent = BaseAgent(name=search_agent_info["name"], 
                         role=search_agent_info["role"], 
                         llm=llm, 
                         actions=[WikipediaSearch()], 
                         logger=agent_logger
                         )

3. Calling the Agent with a Task

# calling the agent with TaskPackage
from agentlite.commons import TaskPackage
test_task = "what is the found date of microsoft"
test_task_pack = TaskPackage(instruction=test_task)
response = search_agent(test_task_pack)
print("response:", response)

Building a Multi-Agent System

Orchestrate different search agents into a multi-agent system. For full source, see simple_manager.py.

1. Define Individual Agents

# define two different types search agents
## get llm backend
from agentlite.llm.agent_llms import get_llm_backend
from agentlite.llm.LLMConfig import LLMConfig
llm_config_dict = {
    "llm_name": "gpt-3.5-turbo",
    "temperature": 0.9,
    "context_len": 4000,
}
llm_config = LLMConfig(llm_config_dict)
llm = get_llm_backend(llm_config)
## get individual agents
from example.SearchAgent import WikiSearchAgent, DuckSearchAgent
wiki_search_agent = WikiSearchAgent(llm)
duck_search_agent = DuckSearchAgent(llm)

2. Define a Manager Agent

from agentlite.agents import ManagerAgent
manager_agent_info = {
    "name": "search_manager",
    "role": "you are controlling wiki_search_agent and duck_search_agent to complete the search task. You should first use wiki_search_agent to complete the search task. If didn't answer the task, please try to ask duck_search_agent. You should integrate the answer from both agent to finalize the task."
}
# simply initializing the manager with info and the TeamAgents.
search_manager = ManagerAgent(llm, manager_agent_info["name"], 
                              manager_agent_info["role"],
                              TeamAgents=[wiki_search_agent, duck_search_agent])

3. Test the Manager Agent with a TaskPackage

from agentlite.commons import TaskPackage
test_task = "what is salesforce famous for?"
test_task_pack = TaskPackage(instruction=test_task, task_creator="User")
response = search_manager(test_task_pack)
print(response)

running the test in terminal. You will see the running output like following:

Agent search_manager receives the following TaskPackage:
[
        Task ID: 6f6bffdd-1ba8-4f7c-b326-8f409865fef0
        Instruction: what is salesforce famous for?
]
====search_manager starts execution on TaskPackage 6f6bffdd-1ba8-4f7c-b326-8f409865fef0====
Agent search_manager takes 0-step Action:
{
        name: wiki_search_agent
        params: {'Task': 'What is salesforce famous for?'}
}

📘 Tutorials

For detailed examples and tutorials on how to utilize AgentLite for your research or projects, please visit the tutorials directory.

🔬 Benchmark

Citation

If you find our paper or code useful, please cite

@misc{liu2024agentlite,
      title={AgentLite: A Lightweight Library for Building and Advancing Task-Oriented LLM Agent System}, 
      author={Zhiwei Liu and Weiran Yao and Jianguo Zhang and Liangwei Yang and Zuxin Liu and Juntao Tan and Prafulla K. Choubey and Tian Lan and Jason Wu and Huan Wang and Shelby Heinecke and Caiming Xiong and Silvio Savarese},
      year={2024},
      eprint={2402.15538},
      archivePrefix={arXiv},
      primaryClass={cs.MA}
}

Acknowledgement

  • We use some great tools in Langchain to build the examples and the library LLM call

Contact

Please reach out to us if you have any questions or suggestions. You can submit an issue or pull request, or send an email to zhiweiliu@salesforce.com

Metadata

Release files for zigent 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zigent 0.0.4
File Size Uploaded Provenance
zigent-0.0.4.tar.gz 25.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for zigent 0.0.4
File Interpreter ABI Platform
zigent-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 56.7 kB

Release files / zigent-0.0.4.tar.gz

Download URL zigent-0.0.4.tar.gz
Size 25.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9d225fea9b89d8110b8e40827a119ad19b3e80161882cbad4c6ba146348abda5
BLAKE2b-256 checksum
How to use checksums
4d9b1b01620bf11d98dec620c41c105933cab4dba0a7209dad794eb20b7d72a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 24, 2025.

Transparency log

Release files / zigent-0.0.4-py3-none-any.whl

Download URL zigent-0.0.4-py3-none-any.whl
Size 31.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30da30bc4ab09015fa8324b1d87f482f835a5309a8b6740978c1b40117d7bfe7
BLAKE2b-256 checksum
How to use checksums
b626e3e29a099b976187d85ccc93d7d962145d8e517c739372b5a706ba99cba2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 24, 2025.

Transparency log

Security for zigent 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for zigent-0.0.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 24, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page