bluefly/ai_agent_crewai

CrewAI integration for multi-agent AI workflows with configurable API endpoints

dev-crewai-completion-20250808 2025-08-09 02:54 UTC

This package is auto-updated.

Last update: 2025-08-20 01:48:06 UTC


README

A unified Drupal module that provides comprehensive AI agent capabilities including CrewAI workflows, LangChain operations, and agent marketplace functionality.

Features

  • CrewAI Integration: Sequential and hierarchical workflow execution
  • LangChain Support: Chain operations, Q&A, and map-reduce workflows
  • Agent Marketplace: Browse and discover pre-built AI agents
  • API-First Design: RESTful endpoints for all functionality
  • Configurable Settings: Rate limiting, timeouts, and endpoint configuration
  • Built-in Logging: Comprehensive error handling and monitoring

Installation

  1. Download and install using composer: composer require drupal/ai_agent_crewai
  2. Alternatively, place this module in your modules/contrib directory
  3. Enable the module: drush en ai_agent_crewai
  4. Configure settings at /admin/config/ai/crewai

Configuration

Configure the module at Administration » Configuration » AI » CrewAI Settings:

  • LLM API Endpoint: The URL to your CrewAI service
  • Default Process Type: Sequential or hierarchical execution
  • Maximum Execution Time: Timeout for workflow execution (60-7200 seconds)
  • Enable Memory: Allow agents to retain context between tasks
  • Enable Cache: Cache agent responses for performance
  • Maximum Requests Per Minute: Rate limiting (1-100 RPM)

API Usage

Execute a Workflow

POST /api/crewai/execute
Content-Type: application/json

{
  "agents": [
    {
      "role": "analyst",
      "goal": "Analyze data and provide insights",
      "backstory": "Expert data analyst with 10 years experience"
    }
  ],
  "tasks": [
    {
      "description": "Analyze the given dataset",
      "expected_output": "A comprehensive analysis report"
    }
  ],
  "process_type": "sequential"
}

Check Status

GET /api/crewai/status/{execution_id}

Browse Marketplace Agents

GET /api/crewai/marketplace/agents

Response:

[
  {
    "id": "research_analyst",
    "name": "Research Analyst",
    "description": "Expert research agent for data analysis and insights",
    "role": "analyst",
    "tools": ["web_search", "data_analysis"],
    "rating": 4.8,
    "downloads": 1250
  }
]

List LangChain Operations

GET /api/crewai/langchain/operations

Execute LangChain Operation

POST /api/crewai/langchain/execute
Content-Type: application/json

{
  "operation": "sequential_chain",
  "inputs": [
    {
      "prompt": "Analyze this data",
      "context": "Sample data set"
    }
  ],
  "config": {
    "max_tokens": 500,
    "temperature": 0.7
  }
}

Permissions

  • Access CrewAI API: Read-only access to API endpoints
  • Execute CrewAI Workflows: Execute workflows via API
  • Administer CrewAI Settings: Configure module settings

Requirements

  • Drupal 9.3+ or 10+ or 11+
  • Serialization module (core)
  • Access to a CrewAI service endpoint

License

GPL-2.0-or-later