Package: aiflows
🤖🌊aiFlowsembodies theFlowsabstraction (arXiv) and greatly simplifies the design and implementation of complex (work)Flows involving humans, AI systems, and tools. It enables:🧩 Modularity: Flows can be stacked like LEGO blocks into arbitrarily nested structures with the complexity hidden behind a message-based interface🤝 Reusability: Flows can be shared publicly on the FlowVerse, readily downloaded and reused as part of different Flows🔀 Concurrency: Being consistent with the Actor model of concurrent computation, Flows are concurrency friendly – a necessary feature for a multi-agent futureFlows in a NutshellThe framework is centered aroundFlowsandmessages.
Flows represent the fundamental building block of computation. They are independent, self-contained, goal-driven entities able to complete a semantically meaningful unit of work.
To exchange information, Flows communicate via a standardized message-based interface. Messages can be of any type the recipient Flow can process.TheFlowsframework exemplified.The first column depicts examples of tools. Notably, in the Flows framework, AI systems correspond to tools. The second column depicts Atomic Flows, effectively minimal wrappers around tools constructed from the example tools. The third column depicts examples of Composite Flows defining structured interaction between _Atomic_ or _Composite_ Flows. The fourth column illustrates a specific _Composite_ competitive coding Flow as those used in the experiments in the paper. The fifth column outlines the structure of a hypothetical Flow, defining a meta-reasoning process that could support autonomous behavior.FlowVerse in a NutshellThe FlowVerse is a repository of Flows (powered by the 🤗 HuggingFace hub) created and shared by our community for everyone to use! With aiFlows, Flows can be readily downloaded, used, extended, or composed into novel, more complex Flows. For instance, sharing a Flow that uses only API-based tools (tools subsume models in the Flows abstraction) is as simple as sharing a config file (e.g.,hereis the AutoGPT Flow on FlowVerse). For the ones using ChatGPT, you could think of them as completely customizable open-source GPTs(++).The FlowVerse is continuously growing. To explore the currently available Flows, check out the 🤲│flow-sharing Forum on the Discordserver. Additionally, theTutorialsandDetailed Examplesin theGetting Startedsections cover some of the Flows we provide in more detail (e.g., the ChatAtomicFlow and QA, VisionAtomicFlow and VisualQA, ReAct and ReAct with human feedback, AutoGPT, etc.).Why should I use aiFlows?AI is set to revolutionize the way we work. Our mission is to support AI researchers and to allow them to seamlessly share advancements with practitioners. This will establish a feedback loop, guiding progress toward beneficial directions while ensuring that everyone can freely access and benefit from the next-generation AI tools.As a researcher, you will benefit from:The ability to design, implement, and study arbitrarily complex interactionsComplete control and customizability (e.g., the tools, the specific Flows and the information they have access to, the choice of models and their deployment, etc.)The ability to readily reproduce, reuse, or build on top of Flows shared on the FlowVerse and systematically study them across different settings (the infrastructure in thecc_flowsrepository could be a useful starting point in future studies)The ability to readily make your work accessible to practitioners and other researchers and access their feedback.As a practitioner, you will benefit from the:The ability to design and implement arbitrarily complex interactionsComplete control and customizability (e.g., the tools, the specific Flows and the information they have access to, the choice of models and their deployment, etc.)The ability to readily reuse or build on top of Flows shared on the FlowVerseDirect access to any advancements in the field.To develop the next-generation AI tools and at the same time maximally benefit from them, developers and researchers need to have complete control over their workflows -- aiFlows strives to empower you to make each Flow your own! See thecontributesection for more information.InstallationThe library requires Python 3.10+. To install the library, run the following command:pipinstallaiflowsOther installation optionsInstall bleeding-edge versiongitclonegit@github.com:epfl-dlab/aiflows.gitcdaiflows
pipinstall-e.Getting StartedQuick start (🕓 5 min)Here, you'll see how you can run inference with your first question-answering Flow, and you can trivially change between vastly different question-answering Flows thanks to the modular abstraction and FlowVerse!Tutorial (🕓 20 min)In this tutorial, we introduce you to the library's features through a walkthrough of how to build useful Flows of gradually increasing complexity. Starting from a vanilla QA Flow, we'll first extend it to a ReAct Flow, then ReAct with human feedback, and finish the tutorial with a version of AutoGPT!Developer's Guide (🕓 10 min)We are constantly optimizing our Flow development workflow (pun intended:). In this short guide, we share our best tips so that you don't have to learn the hard way.Detailed ExamplesMany of the recently proposed prompting and collaboration strategies involving tools, humans, and AI models are, in essence, specific Flows (see the figure below). In the link above, you'll find a detailed walkthrough of how to build some representative workflows.ContributeAs mentioned above, our goal is to make Flows a community-driven project that will benefit researchers and developers alike (see theWhy should I use aiFlows?section), and to achieve this goal, we need your help.You can become a part of the project in a few ways:contribute to the aiFlows codebase: this will directly improve the library and benefit everyone using itcontribute to the FlowVerse: by making your work accessible to everyone, others might improve your work and build on it, or you can build on others' workuse the library in your creative projects, push it to its limits, and share your feedback: the proof of the pudding is in the eating, and the best way to identify promising directions, as well as important missing features, is by experimentinglast but not least, ⭐ the repository and 📣 share aiFlows with your friends and colleagues; spread the word ❤️We will support the community in the best way we can but also lead by example. In the coming weeks, we will share:a roadmap for the library (FlowViz; FlowStudio; improve flexibility, developer experience, and support for concurrency, etc. -- feedback and help would be greatly appreciated!)write-ups outlining features, ideas, and our long-term vision for Flows -- we encourage you to pick up any of these and start working on them in whatever way you see fita version of JARVIS -- your fully customizable open-source version of ChatGPT+(++), which we will continue building in public! We hope that this excites you as much as it excites us, and JARVIS will become one of those useful projects that will constantly push the boundaries of what's possible with FlowsWe have tried to find a way for anyone to benefit by contributing to the project. TheContribution Guidedescribes our envisioned workflows in more detail (we would love to hear your feedback on this -- the Discordserveralready has a channel for it :)).In a nutshell, this is just the beginning, and we have a long way to go. Stay tuned, and let's work on a great (open-source) AI future together!ContributorsMade withcontrib.rocks.CitationTo reference the 🤖🌊aiFlowslibrary, please cite the paperFlows: Building Blocks of Reasoning and Collaborating AI:@misc{josifoski2023flows,
      title={Flows: Building Blocks of Reasoning and Collaborating AI},
      author={Martin Josifoski and Lars Klein and Maxime Peyrard and Yifei Li and Saibo Geng and Julian Paul Schnitzler and Yuxing Yao and Jiheng Wei and Debjit Paul and Robert West},
      year={2023},
      eprint={2308.01285},
      archivePrefix={arXiv},
      primaryClass={cs.AI}
}