Where we explore the future of multi-agent systems
Project description
Table of Contents
Llegos: A strongly-typed Python DSL for multi-agent systems
*"More of a PyTorch, less of a Keras"
Llegos is a DSL for developing multi-agent systems in Python. It offers a set of building blocks that can be used to create complex, multi-layered environments where different groups of agents can interact within their sub-contexts. Llegos is designed to be flexible and generalizable, and it is not tied to any specific way of calling LLMs. Any logic, any combination of libraries in any order can be used in your agent implementation. Llegos elevates your agents into a multi-agent system.
You only need these 2 sentences to get an intuitive understanding of Llegos:
- llegos.Actors are a container for your agents.
- "llegos.Actors send llegos.Messages and share llegos.Objects in llegos.Networks."
Features
-
Strongly typed message passing: At the heart of Llegos is its use of Pydantic models for message passing. This ensures precision and clarity in communication, allowing for dynamically generated, well-structured messages crucial for complex multi-agent interactions.
-
Messaging with email semantics Llegos introduces an intuitive, email-like messaging system. Messages have parents, enabling functionalities like replying and forwarding, which enhances clarity and traceability in the system's communication.
-
Bring your own libraries: Whether that's Langchain, LlamaIndex, CamelAI, transformers... use Llegos Actors to elevate your agents into a multi-agent system, and coordinate them using a Network.
-
Flexibility and generalizability: Llegos Networks are themselves Actors, and can be nested within each other. This allows for the creation of complex, multi-layered environments where different groups of actors can interact within their sub-contexts.
Quick Start Guide
Read through the tests/
folder, in order, it has examples with comments showcasing Llegos' flexibility.
Requires: python = ">=3.10,<=3.12"
Installation
pip install llegos
poetry add llegos
Need help?
Core Concepts
Llegos is built upon several foundational elements that work together to enable complex interactions and behaviors within static and dynamic multi-agent systems. Here's an overview of the key concepts that form the backbone of Llegos:
Objects
- Definition: Objects are the fundamental entities in Llegos, defined using Pydantic models. They represent the base class from which other more specialized entities like Messages and Actors derive.
- Customization: Users can extend the Object class to create their own network objects, complete with validation and serialization capabilities.
- Dynamic Generation: Users can dynamically generate objects using OpenAI function calling, Instructor, Outlines, etc.
Messages
- Purpose: Messages serve as the primary means of communication between agents. They carry information, requests, commands, or any data that needs to be transmitted from one entity to another.
- Structure and Handling: Each message has an identifiable structure and is designed to be flexible and extensible. The system provides mechanisms for message validation, forwarding, replying, and tracking within conversation threads.
- Email Semantics: They are organized into hierarchical trees, allowing for the creation of complex communication patterns and protocols. Multiple replies can be sent to a single message, and each reply can have its own set of replies, and so on.
Actors
- Roles: Actors are specialized objects that encapsulate autonomous agents within the system. Each actor has its unique behavior, state, and communication abilities.
- Interactions: Actors interact with each other and the environment primarily through strongly-typed messages, responding to received information and making decisions based on their internal logic and objectives.
Networks
- Dynamic Actor Graphs: Within networks, you can dynamically manage the actors' relationships. Actors operating within the context of the network can access the network directory and discover other actors that can receive particular message types.
- Infinitely Nestable: Networks are themselves Actors, allowing for the creation of complex, multi-layered environments where different groups of actors can interact within their sub-contexts.
FAQ
Q: What is the difference between Llegos and other multi-agent systems like AutoGen, CamelAI, ChatDev, Agent Actors?
All those works are innovating in their own right as implementations of different interaction paradigms. Llegos is unique in that it makes it easier for you to explore the design space of interaction paradigms, rather than offering you ready-built paradigms. It is a framework for building multi-agent systems, rather than configuring a specific multi-agent system. It is paint, not a painting.
Q: How does Llegos relate to libraries like Langchain, LlamaIndex, Outlines, DSPy, Instructor?
Llegos is a framework for building multi-agent systems, and it is designed to be flexible and generalizable, and it is not tied to any specific way of calling LLMs. Any combination of libraries in any order can be used in the implementation of your Llegos Actors, however you please.
Contributing
We welcome contributions to Llegos! Whether you're interested in fixing bugs, adding new features, or improving documentation, your help is appreciated. Here's how you can contribute:
- Having discussions: You can use the discussions feature of this Github repo to ask questions, share ideas, and discuss Llegos.
- Reporting Issues: If you find a bug or have a suggestion for improvement, please open an issue through our issue tracker.
- Submitting Pull Requests: Contributions to the codebase are welcomed. Please submit pull requests with clear descriptions of your changes and the benefits they bring.
Is it any good?
Yes.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file llegos-0.1.0.tar.gz
.
File metadata
- Download URL: llegos-0.1.0.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.0 CPython/3.10.12 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb2da110c0f92ae96adeacc5d6d28150b92996d9b9e15d21bdd9dc0200db900c |
|
MD5 | 928156cf3695dd7d37f84691b6756296 |
|
BLAKE2b-256 | ad2339dd29af1c51d46cef141bd9341248d491ca3c620eb31282c0cc7cb07db9 |
File details
Details for the file llegos-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: llegos-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.0 CPython/3.10.12 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43847c2c7065ce8b4cbb99f3e93deca904a0718abaf17bee56f6aaf876c90044 |
|
MD5 | 806a0b583fa6858556b9cff71d1dcdbe |
|
BLAKE2b-256 | 27e432364681941d7dd368e34d51721de61c82bf6fb5e2e68e9b98e1691b2745 |