Skip to main content

MultiAgent Framework is a powerful Python-based system for creating and managing multi-agent conversations and workflows. It supports multiple Language Model providers, custom tool integration, and includes a Retrieval-Augmented Generation (RAG) system. The framework enables seamless interaction between AI agents, making it ideal for complex task automation, interactive AI assistants, and decision support systems.

Project description

MultiAgent Framework

MultiAgent Framework is a powerful and flexible system for creating and managing multi-agent conversations and workflows. It provides a robust CLI for easy project management and a comprehensive framework for developing complex agent-based systems.

Table of Contents

  1. Installation
  2. CLI Usage
  3. Framework Usage
  4. Configuration
  5. Advanced Features
  6. Contributing
  7. License

Installation

To install the MultiAgent Framework, use pip:

pip install multiagent-framework

CLI Usage

The MultiAgent Framework comes with a powerful CLI tool for managing your projects.

Creating a New Project

To create a new project, use the following command:

python -m multiagent_framework.multiagent_cli new MyProject

This will create a new directory MyProject with the basic structure and configuration files needed for a MultiAgent project.

Adding Components

You can add new components (Agents, Tools, or Examples) to an existing project using the add command:

python -m multiagent_framework.multiagent_cli add MyProject Agent MyNewAgent
python -m multiagent_framework.multiagent_cli add MyProject Tool MyNewTool
python -m multiagent_framework.multiagent_cli add MyProject Example MyNewExample

Running a Conversation

To start a conversation in an existing project:

python -m multiagent_framework.multiagent_cli run ./MyProject

This command will initialize the framework with your project's configuration and prompt you for an initial input to start the conversation.

Framework Usage

Project Structure

A typical MultiAgent project has the following structure:

MyProject/
├── Agents/
│   ├── Agent1.yaml
│   └── Agent2.yaml
├── Tools/
│   ├── Tool1.py
│   └── Tool2.py
├── Examples/
│   ├── Example1.txt
│   └── Example2.txt
├── RoleKnowledge/
│   └── role_knowledge.json
├── chroma_db/
└── config.yaml

Configuring Agents

Agents are defined in YAML files within the Agents/ directory. Here's an example:

name: Executive Assistant
role: Managing communication and coordination between team members, stakeholders, and clients.
prompt: >
  You are an experienced Executive Assistant. Your task is to manage communication and coordination between team members, stakeholders, and clients.
  Other agents you can collaborate with:
  $otherAgents
  Tools at your disposal:
  $tools
  When given a task, think through the problem step-by-step, consider the roles and capabilities of other agents, and use the available tools when necessary. Provide detailed explanations of your thought process and decisions.
tools:
  - GoogleSearch
pre_prompt: true
post_prompt: true
agentConnections:
  - SummarizerAgent
color: "#FFA07A"
llm_config:
  type: ollama
  model: llama3
  temperature: 0.3
  max_tokens: 1000
  stream: true
rag_config:
  enabled: true
  vector_db:
    type: "chromadb"
    path: "./chroma_db"
  embedding_model:
    type: "default"
  chunk_size: 1000
  chunk_overlap: 200
  default_retriever:
    search_type: "similarity"
    search_kwargs:
      k: 5

Creating Tools

Tools are Python scripts located in the Tools/ directory. Each tool should have a main function that the framework will call. For example:

def main(input_data, framework, current_agent):
    # Tool logic here
    return result

Defining Examples

Examples are text files in the Examples/ directory. They can be referenced in agent prompts using the #ExampleName syntax.

Configuration

Main Configuration File

The config.yaml file in the project root directory contains the main configuration for the framework. It includes settings for the framework, LLM integration, agents, tools, and RAG system.

Agent Configuration

Each agent is configured in its own YAML file within the Agents/ directory. The configuration includes the agent's name, role, prompt, tools, LLM settings, and RAG configuration.

Advanced Features

Tool Extraction Methods

The framework supports multiple methods for extracting tool usage from agent responses:

  1. JSON Format
  2. Named with JSON
  3. Named with Key-Value Pairs

These methods are configured in the tool_extract_methods section of the main configuration file.

Pre and Post Prompts

The framework supports pre-prompts and post-prompts for each agent, which can be enabled or disabled in the agent's configuration file. These prompts provide additional context and instructions to the agent before and after processing the main input.

LLM Integration

The framework supports multiple Language Model providers, including OpenAI and Ollama. You can configure the LLM settings in the main configuration file and override them for individual agents if needed.

RAG (Retrieval-Augmented Generation)

The framework includes a Retrieval-Augmented Generation (RAG) system that enhances the agents' capabilities by providing relevant information from a vector database. The RAG system uses ChromaDB as the default vector store and can be configured globally or per agent.

Key RAG features include:

  • Customizable vector database settings
  • Configurable embedding models
  • Adjustable chunk size and overlap for text processing
  • Flexible retrieval options

You can also implement a custom RAG manager by specifying the custom_rag_manager path in the configuration.

Contributing

We welcome contributions! Please see our Contributing Guide for more details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

multiagent_framework-0.0.1.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

multiagent_framework-0.0.1-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file multiagent_framework-0.0.1.tar.gz.

File metadata

  • Download URL: multiagent_framework-0.0.1.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0

File hashes

Hashes for multiagent_framework-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0a73cade5c3333d73d553f99ac830892415e6296a41f32d998cc22a6e4344f1a
MD5 b4332ef1b4c57637c6edd2c904485aa1
BLAKE2b-256 b85241b4cb989f027b9a0338894475fa4d7537a52041e457ff128ad80db3f85b

See more details on using hashes here.

File details

Details for the file multiagent_framework-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for multiagent_framework-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9fe1fa76fb4281edc03c0cc4f6ae1e530e721300f008311680c7beddcac8de03
MD5 798de32260151927b6fe9d3a4d0271d1
BLAKE2b-256 e71ad668f16707c258ae8d4792c29cafc80e87a2029b23ff4d9fe4ed177de53f

See more details on using hashes here.

Supported by

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