Skip to main content

Implementation of the AG-UI protocol for CrewAI

Project description

ag-ui-crewai

Implementation of the AG-UI protocol for CrewAI.

Provides a complete Python integration for CrewAI flows and crews with the AG-UI protocol, including FastAPI endpoint creation and comprehensive event streaming.

Installation

pip install ag-ui-crewai

Usage

from crewai.flow.flow import Flow, start
from litellm import completion
from ag_ui_crewai import (
    add_crewai_flow_fastapi_endpoint,
    copilotkit_stream,
    CopilotKitState
)
from fastapi import FastAPI

class MyFlow(Flow[CopilotKitState]):
    @start()
    async def chat(self):
        response = await copilotkit_stream(
            completion(
                model="openai/gpt-4o",
                messages=[
                    {"role": "system", "content": "You are a helpful assistant."},
                    *self.state.messages
                ],
                tools=self.state.copilotkit.actions,
                stream=True
            )
        )
        self.state.messages.append(response.choices[0].message)

# Add to FastAPI
app = FastAPI()
add_crewai_flow_fastapi_endpoint(app, MyFlow(), "/flow")

Features

  • Native CrewAI integration – Direct support for CrewAI flows, crews, and multi-agent systems
  • FastAPI endpoint creation – Automatic HTTP endpoint generation with proper event streaming
  • Predictive state updates – Real-time state synchronization between backend and frontend
  • Streaming tool calls – Live streaming of LLM responses and tool execution to the UI

To run the dojo examples

cd python/ag_ui_crewai
poetry install
poetry run dev

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

ag_ui_crewai-0.1.5.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

ag_ui_crewai-0.1.5-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file ag_ui_crewai-0.1.5.tar.gz.

File metadata

  • Download URL: ag_ui_crewai-0.1.5.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.9 Darwin/24.1.0

File hashes

Hashes for ag_ui_crewai-0.1.5.tar.gz
Algorithm Hash digest
SHA256 c9e6a8be26eebd2708bbd529e6c484400078d09fbfa2e160b134759e85284a83
MD5 4557f2f9d9d0b6e21d0dd2173c1decac
BLAKE2b-256 2d0cfdafa1cc54a263e92f7ad6b676950f5e0419cfd4756c5286af169fc50b79

See more details on using hashes here.

File details

Details for the file ag_ui_crewai-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: ag_ui_crewai-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.9 Darwin/24.1.0

File hashes

Hashes for ag_ui_crewai-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 dd861e75f9797416b92db7dba4e7928b64ae212d4d881dd3134611b7837e0ce0
MD5 33307b970278c9e12274c39b0bcee1ed
BLAKE2b-256 aa112c743f701f74225996a01662ee7839e724c0d415c50a3460436b543e4ab6

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