Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

KAgent CrewAI Integration

This package provides CrewAI integration for KAgent with A2A (Agent-to-Agent) server support and session-aware memory storage.

Features

  • A2A Server Integration: Compatible with KAgent's Agent-to-Agent protocol
  • Event Streaming: Real-time streaming of crew execution events
  • FastAPI Integration: Ready-to-deploy web server for agent execution
  • Session-aware Memory: Store and retrieve agent memories scoped by session ID
  • Flow State Persistence: Save and restore CrewAI Flow states to KAgent backend

Quick Start

This package supports both CrewAI Crews and Flows. To get started, define your CrewAI crew or flow as you normally would, then replace the kickoff command with the KAgentApp which will handle A2A requests and execution.

from kagent.crewai import KAgentApp
from kagent.core import KAgentConfig

# This is the crew or flow you defined
from research_crew.crew import ResearchCrew

app = KAgentApp(
    crew=ResearchCrew().crew(),
    agent_card={
        "name": "my-crewai-agent",
        "description": "A CrewAI agent with KAgent integration",
        "version": "0.1.0",
        "capabilities": {"streaming": True},
        "defaultInputModes": ["text"],
        "defaultOutputModes": ["text"],
    },
    config=KAgentConfig.from_file(),
)

fastapi_app = app.build()
uvicorn.run(fastapi_app, host="0.0.0.0", port=8080)

User Guide

Creating Tasks

For this version, tasks should either accept a single input parameter (string) or no parameters at all. Future versions will allow JSON / structured input where you can replace multiple values in your task to make it more flexible.

For example, you can create a task like follow with yaml (see CrewAI docs) and when triggered from the A2A client, the input field will be populated with the input text if provided.

research_task:
  description: >
    Research topics on {input} and provide a summary.

This is equivalent of crew.kickoff(inputs={"input": "your input text"}) when triggering agents manually.

Session-aware Memory

CrewAI Crews

Session scoped memory is implemented using the LongTermMemory interface in CrewAI. If you wish to share memories between agents, you must interact with them in the same session to share long term memory so they can search and access the previous conversation history (because agent ID is volatile, we must use session ID). You can enable this by setting memory=True when creating your CrewAI crew. Note that this memory is also scoped by user ID so different users will not see each other's memories.

Our KAgent backend is designed to handle long term memory saving and retrieval with the identical logic as LTMSQLiteStorage which is used by default for LongTermMemory in CrewAI, with the addition of session and user scoping. It will search the LTM items based on the task description and return the most relevant items (sorted and limited).

Note that when you set memory=True, you are responsible to ensure that short term and entity memory are configured properly (e.g. with OPENAI_API_KEY or set your own providers). The KAgent CrewAI integration only handles long term memory.

CrewAI Flows

In flow mode, we implement memory similar to checkpointing in LangGraph so that the flow state is persisted to the KAgent backend after each method finishes execution. We consider each session to be a single flow execution, so you can reuse state within the same session by enabling @persist() for flow or methods. We do not manage LongTermMemory for crews inside a flow since flow is designed to be very customizable. You are responsible for implementing your own memory management for all the crew you use in the flow.

Tracing

To enable tracing, follow this guide on Kagent docs. Once you have Jaeger (or any OTLP-compatible backend) running and the kagent settings updated, your CrewAI agent will automatically send traces to the configured backend.

Architecture

The package mirrors the structure of kagent-adk and kagent-langgraph but uses CrewAI for multi-agent orchestration:

  • CrewAIAgentExecutor: Executes CrewAI workflows within A2A protocol
  • KAgentApp: FastAPI application builder with A2A integration
  • Event Converters: Translates CrewAI events into A2A events for streaming.
  • Task history: The public A2A gateway persists client-visible task and event history.

For local development, configure the HTTP endpoint used by protocol traffic:

# Load process settings from /config/config.json (see Configuration).

Deployment

The uses the same deployment approach as other KAgent A2A applications (ADK / LangGraph). You can refer to samples/crewai/ for examples.

Runtime configuration file

Managed runtimes receive /config/config.json from the controller. For a standalone process, create that file and load it with KAgentConfig.from_file():

{"runtime":{"control_plane_url":"http://localhost:8083","gateway_url":"http://localhost:8083","name":"my-agent","namespace":"default","log_level":"info"}}

Provider credentials and standard OTEL_* overrides remain environment inputs.

Metadata

Release files for kagent-crewai 1.0.0rc2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kagent-crewai 1.0.0rc2
File Size Uploaded Provenance Actions
kagent_crewai-1.0.0rc2.tar.gz 9.7 kB Without provenance Details for kagent_crewai-1.0.0rc2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kagent-crewai 1.0.0rc2
File Interpreter ABI Platform Actions
kagent_crewai-1.0.0rc2-py3-none-any.whl Python 3 none any Details for kagent_crewai-1.0.0rc2-py3-none-any.whl

Total release size: 18.9 kB

Release files / kagent_crewai-1.0.0rc2.tar.gz

Download URL kagent_crewai-1.0.0rc2.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
373985a12e2f14ca0b195a50ce5c6d29f60a3081f78b6ed741a5a4093a62dcfa
BLAKE2b-256 checksum
How to use checksums
2eb1adbf30d5ee86525453c0be2f70a4cbc1cefd3208de64d10903d3a605bc33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / kagent_crewai-1.0.0rc2-py3-none-any.whl

Download URL kagent_crewai-1.0.0rc2-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
439f8251d232d6dcc212cd874ad5f2ed3511dbfc8218c6215bbfbda4df08ae58
BLAKE2b-256 checksum
How to use checksums
30024d5bf0d71f713afd1203d9419d85c13dc2ffdf94c4ff5d0f4a6b6736bc6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for kagent-crewai 1.0.0rc2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page