Skip to main content

The fastest way to bring multi-agent workflows to production

Project description

alt text

FastAgency

The fastest way to bring multi-agent workflows to production.


Test Passing Downloads Package version Supported Python versions
CodeQL Dependency Review License Code of Conduct Discord


Welcome to FastAgency! This guide will walk you through the initial setup and usage of FastAgency, a powerful tool that leverages the AutoGen framework to quickly build applications. FastAgency is designed to be flexible and adaptable, and we plan to extend support to additional agentic frameworks such as CrewAI in the near future. This will provide even more options for defining workflows and integrating with various AI tools.

With FastAgency, you can create interactive applications using various interfaces such as a console or Mesop.

Supported Interfaces

FastAgency currently supports workflows defined using AutoGen and provides options for different types of applications:

  • Console: Use the ConsoleIO interface for command-line based interaction. This is ideal for developing and testing workflows in a text-based environment.
  • Mesop: Utilize Mesop with MesopIO for web-based applications. This interface is suitable for creating web applications with a user-friendly interface.

We are also working on adding support for other frameworks, such as CrewAI, to broaden the scope and capabilities of FastAgency. Stay tuned for updates on these integrations.

Install

To get started, you need to install FastAgency. You can do this using pip, Python's package installer. Choose the installation command based on the interface you want to use:

pip install "fastagency[autogen]"

This command installs FastAgency with support for the Console interface and AutoGen framework.

Write Code

Imports

Depending on the interface you choose, you'll need to import different modules. These imports set up the necessary components for your application:

import os

from autogen.agentchat import ConversableAgent

from fastagency.core import Chatable
from fastagency.core.runtimes.autogen.base import AutoGenWorkflows
from fastagency.core.io.console import ConsoleIO

from fastagency import FastAgency

For Console applications, import ConsoleIO to handle command-line input and output.

Define Workflow

You need to define the workflow that your application will use. This is where you specify how the agents interact and what they do. Here's a simple example of a workflow definition:

llm_config = {
    "config_list": [
        {
            "model": "gpt-4o-mini",
            "api_key": os.getenv("OPENAI_API_KEY"),
        }
    ],
    "temperature": 0.8,
}

wf = AutoGenWorkflows()

@wf.register(name="simple_learning", description="Student and teacher learning chat")
def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str:
    student_agent = ConversableAgent(
        name="Student_Agent",
        system_message="You are a student willing to learn.",
        llm_config=llm_config,
    )
    teacher_agent = ConversableAgent(
        name="Teacher_Agent",
        system_message="You are a math teacher.",
        llm_config=llm_config,
    )

    chat_result = student_agent.initiate_chat(
        teacher_agent,
        message=initial_message,
        summary_method="reflection_with_llm",
        max_turns=5,
    )

    return chat_result.summary

This code snippet sets up a simple learning chat between a student and a teacher. You define the agents and how they should interact, specifying how the conversation should be summarized.

Define FastAgency Application

Next, define your FastAgency application. This ties together your workflow and the interface you chose:

from fastagency.core.io.console import ConsoleIO

app = FastAgency(wf=wf, io=ConsoleIO())

For Console applications, use ConsoleIO to handle user interaction via the command line.

Run Application

Once everything is set up, you can run your FastAgency application using the following command:

fastagency run

Output

The output will vary based on the interface:

╭─ Python module file ─╮
│                      │
│  🐍 main.py          │
│                      │
╰──────────────────────╯


╭─ Importable FastAgency app ─╮
│                             │
│  from main import app       │
│                             │
╰─────────────────────────────╯

╭─ FastAgency -> user [text_input] ────────────────────────────────────────────╮
│                                                                              │
│ Starting a new workflow 'simple_learning' with the following                 │
│ description:                                                                 │
│                                                                              │
│ Student and teacher learning chat                                            │
│                                                                              │
│ Please enter an                                                              │
│ initial message:                                                             │
╰──────────────────────────────────────────────────────────────────────────────╯

For Console applications, you will see a command-line prompt where you can enter the initial message and interact with your workflow.


Future Plans

We are actively working on expanding FastAgency’s capabilities. In addition to supporting AutoGen, we plan to integrate support for other frameworks, such as CrewAI, to provide more flexibility and options for building applications. This will allow you to define workflows using a variety of frameworks and leverage their unique features and functionalities.

Feel free to customize your workflow and application based on your needs. For more details on configurations and additional features, refer to the AutoGen documentation and Mesop documentation.


Stay in touch

Please show your support and stay in touch by:

Your support helps us to stay in touch with you and encourages us to continue developing and improving the framework. Thank you for your support!


Contributors

Thanks to all of these amazing people who made the project better!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastagency-0.0.0rc0.tar.gz (90.3 kB view details)

Uploaded Source

Built Distribution

fastagency-0.0.0rc0-py3-none-any.whl (85.4 kB view details)

Uploaded Python 3

File details

Details for the file fastagency-0.0.0rc0.tar.gz.

File metadata

  • Download URL: fastagency-0.0.0rc0.tar.gz
  • Upload date:
  • Size: 90.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for fastagency-0.0.0rc0.tar.gz
Algorithm Hash digest
SHA256 80e4cc0dd6cc3f147c423d6db608e7e37c987bdc3a02df6e597c501f0019ac24
MD5 567bf581ca304f4b50d5ba1611dc4211
BLAKE2b-256 da7a855bdd77c9eb5a83c2eb244a86aaa159b7ffc01946238e84194397758f82

See more details on using hashes here.

File details

Details for the file fastagency-0.0.0rc0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastagency-0.0.0rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 89b755c4c9039a90b5ebec04969293bd399fd629561e2e76a73b0f41141557cd
MD5 281473e7cded64d02c6b93f7a5239404
BLAKE2b-256 9259789a62cbf6d896c2941aed198c45fbc183bfdbfc34651dd7795efdeaf07a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page