Skip to main content

A lightweight agent interaction framework.

Project description

motleycrew

PyPI - Version CI

Website •︎ Documentation

Welcome to motleycrew, your ultimate framework for building multi-agent AI systems. With motleycrew, you can seamlessly mix and match AI agents and tools from popular frameworks, design advanced workflows, and leverage dynamic knowledge graphs — all with simplicity and elegance.

Think of motleycrew as a conductor that orchestrates a symphony of AI agents and tools. It provides building blocks for creating AI systems, enabling you to focus on the high-level design while motleycrew takes care of the rest.

Features

  • Integration: Combine AI agents and tools from Langchain, LlamaIndex, CrewAI, and Autogen. Use tools from Langchain and LlamaIndex, with more integrations coming soon.
  • Flexibility: Provide your agents with any tools or even other agents. All components implement Langchain's Runnable API, making them compatible with LCEL.
  • Advanced Flow Design: Design systems of any complexity by just coding a brief set of rules. Simply chain tasks together or utilize knowledge graphs for sophisticated flow design.
  • Caching and Observability: Built-in open-source observability with Lunary and caching of HTTP requests, including LLM API calls, with motleycache.

See our quickstart page for an overview of the framework and its capabilities.

Getting started

Installation

pip install motleycrew

First steps

To get you started, here's a simple example of how to create a crew with two agents: a writer and an illustrator. The writer will write a short article, and the illustrator will illustrate it.

from motleycrew import MotleyCrew
from motleycrew.agents.langchain import ReActToolCallingMotleyAgent
from motleycrew.tasks import SimpleTask
from motleycrew.tools.image.dall_e import DallEImageGeneratorTool
from langchain_community.tools import DuckDuckGoSearchRun

crew = MotleyCrew()

writer = ReActToolCallingMotleyAgent(name="writer", tools=[DuckDuckGoSearchRun()])
illustrator = ReActToolCallingMotleyAgent(name="illustrator", tools=[DallEImageGeneratorTool()])

write_task = SimpleTask(
    crew=crew, agent=writer, description="Write a short article about latest AI advancements"
)
illustrate_task = SimpleTask(
    crew=crew, agent=illustrator, description="Illustrate the given article"
)

write_task >> illustrate_task

crew.run()

print(write_task.output)
print(illustrate_task.output)

Here, we have a chain of two consecutive tasks. A SimpleTask basically just contains a prompt and an agent that will execute it. The >> operator is used to chain tasks together. If you want to learn more about creating flows in such fashion, see our blog with images example.

Knowledge graph and custom tasks

Under the hood, the tasks are stored in a knowledge graph, as well as all the data needed for their execution. You can create custom tasks that utilize the knowledge graph in any way you want. The graph can be used to control the flow of your system, or simply as a universal data store.

Please read our docs on key concepts and API to learn more about creating custom tasks and using the knowledge graph. Also, see how it all comes alive in the research agent example.

Caching and observability

We provide a universal HTTP caching tool, motleycache, also available as a separate package. It can cache all HTTP requests made by your agents, including LLM and tool calls, out of the box. This is especially useful for debugging and testing.

Motleycrew also comes with support for Lunary, an open-source observability platform. You can use it to monitor your agents' performance, visualize the flow of your system, and more.

To learn more about these features, see our caching and observability docs.

Examples

We have a small but growing collection of examples in our documentation.

  • For a working example of agents, tools, crew, and SimpleTask, check out the blog with images.
  • For a working example of custom tasks that fully utilize the knowledge graph backend, check out the research agent.

Support and contributions

We have a community Discord server where you can ask questions, share your ideas, and get help with your projects.

If you find a bug or have a feature request, feel free to open an issue in this repository. Contributions of any kind are also welcome!

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

motleycrew-0.3.3.tar.gz (86.8 kB view details)

Uploaded Source

Built Distribution

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

motleycrew-0.3.3-py3-none-any.whl (122.9 kB view details)

Uploaded Python 3

File details

Details for the file motleycrew-0.3.3.tar.gz.

File metadata

  • Download URL: motleycrew-0.3.3.tar.gz
  • Upload date:
  • Size: 86.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for motleycrew-0.3.3.tar.gz
Algorithm Hash digest
SHA256 6a7cb475507a72f40fc54385af2ae5a666a7db985345cdaeb7e6f704985ec34b
MD5 ad8a4b4107ab4fe4d87caa635ad12311
BLAKE2b-256 f65dd2a16c6d412b952fd6c4c5739758ce946198bac4a012eb85f7fb86a24864

See more details on using hashes here.

Provenance

The following attestation bundles were made for motleycrew-0.3.3.tar.gz:

Publisher: publish.yml on MotleyAI/motleycrew

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file motleycrew-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: motleycrew-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 122.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for motleycrew-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bc62ef935ec73b973a776fbb06210360300a0a3d53e177bfe8f0e1e520ced977
MD5 8a48380839c84606ebdbf1cc1528e5c4
BLAKE2b-256 e72188d4db3a06f353f11a857d8a47935ad0b519e4f5dcd40fae973bdc71b8c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for motleycrew-0.3.3-py3-none-any.whl:

Publisher: publish.yml on MotleyAI/motleycrew

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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