🚀 Quick Start Guide for Comma Agents#

Hello and a warm welcome to Comma Agents! We’re thrilled to have you aboard. This guide is your first step into a world of automation, where you’ll learn how to set up and use automated agent workflows with ease and efficiency. Let’s dive in!

💻 Installation#

First things first, let’s get Comma Agents installed on your system. Open your command line interface and type in the following command:

pip install comma-agents

This simple command fetches and installs the Comma Agents package, setting you up for an exciting journey ahead.

🛠 Setting Up Local Models#

To give you a smooth start, we’ll initially focus on local models. Our recommendation? The LLaMa models, renowned for their versatility and available in various quantized formats like ‘.gguf’. A big shoutout to “TheBloke” on Hugging Face for making these models accessible. You can grab them right here: TheBloke on Hugging Face.

📚 Fundamental Concepts#

🧠 Understanding Agents#

Think of agents as the building blocks of the Comma Agents universe. These agents enable you to run Language Learning Models (LLMs) as part of a larger workflow. They are the key to creating complex, automated sequences that do amazing things. To get your feet wet, let’s start by setting up a single LLM locally using the LLaMaAgent.

Here’s a simple script to kick things off with a local LLaMa model:

from comma_agents.hub.cloai.llama_cpp import LLaMaAgent

# Creating an example agent
example_agent = LLaMaAgent(
    name="Example Agent",
    llama_config={
        "model_path": "{local_model_path}",
    }
)

# Let's see what our agent has to say!
example_agent.call("Hello! How are you doing today LLM?")

Running this script initiates an agent and performs a local run. A heads-up: the model might take a short while to load, but patience pays off with a prompt response from your new digital companion.

🔀 Exploring Flows#

Now, let’s scale up from single interactions to continuous conversations. This is where the magic of SequentialFlow comes into play. It allows you to line up a series of agents for back-to-back interactions. Imagine a relay race where each runner passes the baton to the next. Here’s how you can set it up:

from comma_agents.agents import UserAgent
from comma_agents.flows import SequentialFlow

# Setting up a sequential flow
flow = SequentialFlow(
    flow_name="Example Flow",
    flows=[
        UserAgent(
            name="User",
            require_input=True
        ),
        example_agent
    ]
)

# Time to run our flow!
flow.run_flow()

In this setup, you, the user, kickstart the conversation, which then gets picked up by example_agent, creating an engaging back-and-forth.

Craving for a longer chat? Switch to InfiniteCycleFlow for an endless dialogue. It’s like a never-ending story where you decide when to close the book:

from comma_agents.flows import InfiniteCycleFlow

# Creating a cycle flow for ongoing interactions
flow = InfiniteCycleFlow( # Changing from SequentialFlow to InfiniteCycleFlow
    flow_name="Example Flow",
    flows=[
        UserAgent(
            name="User",
            require_input=True
        ),
        example_agent
    ]
)

# Let the conversation roll!
flow.run_flow()

Note: What’s fantastic about CommaAgents is its versatility. You can mix and match agents and flows, plugging them into the flow parameter to design workflows as simple or as complex as you like.

🌟 Further Exploration#

Ready to dive deeper? There’s a whole ocean of features and capabilities in Comma Agents waiting for you. Check out these resources for more insights and advanced use-cases:

  • [Comprehensive Guide on Agents]

  • [In-Depth Tutorials on Flows]

Start your journey with Comma Agents today and unlock the full potential of automated workflows. Happy automating! 🚀🤖