mirror of
https://github.com/crewAIInc/crewAI.git
synced 2025-12-17 21:08:29 +00:00
Compare commits
228 Commits
lg-memory-
...
1.0.0a2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
428810bd6f | ||
|
|
610bc4b3f5 | ||
|
|
e73c5887d9 | ||
|
|
c5ac5fa78a | ||
|
|
bf9e0423f2 | ||
|
|
5456c80556 | ||
|
|
df754dbcc8 | ||
|
|
f47e0c82c4 | ||
|
|
e8356b777c | ||
|
|
ade425a543 | ||
|
|
eabced321c | ||
|
|
d7f6f07a5d | ||
|
|
9e1dae0746 | ||
|
|
b5161c320d | ||
|
|
c793c829ea | ||
|
|
b77074e48e | ||
|
|
0fe9352149 | ||
|
|
548170e989 | ||
|
|
417a4e3d91 | ||
|
|
68dce92003 | ||
|
|
289b90f00a | ||
|
|
c591c1ac87 | ||
|
|
86f0dfc2d7 | ||
|
|
74b5c88834 | ||
|
|
7d5cd4d3e2 | ||
|
|
73e932bfee | ||
|
|
12fa7e2ff1 | ||
|
|
091d1267d8 | ||
|
|
b5b10a8cde | ||
|
|
2485ed93d6 | ||
|
|
ce5ea9be6f | ||
|
|
13e5ec711d | ||
|
|
e070c1400c | ||
|
|
6537e3737d | ||
|
|
346faf229f | ||
|
|
a0b757a12c | ||
|
|
1dbe8aab52 | ||
|
|
4ac65eb0a6 | ||
|
|
3e97393f58 | ||
|
|
34bed359a6 | ||
|
|
feeed505bb | ||
|
|
cb0efd05b4 | ||
|
|
db5f565dea | ||
|
|
58413b663a | ||
|
|
37636f0dd7 | ||
|
|
0e370593f1 | ||
|
|
aa8dc9d77f | ||
|
|
9c1096dbdc | ||
|
|
47044450c0 | ||
|
|
0ee438c39d | ||
|
|
cbb9965bf7 | ||
|
|
4951d30dd9 | ||
|
|
7426969736 | ||
|
|
d879be8b66 | ||
|
|
24b84a4b68 | ||
|
|
8e571ea8a7 | ||
|
|
2cfc4d37b8 | ||
|
|
f4abc41235 | ||
|
|
de5d3c3ad1 | ||
|
|
c062826779 | ||
|
|
9491fe8334 | ||
|
|
6f2ea013a7 | ||
|
|
39e8792ae5 | ||
|
|
2f682e1564 | ||
|
|
d4aa676195 | ||
|
|
578fa8c2e4 | ||
|
|
6f5af2b27c | ||
|
|
8ee3cf4874 | ||
|
|
f2d3fd0c0f | ||
|
|
f28e78c5ba | ||
|
|
81bd81e5f5 | ||
|
|
1b00cc71ef | ||
|
|
45d0c9912c | ||
|
|
1f1ab14b07 | ||
|
|
1a70f1698e | ||
|
|
8883fb656b | ||
|
|
79d65e55a1 | ||
|
|
dde76bfec5 | ||
|
|
f554123af6 | ||
|
|
4336e945b8 | ||
|
|
75b916c85a | ||
|
|
01be26ce2a | ||
|
|
c3ad5887ef | ||
|
|
260b49c10a | ||
|
|
1dc4f2e897 | ||
|
|
b126ab22dd | ||
|
|
079cb72f6e | ||
|
|
83682d511f | ||
|
|
6676d94ba1 | ||
|
|
d5126d159b | ||
|
|
fa06aea8d5 | ||
|
|
f936e0f69b | ||
|
|
37c5e88d02 | ||
|
|
1a96ed7b00 | ||
|
|
1a1bb0ca3d | ||
|
|
99b79ab20d | ||
|
|
80974fec6c | ||
|
|
30b9cdd944 | ||
|
|
610c1f70c0 | ||
|
|
ab82da02f9 | ||
|
|
f0def350a4 | ||
|
|
f4f32b5f7f | ||
|
|
49a5ae0e16 | ||
|
|
d31ffdbb90 | ||
|
|
4555ada91e | ||
|
|
92d71f7f06 | ||
|
|
dada9f140f | ||
|
|
878c1a649a | ||
|
|
1b1a8fdbf4 | ||
|
|
2633b33afc | ||
|
|
e4c4b81e63 | ||
|
|
ec1eff02a8 | ||
|
|
0f1b764c3e | ||
|
|
6ee9db1d4a | ||
|
|
109de91d08 | ||
|
|
92b70e652d | ||
|
|
fc3f2c49d2 | ||
|
|
88d2968fd5 | ||
|
|
7addda9398 | ||
|
|
4b4a119a9f | ||
|
|
869bb115c8 | ||
|
|
7ac482c7c9 | ||
|
|
2e4bd3f49d | ||
|
|
c02997d956 | ||
|
|
f96b779df5 | ||
|
|
842bed4e9c | ||
|
|
1217935b31 | ||
|
|
641c156c17 | ||
|
|
7fdf9f9290 | ||
|
|
c0d2bf4c12 | ||
|
|
ed187b495b | ||
|
|
2773996b49 | ||
|
|
95923b78c6 | ||
|
|
7065ad4336 | ||
|
|
d6254918fd | ||
|
|
95e3d6db7a | ||
|
|
d7f8002baa | ||
|
|
d743e12a06 | ||
|
|
6068fe941f | ||
|
|
2a0cefc98b | ||
|
|
a4f65e4870 | ||
|
|
a1b3edd79c | ||
|
|
80b3d9689a | ||
|
|
ec03a53121 | ||
|
|
2fdf3f3a6a | ||
|
|
1d3d7ebf5e | ||
|
|
2c2196f415 | ||
|
|
c9f30b175c | ||
|
|
a17b93a7f8 | ||
|
|
0d3e462791 | ||
|
|
947c9552f0 | ||
|
|
04a03d332f | ||
|
|
992e093610 | ||
|
|
07f8e73958 | ||
|
|
66c2fa1623 | ||
|
|
7a52cc9667 | ||
|
|
8b686fb0c6 | ||
|
|
dc6771ae95 | ||
|
|
e9b1e5a8f6 | ||
|
|
57c787f919 | ||
|
|
a0eadf783b | ||
|
|
251ae00b8b | ||
|
|
a221295394 | ||
|
|
a92211f0ba | ||
|
|
f9481cf10d | ||
|
|
915857541e | ||
|
|
7c162411b7 | ||
|
|
8f4a6cc61c | ||
|
|
7dc86dc79a | ||
|
|
7ce20cfcc6 | ||
|
|
1d9523c98f | ||
|
|
9f1d7d1aa9 | ||
|
|
79b375f6fa | ||
|
|
75752479c2 | ||
|
|
477bc1f09e | ||
|
|
66567bdc2f | ||
|
|
0b31bbe957 | ||
|
|
246cf588cd | ||
|
|
88ed91561f | ||
|
|
9a347ad458 | ||
|
|
34c3075fdb | ||
|
|
498e8dc6e8 | ||
|
|
cb522cf500 | ||
|
|
017acc74f5 | ||
|
|
fab86d197a | ||
|
|
864e9bfb76 | ||
|
|
d3b45d197c | ||
|
|
579153b070 | ||
|
|
b1fdcdfa6e | ||
|
|
18d76a270c | ||
|
|
30541239ad | ||
|
|
9a65573955 | ||
|
|
27623a1d01 | ||
|
|
2593242234 | ||
|
|
2ab6c31544 | ||
|
|
3c55c8a22a | ||
|
|
424433ff58 | ||
|
|
2fd99503ed | ||
|
|
942014962e | ||
|
|
2ab79a7dd5 | ||
|
|
27c449c9c4 | ||
|
|
9737333ffd | ||
|
|
bf248d5118 | ||
|
|
2490e8cd46 | ||
|
|
9b67e5a15f | ||
|
|
6ebb6c9b63 | ||
|
|
53f674be60 | ||
|
|
11717a5213 | ||
|
|
b6d699f764 | ||
|
|
5b15061b87 | ||
|
|
1b6b2b36d9 | ||
|
|
3ada4053bd | ||
|
|
e7a5747c6b | ||
|
|
eec1262d4f | ||
|
|
c6caa763d7 | ||
|
|
08fa3797ca | ||
|
|
bf8fa3232b | ||
|
|
a6e60a5d42 | ||
|
|
7b0f3aabd9 | ||
|
|
f071966951 | ||
|
|
318310bb7a | ||
|
|
34a03f882c | ||
|
|
a0fcc0c8d1 | ||
|
|
748c25451c | ||
|
|
a77dcdd419 | ||
|
|
68f5bdf0d9 | ||
|
|
7f83947020 | ||
|
|
ceb310bcde |
286
.cursorrules
286
.cursorrules
@@ -260,7 +260,7 @@ def handle_success(self):
|
||||
# Handle success case
|
||||
pass
|
||||
|
||||
@listen("failure_path")
|
||||
@listen("failure_path")
|
||||
def handle_failure(self):
|
||||
# Handle failure case
|
||||
pass
|
||||
@@ -288,7 +288,7 @@ class SelectiveFlow(Flow):
|
||||
def critical_step(self):
|
||||
# Only this method's state is persisted
|
||||
self.state["important_data"] = "value"
|
||||
|
||||
|
||||
@start()
|
||||
def temporary_step(self):
|
||||
# This method's state is not persisted
|
||||
@@ -322,20 +322,20 @@ flow.plot("workflow_diagram") # Generates HTML visualization
|
||||
class CyclicFlow(Flow):
|
||||
max_iterations = 5
|
||||
current_iteration = 0
|
||||
|
||||
|
||||
@start("loop")
|
||||
def process_iteration(self):
|
||||
if self.current_iteration >= self.max_iterations:
|
||||
return
|
||||
# Process current iteration
|
||||
self.current_iteration += 1
|
||||
|
||||
|
||||
@router(process_iteration)
|
||||
def check_continue(self):
|
||||
if self.current_iteration < self.max_iterations:
|
||||
return "loop" # Continue cycling
|
||||
return "complete"
|
||||
|
||||
|
||||
@listen("complete")
|
||||
def finalize(self):
|
||||
# Final processing
|
||||
@@ -369,7 +369,7 @@ def risky_operation(self):
|
||||
self.state["success"] = False
|
||||
return None
|
||||
|
||||
@listen(risky_operation)
|
||||
@listen(risky_operation)
|
||||
def handle_result(self, result):
|
||||
if self.state.get("success", False):
|
||||
# Handle success case
|
||||
@@ -390,7 +390,7 @@ class CrewOrchestrationFlow(Flow[WorkflowState]):
|
||||
result = research_crew.crew().kickoff(inputs={"topic": self.state.research_topic})
|
||||
self.state.research_results = result.raw
|
||||
return result
|
||||
|
||||
|
||||
@listen(research_phase)
|
||||
def analysis_phase(self, research_results):
|
||||
analysis_crew = AnalysisCrew()
|
||||
@@ -400,13 +400,13 @@ class CrewOrchestrationFlow(Flow[WorkflowState]):
|
||||
})
|
||||
self.state.analysis_results = result.raw
|
||||
return result
|
||||
|
||||
|
||||
@router(analysis_phase)
|
||||
def decide_next_action(self):
|
||||
if self.state.analysis_results.confidence > 0.7:
|
||||
return "generate_report"
|
||||
return "additional_research"
|
||||
|
||||
|
||||
@listen("generate_report")
|
||||
def final_report(self):
|
||||
reporting_crew = ReportingCrew()
|
||||
@@ -439,7 +439,7 @@ class CrewOrchestrationFlow(Flow[WorkflowState]):
|
||||
## CrewAI Version Compatibility:
|
||||
- Stay updated with CrewAI releases for new features and bug fixes
|
||||
- Test crew functionality when upgrading CrewAI versions
|
||||
- Use version constraints in pyproject.toml (e.g., "crewai[tools]>=0.134.0,<1.0.0")
|
||||
- Use version constraints in pyproject.toml (e.g., "crewai[tools]>=0.140.0,<1.0.0")
|
||||
- Monitor deprecation warnings for future compatibility
|
||||
|
||||
## Code Examples and Implementation Patterns
|
||||
@@ -464,22 +464,22 @@ class ResearchOutput(BaseModel):
|
||||
@CrewBase
|
||||
class ResearchCrew():
|
||||
"""Advanced research crew with structured outputs and validation"""
|
||||
|
||||
|
||||
agents: List[BaseAgent]
|
||||
tasks: List[Task]
|
||||
|
||||
|
||||
@before_kickoff
|
||||
def setup_environment(self):
|
||||
"""Initialize environment before crew execution"""
|
||||
print("🚀 Setting up research environment...")
|
||||
# Validate API keys, create directories, etc.
|
||||
|
||||
|
||||
@after_kickoff
|
||||
def cleanup_and_report(self, output):
|
||||
"""Handle post-execution tasks"""
|
||||
print(f"✅ Research completed. Generated {len(output.tasks_output)} task outputs")
|
||||
print(f"📊 Token usage: {output.token_usage}")
|
||||
|
||||
|
||||
@agent
|
||||
def researcher(self) -> Agent:
|
||||
return Agent(
|
||||
@@ -490,7 +490,7 @@ class ResearchCrew():
|
||||
max_iter=15,
|
||||
max_execution_time=1800
|
||||
)
|
||||
|
||||
|
||||
@agent
|
||||
def analyst(self) -> Agent:
|
||||
return Agent(
|
||||
@@ -499,7 +499,7 @@ class ResearchCrew():
|
||||
verbose=True,
|
||||
memory=True
|
||||
)
|
||||
|
||||
|
||||
@task
|
||||
def research_task(self) -> Task:
|
||||
return Task(
|
||||
@@ -507,7 +507,7 @@ class ResearchCrew():
|
||||
agent=self.researcher(),
|
||||
output_pydantic=ResearchOutput
|
||||
)
|
||||
|
||||
|
||||
@task
|
||||
def validation_task(self) -> Task:
|
||||
return Task(
|
||||
@@ -517,7 +517,7 @@ class ResearchCrew():
|
||||
guardrail=self.validate_research_quality,
|
||||
max_retries=3
|
||||
)
|
||||
|
||||
|
||||
def validate_research_quality(self, output) -> tuple[bool, str]:
|
||||
"""Custom guardrail to ensure research quality"""
|
||||
content = output.raw
|
||||
@@ -526,7 +526,7 @@ class ResearchCrew():
|
||||
if not any(keyword in content.lower() for keyword in ['conclusion', 'finding', 'result']):
|
||||
return False, "Missing key analytical elements."
|
||||
return True, content
|
||||
|
||||
|
||||
@crew
|
||||
def crew(self) -> Crew:
|
||||
return Crew(
|
||||
@@ -557,13 +557,13 @@ class RobustSearchTool(BaseTool):
|
||||
name: str = "robust_search"
|
||||
description: str = "Perform web search with retry logic and error handling"
|
||||
args_schema: Type[BaseModel] = SearchInput
|
||||
|
||||
|
||||
def __init__(self, api_key: Optional[str] = None, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self.api_key = api_key or os.getenv("SEARCH_API_KEY")
|
||||
self.rate_limit_delay = 1.0
|
||||
self.last_request_time = 0
|
||||
|
||||
|
||||
@retry(
|
||||
stop=stop_after_attempt(3),
|
||||
wait=wait_exponential(multiplier=1, min=4, max=10)
|
||||
@@ -575,43 +575,43 @@ class RobustSearchTool(BaseTool):
|
||||
time_since_last = time.time() - self.last_request_time
|
||||
if time_since_last < self.rate_limit_delay:
|
||||
time.sleep(self.rate_limit_delay - time_since_last)
|
||||
|
||||
|
||||
# Input validation
|
||||
if not query or len(query.strip()) == 0:
|
||||
return "Error: Empty search query provided"
|
||||
|
||||
|
||||
if len(query) > 500:
|
||||
return "Error: Search query too long (max 500 characters)"
|
||||
|
||||
|
||||
# Perform search
|
||||
results = self._perform_search(query, max_results, timeout)
|
||||
self.last_request_time = time.time()
|
||||
|
||||
|
||||
return self._format_results(results)
|
||||
|
||||
|
||||
except requests.exceptions.Timeout:
|
||||
return f"Search timed out after {timeout} seconds"
|
||||
except requests.exceptions.RequestException as e:
|
||||
return f"Search failed due to network error: {str(e)}"
|
||||
except Exception as e:
|
||||
return f"Unexpected error during search: {str(e)}"
|
||||
|
||||
|
||||
def _perform_search(self, query: str, max_results: int, timeout: int) -> List[dict]:
|
||||
"""Implement actual search logic here"""
|
||||
# Your search API implementation
|
||||
pass
|
||||
|
||||
|
||||
def _format_results(self, results: List[dict]) -> str:
|
||||
"""Format search results for LLM consumption"""
|
||||
if not results:
|
||||
return "No results found for the given query."
|
||||
|
||||
|
||||
formatted = "Search Results:\n\n"
|
||||
for i, result in enumerate(results[:10], 1):
|
||||
formatted += f"{i}. {result.get('title', 'No title')}\n"
|
||||
formatted += f" URL: {result.get('url', 'No URL')}\n"
|
||||
formatted += f" Summary: {result.get('snippet', 'No summary')}\n\n"
|
||||
|
||||
|
||||
return formatted
|
||||
```
|
||||
|
||||
@@ -623,20 +623,20 @@ from crewai.memory.storage.mem0_storage import Mem0Storage
|
||||
|
||||
class AdvancedMemoryManager:
|
||||
"""Enhanced memory management for CrewAI applications"""
|
||||
|
||||
|
||||
def __init__(self, crew, config: dict = None):
|
||||
self.crew = crew
|
||||
self.config = config or {}
|
||||
self.setup_memory_systems()
|
||||
|
||||
|
||||
def setup_memory_systems(self):
|
||||
"""Configure multiple memory systems"""
|
||||
# Short-term memory for current session
|
||||
self.short_term = ShortTermMemory()
|
||||
|
||||
|
||||
# Long-term memory for cross-session persistence
|
||||
self.long_term = LongTermMemory()
|
||||
|
||||
|
||||
# External memory with Mem0 (if configured)
|
||||
if self.config.get('use_external_memory'):
|
||||
self.external = ExternalMemory.create_storage(
|
||||
@@ -649,8 +649,8 @@ class AdvancedMemoryManager:
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
def save_with_context(self, content: str, memory_type: str = "short_term",
|
||||
|
||||
def save_with_context(self, content: str, memory_type: str = "short_term",
|
||||
metadata: dict = None, agent: str = None):
|
||||
"""Save content with enhanced metadata"""
|
||||
enhanced_metadata = {
|
||||
@@ -659,14 +659,14 @@ class AdvancedMemoryManager:
|
||||
"crew_type": self.crew.__class__.__name__,
|
||||
**(metadata or {})
|
||||
}
|
||||
|
||||
|
||||
if memory_type == "short_term":
|
||||
self.short_term.save(content, enhanced_metadata, agent)
|
||||
elif memory_type == "long_term":
|
||||
self.long_term.save(content, enhanced_metadata, agent)
|
||||
elif memory_type == "external" and hasattr(self, 'external'):
|
||||
self.external.save(content, enhanced_metadata, agent)
|
||||
|
||||
|
||||
def search_across_memories(self, query: str, limit: int = 5) -> dict:
|
||||
"""Search across all memory systems"""
|
||||
results = {
|
||||
@@ -674,23 +674,23 @@ class AdvancedMemoryManager:
|
||||
"long_term": [],
|
||||
"external": []
|
||||
}
|
||||
|
||||
|
||||
# Search short-term memory
|
||||
results["short_term"] = self.short_term.search(query, limit=limit)
|
||||
|
||||
|
||||
# Search long-term memory
|
||||
results["long_term"] = self.long_term.search(query, limit=limit)
|
||||
|
||||
|
||||
# Search external memory (if available)
|
||||
if hasattr(self, 'external'):
|
||||
results["external"] = self.external.search(query, limit=limit)
|
||||
|
||||
|
||||
return results
|
||||
|
||||
|
||||
def cleanup_old_memories(self, days_threshold: int = 30):
|
||||
"""Clean up old memories based on age"""
|
||||
cutoff_time = time.time() - (days_threshold * 24 * 60 * 60)
|
||||
|
||||
|
||||
# Implement cleanup logic based on timestamps in metadata
|
||||
# This would vary based on your specific storage implementation
|
||||
pass
|
||||
@@ -719,12 +719,12 @@ class TaskMetrics:
|
||||
|
||||
class CrewMonitor:
|
||||
"""Comprehensive monitoring for CrewAI applications"""
|
||||
|
||||
|
||||
def __init__(self, crew_name: str, log_level: str = "INFO"):
|
||||
self.crew_name = crew_name
|
||||
self.metrics: List[TaskMetrics] = []
|
||||
self.session_start = time.time()
|
||||
|
||||
|
||||
# Setup logging
|
||||
logging.basicConfig(
|
||||
level=getattr(logging, log_level),
|
||||
@@ -735,7 +735,7 @@ class CrewMonitor:
|
||||
]
|
||||
)
|
||||
self.logger = logging.getLogger(f"CrewAI.{crew_name}")
|
||||
|
||||
|
||||
def start_task_monitoring(self, task_name: str, agent_name: str) -> dict:
|
||||
"""Start monitoring a task execution"""
|
||||
context = {
|
||||
@@ -743,16 +743,16 @@ class CrewMonitor:
|
||||
"agent_name": agent_name,
|
||||
"start_time": time.time()
|
||||
}
|
||||
|
||||
|
||||
self.logger.info(f"Task started: {task_name} by {agent_name}")
|
||||
return context
|
||||
|
||||
def end_task_monitoring(self, context: dict, success: bool = True,
|
||||
|
||||
def end_task_monitoring(self, context: dict, success: bool = True,
|
||||
tokens_used: int = 0, error: str = None):
|
||||
"""End monitoring and record metrics"""
|
||||
end_time = time.time()
|
||||
duration = end_time - context["start_time"]
|
||||
|
||||
|
||||
# Get memory usage (if psutil is available)
|
||||
memory_usage = None
|
||||
try:
|
||||
@@ -761,7 +761,7 @@ class CrewMonitor:
|
||||
memory_usage = process.memory_info().rss / 1024 / 1024 # MB
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
metrics = TaskMetrics(
|
||||
task_name=context["task_name"],
|
||||
agent_name=context["agent_name"],
|
||||
@@ -773,29 +773,29 @@ class CrewMonitor:
|
||||
error_message=error,
|
||||
memory_usage_mb=memory_usage
|
||||
)
|
||||
|
||||
|
||||
self.metrics.append(metrics)
|
||||
|
||||
|
||||
# Log the completion
|
||||
status = "SUCCESS" if success else "FAILED"
|
||||
self.logger.info(f"Task {status}: {context['task_name']} "
|
||||
f"(Duration: {duration:.2f}s, Tokens: {tokens_used})")
|
||||
|
||||
|
||||
if error:
|
||||
self.logger.error(f"Task error: {error}")
|
||||
|
||||
|
||||
def get_performance_summary(self) -> Dict[str, Any]:
|
||||
"""Generate comprehensive performance summary"""
|
||||
if not self.metrics:
|
||||
return {"message": "No metrics recorded yet"}
|
||||
|
||||
|
||||
successful_tasks = [m for m in self.metrics if m.success]
|
||||
failed_tasks = [m for m in self.metrics if not m.success]
|
||||
|
||||
|
||||
total_duration = sum(m.duration for m in self.metrics)
|
||||
total_tokens = sum(m.tokens_used for m in self.metrics)
|
||||
avg_duration = total_duration / len(self.metrics)
|
||||
|
||||
|
||||
return {
|
||||
"crew_name": self.crew_name,
|
||||
"session_duration": time.time() - self.session_start,
|
||||
@@ -811,7 +811,7 @@ class CrewMonitor:
|
||||
"most_token_intensive": max(self.metrics, key=lambda x: x.tokens_used).task_name if self.metrics else None,
|
||||
"common_errors": self._get_common_errors()
|
||||
}
|
||||
|
||||
|
||||
def _get_common_errors(self) -> Dict[str, int]:
|
||||
"""Get frequency of common errors"""
|
||||
error_counts = {}
|
||||
@@ -819,20 +819,20 @@ class CrewMonitor:
|
||||
if metric.error_message:
|
||||
error_counts[metric.error_message] = error_counts.get(metric.error_message, 0) + 1
|
||||
return dict(sorted(error_counts.items(), key=lambda x: x[1], reverse=True))
|
||||
|
||||
|
||||
def export_metrics(self, filename: str = None) -> str:
|
||||
"""Export metrics to JSON file"""
|
||||
if not filename:
|
||||
filename = f"crew_metrics_{self.crew_name}_{datetime.now().strftime('%Y%m%d_%H%M%S')}.json"
|
||||
|
||||
|
||||
export_data = {
|
||||
"summary": self.get_performance_summary(),
|
||||
"detailed_metrics": [asdict(m) for m in self.metrics]
|
||||
}
|
||||
|
||||
|
||||
with open(filename, 'w') as f:
|
||||
json.dump(export_data, f, indent=2, default=str)
|
||||
|
||||
|
||||
self.logger.info(f"Metrics exported to {filename}")
|
||||
return filename
|
||||
|
||||
@@ -847,10 +847,10 @@ def monitored_research_task(self) -> Task:
|
||||
if context:
|
||||
tokens = getattr(task_output, 'token_usage', {}).get('total', 0)
|
||||
monitor.end_task_monitoring(context, success=True, tokens_used=tokens)
|
||||
|
||||
|
||||
# Start monitoring would be called before task execution
|
||||
# This is a simplified example - in practice you'd integrate this into the task execution flow
|
||||
|
||||
|
||||
return Task(
|
||||
config=self.tasks_config['research_task'],
|
||||
agent=self.researcher(),
|
||||
@@ -872,7 +872,7 @@ class ErrorSeverity(Enum):
|
||||
|
||||
class CrewError(Exception):
|
||||
"""Base exception for CrewAI applications"""
|
||||
def __init__(self, message: str, severity: ErrorSeverity = ErrorSeverity.MEDIUM,
|
||||
def __init__(self, message: str, severity: ErrorSeverity = ErrorSeverity.MEDIUM,
|
||||
context: dict = None):
|
||||
super().__init__(message)
|
||||
self.severity = severity
|
||||
@@ -893,19 +893,19 @@ class ConfigurationError(CrewError):
|
||||
|
||||
class ErrorHandler:
|
||||
"""Centralized error handling for CrewAI applications"""
|
||||
|
||||
|
||||
def __init__(self, crew_name: str):
|
||||
self.crew_name = crew_name
|
||||
self.error_log: List[CrewError] = []
|
||||
self.recovery_strategies: Dict[type, Callable] = {}
|
||||
|
||||
|
||||
def register_recovery_strategy(self, error_type: type, strategy: Callable):
|
||||
"""Register a recovery strategy for specific error types"""
|
||||
self.recovery_strategies[error_type] = strategy
|
||||
|
||||
|
||||
def handle_error(self, error: Exception, context: dict = None) -> Any:
|
||||
"""Handle errors with appropriate recovery strategies"""
|
||||
|
||||
|
||||
# Convert to CrewError if needed
|
||||
if not isinstance(error, CrewError):
|
||||
crew_error = CrewError(
|
||||
@@ -915,11 +915,11 @@ class ErrorHandler:
|
||||
)
|
||||
else:
|
||||
crew_error = error
|
||||
|
||||
|
||||
# Log the error
|
||||
self.error_log.append(crew_error)
|
||||
self._log_error(crew_error)
|
||||
|
||||
|
||||
# Apply recovery strategy if available
|
||||
error_type = type(error)
|
||||
if error_type in self.recovery_strategies:
|
||||
@@ -931,21 +931,21 @@ class ErrorHandler:
|
||||
ErrorSeverity.HIGH,
|
||||
{"original_error": str(error), "recovery_error": str(recovery_error)}
|
||||
))
|
||||
|
||||
|
||||
# If critical, re-raise
|
||||
if crew_error.severity == ErrorSeverity.CRITICAL:
|
||||
raise crew_error
|
||||
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def _log_error(self, error: CrewError):
|
||||
"""Log error with appropriate level based on severity"""
|
||||
logger = logging.getLogger(f"CrewAI.{self.crew_name}.ErrorHandler")
|
||||
|
||||
|
||||
error_msg = f"[{error.severity.value.upper()}] {error}"
|
||||
if error.context:
|
||||
error_msg += f" | Context: {error.context}"
|
||||
|
||||
|
||||
if error.severity in [ErrorSeverity.HIGH, ErrorSeverity.CRITICAL]:
|
||||
logger.error(error_msg)
|
||||
logger.error(f"Stack trace: {traceback.format_exc()}")
|
||||
@@ -953,16 +953,16 @@ class ErrorHandler:
|
||||
logger.warning(error_msg)
|
||||
else:
|
||||
logger.info(error_msg)
|
||||
|
||||
|
||||
def get_error_summary(self) -> Dict[str, Any]:
|
||||
"""Get summary of errors encountered"""
|
||||
if not self.error_log:
|
||||
return {"total_errors": 0}
|
||||
|
||||
|
||||
severity_counts = {}
|
||||
for error in self.error_log:
|
||||
severity_counts[error.severity.value] = severity_counts.get(error.severity.value, 0) + 1
|
||||
|
||||
|
||||
return {
|
||||
"total_errors": len(self.error_log),
|
||||
"severity_breakdown": severity_counts,
|
||||
@@ -1004,7 +1004,7 @@ def robust_task(self) -> Task:
|
||||
# Use fallback response
|
||||
return "Task failed, using fallback response"
|
||||
return wrapper
|
||||
|
||||
|
||||
return Task(
|
||||
config=self.tasks_config['research_task'],
|
||||
agent=self.researcher()
|
||||
@@ -1020,60 +1020,60 @@ from pydantic import BaseSettings, Field, validator
|
||||
|
||||
class Environment(str, Enum):
|
||||
DEVELOPMENT = "development"
|
||||
TESTING = "testing"
|
||||
TESTING = "testing"
|
||||
STAGING = "staging"
|
||||
PRODUCTION = "production"
|
||||
|
||||
class CrewAISettings(BaseSettings):
|
||||
"""Comprehensive settings management for CrewAI applications"""
|
||||
|
||||
|
||||
# Environment
|
||||
environment: Environment = Field(default=Environment.DEVELOPMENT)
|
||||
debug: bool = Field(default=True)
|
||||
|
||||
|
||||
# API Keys (loaded from environment)
|
||||
openai_api_key: Optional[str] = Field(default=None, env="OPENAI_API_KEY")
|
||||
anthropic_api_key: Optional[str] = Field(default=None, env="ANTHROPIC_API_KEY")
|
||||
serper_api_key: Optional[str] = Field(default=None, env="SERPER_API_KEY")
|
||||
mem0_api_key: Optional[str] = Field(default=None, env="MEM0_API_KEY")
|
||||
|
||||
|
||||
# CrewAI Configuration
|
||||
crew_max_rpm: int = Field(default=100)
|
||||
crew_max_execution_time: int = Field(default=3600) # 1 hour
|
||||
default_llm_model: str = Field(default="gpt-4")
|
||||
fallback_llm_model: str = Field(default="gpt-3.5-turbo")
|
||||
|
||||
|
||||
# Memory and Storage
|
||||
crewai_storage_dir: str = Field(default="./storage", env="CREWAI_STORAGE_DIR")
|
||||
memory_enabled: bool = Field(default=True)
|
||||
memory_cleanup_interval: int = Field(default=86400) # 24 hours in seconds
|
||||
|
||||
|
||||
# Performance
|
||||
enable_caching: bool = Field(default=True)
|
||||
max_retries: int = Field(default=3)
|
||||
retry_delay: float = Field(default=1.0)
|
||||
|
||||
|
||||
# Monitoring
|
||||
enable_monitoring: bool = Field(default=True)
|
||||
log_level: str = Field(default="INFO")
|
||||
metrics_export_interval: int = Field(default=3600) # 1 hour
|
||||
|
||||
|
||||
# Security
|
||||
input_sanitization: bool = Field(default=True)
|
||||
max_input_length: int = Field(default=10000)
|
||||
allowed_file_types: list = Field(default=["txt", "md", "pdf", "docx"])
|
||||
|
||||
|
||||
@validator('environment', pre=True)
|
||||
def set_debug_based_on_env(cls, v):
|
||||
return v
|
||||
|
||||
|
||||
@validator('debug')
|
||||
def set_debug_from_env(cls, v, values):
|
||||
env = values.get('environment')
|
||||
if env == Environment.PRODUCTION:
|
||||
return False
|
||||
return v
|
||||
|
||||
|
||||
@validator('openai_api_key')
|
||||
def validate_openai_key(cls, v):
|
||||
if not v:
|
||||
@@ -1081,15 +1081,15 @@ class CrewAISettings(BaseSettings):
|
||||
if not v.startswith('sk-'):
|
||||
raise ValueError("Invalid OpenAI API key format")
|
||||
return v
|
||||
|
||||
|
||||
@property
|
||||
def is_production(self) -> bool:
|
||||
return self.environment == Environment.PRODUCTION
|
||||
|
||||
|
||||
@property
|
||||
def is_development(self) -> bool:
|
||||
return self.environment == Environment.DEVELOPMENT
|
||||
|
||||
|
||||
def get_llm_config(self) -> Dict[str, Any]:
|
||||
"""Get LLM configuration based on environment"""
|
||||
config = {
|
||||
@@ -1098,12 +1098,12 @@ class CrewAISettings(BaseSettings):
|
||||
"max_tokens": 4000 if self.is_production else 2000,
|
||||
"timeout": 60
|
||||
}
|
||||
|
||||
|
||||
if self.is_development:
|
||||
config["model"] = self.fallback_llm_model
|
||||
|
||||
|
||||
return config
|
||||
|
||||
|
||||
def get_memory_config(self) -> Dict[str, Any]:
|
||||
"""Get memory configuration"""
|
||||
return {
|
||||
@@ -1112,7 +1112,7 @@ class CrewAISettings(BaseSettings):
|
||||
"cleanup_interval": self.memory_cleanup_interval,
|
||||
"provider": "mem0" if self.mem0_api_key and self.is_production else "local"
|
||||
}
|
||||
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
env_file_encoding = 'utf-8'
|
||||
@@ -1125,25 +1125,25 @@ settings = CrewAISettings()
|
||||
@CrewBase
|
||||
class ConfigurableCrew():
|
||||
"""Crew that uses centralized configuration"""
|
||||
|
||||
|
||||
def __init__(self):
|
||||
self.settings = settings
|
||||
self.validate_configuration()
|
||||
|
||||
|
||||
def validate_configuration(self):
|
||||
"""Validate configuration before crew execution"""
|
||||
required_keys = [self.settings.openai_api_key]
|
||||
if not all(required_keys):
|
||||
raise ConfigurationError("Missing required API keys")
|
||||
|
||||
|
||||
if not os.path.exists(self.settings.crewai_storage_dir):
|
||||
os.makedirs(self.settings.crewai_storage_dir, exist_ok=True)
|
||||
|
||||
|
||||
@agent
|
||||
def adaptive_agent(self) -> Agent:
|
||||
"""Agent that adapts to configuration"""
|
||||
llm_config = self.settings.get_llm_config()
|
||||
|
||||
|
||||
return Agent(
|
||||
config=self.agents_config['researcher'],
|
||||
llm=llm_config["model"],
|
||||
@@ -1163,7 +1163,7 @@ from crewai.tasks.task_output import TaskOutput
|
||||
|
||||
class CrewAITestFramework:
|
||||
"""Comprehensive testing framework for CrewAI applications"""
|
||||
|
||||
|
||||
@staticmethod
|
||||
def create_mock_agent(role: str = "test_agent", tools: list = None) -> Mock:
|
||||
"""Create a mock agent for testing"""
|
||||
@@ -1175,9 +1175,9 @@ class CrewAITestFramework:
|
||||
mock_agent.llm = "gpt-3.5-turbo"
|
||||
mock_agent.verbose = False
|
||||
return mock_agent
|
||||
|
||||
|
||||
@staticmethod
|
||||
def create_mock_task_output(content: str, success: bool = True,
|
||||
def create_mock_task_output(content: str, success: bool = True,
|
||||
tokens: int = 100) -> TaskOutput:
|
||||
"""Create a mock task output for testing"""
|
||||
return TaskOutput(
|
||||
@@ -1187,13 +1187,13 @@ class CrewAITestFramework:
|
||||
pydantic=None,
|
||||
json_dict=None
|
||||
)
|
||||
|
||||
|
||||
@staticmethod
|
||||
def create_test_crew(agents: list = None, tasks: list = None) -> Crew:
|
||||
"""Create a test crew with mock components"""
|
||||
test_agents = agents or [CrewAITestFramework.create_mock_agent()]
|
||||
test_tasks = tasks or []
|
||||
|
||||
|
||||
return Crew(
|
||||
agents=test_agents,
|
||||
tasks=test_tasks,
|
||||
@@ -1203,53 +1203,53 @@ class CrewAITestFramework:
|
||||
# Example test cases
|
||||
class TestResearchCrew:
|
||||
"""Test cases for research crew functionality"""
|
||||
|
||||
|
||||
def setup_method(self):
|
||||
"""Setup test environment"""
|
||||
self.framework = CrewAITestFramework()
|
||||
self.mock_serper = Mock()
|
||||
|
||||
|
||||
@patch('crewai_tools.SerperDevTool')
|
||||
def test_agent_creation(self, mock_serper_tool):
|
||||
"""Test agent creation with proper configuration"""
|
||||
mock_serper_tool.return_value = self.mock_serper
|
||||
|
||||
|
||||
crew = ResearchCrew()
|
||||
researcher = crew.researcher()
|
||||
|
||||
|
||||
assert researcher.role == "Senior Research Analyst"
|
||||
assert len(researcher.tools) > 0
|
||||
assert researcher.verbose is True
|
||||
|
||||
|
||||
def test_task_validation(self):
|
||||
"""Test task validation logic"""
|
||||
crew = ResearchCrew()
|
||||
|
||||
|
||||
# Test valid output
|
||||
valid_output = self.framework.create_mock_task_output(
|
||||
"This is a comprehensive research summary with conclusions and findings."
|
||||
)
|
||||
is_valid, message = crew.validate_research_quality(valid_output)
|
||||
assert is_valid is True
|
||||
|
||||
|
||||
# Test invalid output (too short)
|
||||
invalid_output = self.framework.create_mock_task_output("Too short")
|
||||
is_valid, message = crew.validate_research_quality(invalid_output)
|
||||
assert is_valid is False
|
||||
assert "brief" in message.lower()
|
||||
|
||||
|
||||
@patch('requests.get')
|
||||
def test_tool_error_handling(self, mock_requests):
|
||||
"""Test tool error handling and recovery"""
|
||||
# Simulate network error
|
||||
mock_requests.side_effect = requests.exceptions.RequestException("Network error")
|
||||
|
||||
|
||||
tool = RobustSearchTool()
|
||||
result = tool._run("test query")
|
||||
|
||||
|
||||
assert "network error" in result.lower()
|
||||
assert "failed" in result.lower()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_crew_execution_flow(self):
|
||||
"""Test complete crew execution with mocked dependencies"""
|
||||
@@ -1257,18 +1257,18 @@ class TestResearchCrew:
|
||||
mock_execute.return_value = self.framework.create_mock_task_output(
|
||||
"Research completed successfully with findings and recommendations."
|
||||
)
|
||||
|
||||
|
||||
crew = ResearchCrew()
|
||||
result = crew.crew().kickoff(inputs={"topic": "AI testing"})
|
||||
|
||||
|
||||
assert result is not None
|
||||
assert "successfully" in result.raw.lower()
|
||||
|
||||
|
||||
def test_memory_integration(self):
|
||||
"""Test memory system integration"""
|
||||
crew = ResearchCrew()
|
||||
memory_manager = AdvancedMemoryManager(crew)
|
||||
|
||||
|
||||
# Test saving to memory
|
||||
test_content = "Important research finding about AI"
|
||||
memory_manager.save_with_context(
|
||||
@@ -1277,34 +1277,34 @@ class TestResearchCrew:
|
||||
metadata={"importance": "high"},
|
||||
agent="researcher"
|
||||
)
|
||||
|
||||
|
||||
# Test searching memory
|
||||
results = memory_manager.search_across_memories("AI research")
|
||||
assert "short_term" in results
|
||||
|
||||
|
||||
def test_error_handling_workflow(self):
|
||||
"""Test error handling and recovery mechanisms"""
|
||||
error_handler = ErrorHandler("test_crew")
|
||||
|
||||
|
||||
# Test error registration and handling
|
||||
test_error = TaskExecutionError("Test task failed", ErrorSeverity.MEDIUM)
|
||||
result = error_handler.handle_error(test_error)
|
||||
|
||||
|
||||
assert len(error_handler.error_log) == 1
|
||||
assert error_handler.error_log[0].severity == ErrorSeverity.MEDIUM
|
||||
|
||||
|
||||
def test_configuration_validation(self):
|
||||
"""Test configuration validation"""
|
||||
# Test with missing API key
|
||||
with patch.dict(os.environ, {}, clear=True):
|
||||
with pytest.raises(ValueError):
|
||||
settings = CrewAISettings()
|
||||
|
||||
|
||||
# Test with valid configuration
|
||||
with patch.dict(os.environ, {"OPENAI_API_KEY": "sk-test-key"}):
|
||||
settings = CrewAISettings()
|
||||
assert settings.openai_api_key == "sk-test-key"
|
||||
|
||||
|
||||
@pytest.mark.integration
|
||||
def test_end_to_end_workflow(self):
|
||||
"""Integration test for complete workflow"""
|
||||
@@ -1315,41 +1315,41 @@ class TestResearchCrew:
|
||||
# Performance testing
|
||||
class TestCrewPerformance:
|
||||
"""Performance tests for CrewAI applications"""
|
||||
|
||||
|
||||
def test_memory_usage(self):
|
||||
"""Test memory usage during crew execution"""
|
||||
import psutil
|
||||
import gc
|
||||
|
||||
|
||||
process = psutil.Process()
|
||||
initial_memory = process.memory_info().rss
|
||||
|
||||
|
||||
# Create and run crew multiple times
|
||||
for i in range(10):
|
||||
crew = ResearchCrew()
|
||||
# Simulate crew execution
|
||||
del crew
|
||||
gc.collect()
|
||||
|
||||
|
||||
final_memory = process.memory_info().rss
|
||||
memory_increase = final_memory - initial_memory
|
||||
|
||||
|
||||
# Assert memory increase is reasonable (less than 100MB)
|
||||
assert memory_increase < 100 * 1024 * 1024
|
||||
|
||||
|
||||
def test_concurrent_execution(self):
|
||||
"""Test concurrent crew execution"""
|
||||
import concurrent.futures
|
||||
|
||||
|
||||
def run_crew(crew_id):
|
||||
crew = ResearchCrew()
|
||||
# Simulate execution
|
||||
return f"crew_{crew_id}_completed"
|
||||
|
||||
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=3) as executor:
|
||||
futures = [executor.submit(run_crew, i) for i in range(5)]
|
||||
results = [future.result() for future in futures]
|
||||
|
||||
|
||||
assert len(results) == 5
|
||||
assert all("completed" in result for result in results)
|
||||
|
||||
@@ -1400,7 +1400,7 @@ class TestCrewPerformance:
|
||||
|
||||
### Development:
|
||||
1. Always use .env files for sensitive configuration
|
||||
2. Implement comprehensive error handling and logging
|
||||
2. Implement comprehensive error handling and logging
|
||||
3. Use structured outputs with Pydantic for reliability
|
||||
4. Test crew functionality with different input scenarios
|
||||
5. Follow CrewAI patterns and conventions consistently
|
||||
@@ -1426,4 +1426,4 @@ class TestCrewPerformance:
|
||||
5. Use async patterns for I/O-bound operations
|
||||
6. Implement proper connection pooling and resource management
|
||||
7. Profile and optimize critical paths
|
||||
8. Plan for horizontal scaling when needed
|
||||
8. Plan for horizontal scaling when needed
|
||||
|
||||
46
.github/workflows/build-uv-cache.yml
vendored
Normal file
46
.github/workflows/build-uv-cache.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
name: Build uv cache
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "uv.lock"
|
||||
- "pyproject.toml"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build-cache:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
with:
|
||||
version: "0.8.4"
|
||||
python-version: ${{ matrix.python-version }}
|
||||
enable-cache: false
|
||||
|
||||
- name: Install dependencies and populate cache
|
||||
run: |
|
||||
echo "Building global UV cache for Python ${{ matrix.python-version }}..."
|
||||
uv sync --all-groups --all-extras --no-install-project
|
||||
echo "Cache populated successfully"
|
||||
|
||||
- name: Save uv caches
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
.venv
|
||||
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||
102
.github/workflows/codeql.yml
vendored
Normal file
102
.github/workflows/codeql.yml
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL Advanced"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
paths-ignore:
|
||||
- "lib/crewai/src/crewai/cli/templates/**"
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
paths-ignore:
|
||||
- "lib/crewai/src/crewai/cli/templates/**"
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze (${{ matrix.language }})
|
||||
# Runner size impacts CodeQL analysis time. To learn more, please see:
|
||||
# - https://gh.io/recommended-hardware-resources-for-running-codeql
|
||||
# - https://gh.io/supported-runners-and-hardware-resources
|
||||
# - https://gh.io/using-larger-runners (GitHub.com only)
|
||||
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
|
||||
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
||||
permissions:
|
||||
# required for all workflows
|
||||
security-events: write
|
||||
|
||||
# required to fetch internal or private CodeQL packs
|
||||
packages: read
|
||||
|
||||
# only required for workflows in private repositories
|
||||
actions: read
|
||||
contents: read
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- language: actions
|
||||
build-mode: none
|
||||
- language: python
|
||||
build-mode: none
|
||||
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
|
||||
# Use `c-cpp` to analyze code written in C, C++ or both
|
||||
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
|
||||
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
|
||||
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
|
||||
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
|
||||
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
|
||||
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Add any setup steps before running the `github/codeql-action/init` action.
|
||||
# This includes steps like installing compilers or runtimes (`actions/setup-node`
|
||||
# or others). This is typically only required for manual builds.
|
||||
# - name: Setup runtime (example)
|
||||
# uses: actions/setup-example@v1
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
build-mode: ${{ matrix.build-mode }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
|
||||
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||
# queries: security-extended,security-and-quality
|
||||
|
||||
# If the analyze step fails for one of the languages you are analyzing with
|
||||
# "We were unable to automatically build your code", modify the matrix above
|
||||
# to set the build mode to "manual" for that language. Then modify this step
|
||||
# to build your code.
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
- if: matrix.build-mode == 'manual'
|
||||
shell: bash
|
||||
run: |
|
||||
echo 'If you are using a "manual" build mode for one or more of the' \
|
||||
'languages you are analyzing, replace this with the commands to build' \
|
||||
'your code, for example:'
|
||||
echo ' make bootstrap'
|
||||
echo ' make release'
|
||||
exit 1
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
44
.github/workflows/linter.yml
vendored
44
.github/workflows/linter.yml
vendored
@@ -2,6 +2,9 @@ name: Lint
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -15,8 +18,27 @@ jobs:
|
||||
- name: Fetch Target Branch
|
||||
run: git fetch origin $TARGET_BRANCH --depth=1
|
||||
|
||||
- name: Install Ruff
|
||||
run: pip install ruff
|
||||
- name: Restore global uv cache
|
||||
id: cache-restore
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
.venv
|
||||
key: uv-main-py3.11-${{ hashFiles('uv.lock') }}
|
||||
restore-keys: |
|
||||
uv-main-py3.11-
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
with:
|
||||
version: "0.8.4"
|
||||
python-version: "3.11"
|
||||
enable-cache: false
|
||||
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-groups --all-extras --no-install-project
|
||||
|
||||
- name: Get Changed Python Files
|
||||
id: changed-files
|
||||
@@ -30,7 +52,17 @@ jobs:
|
||||
- name: Run Ruff on Changed Files
|
||||
if: ${{ steps.changed-files.outputs.files != '' }}
|
||||
run: |
|
||||
echo "${{ steps.changed-files.outputs.files }}" \
|
||||
| tr ' ' '\n' \
|
||||
| grep -v 'src/crewai/cli/templates/' \
|
||||
| xargs -I{} ruff check "{}"
|
||||
echo "${{ steps.changed-files.outputs.files }}" \
|
||||
| tr ' ' '\n' \
|
||||
| grep -v 'src/crewai/cli/templates/' \
|
||||
| xargs -I{} uv run ruff check "{}"
|
||||
|
||||
- name: Save uv caches
|
||||
if: steps.cache-restore.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
.venv
|
||||
key: uv-main-py3.11-${{ hashFiles('uv.lock') }}
|
||||
|
||||
71
.github/workflows/publish.yml
vendored
Normal file
71
.github/workflows/publish.yml
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
name: Publish to PyPI
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [ published ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: github.event.release.prerelease == true
|
||||
name: Build packages
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v4
|
||||
|
||||
- name: Build packages
|
||||
run: |
|
||||
uv build --all-packages
|
||||
rm dist/.gitignore
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: dist
|
||||
path: dist/
|
||||
|
||||
publish:
|
||||
if: github.event.release.prerelease == true
|
||||
name: Publish to PyPI
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: pypi
|
||||
url: https://pypi.org/p/crewai
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
with:
|
||||
version: "0.8.4"
|
||||
python-version: "3.12"
|
||||
enable-cache: false
|
||||
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: dist
|
||||
path: dist
|
||||
|
||||
- name: Publish to PyPI
|
||||
env:
|
||||
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
||||
run: |
|
||||
for package in dist/*; do
|
||||
echo "Publishing $package"
|
||||
uv publish "$package"
|
||||
done
|
||||
23
.github/workflows/security-checker.yml
vendored
23
.github/workflows/security-checker.yml
vendored
@@ -1,23 +0,0 @@
|
||||
name: Security Checker
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
security-check:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11.9"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install bandit
|
||||
|
||||
- name: Run Bandit
|
||||
run: bandit -c pyproject.toml -r src/ -ll
|
||||
|
||||
102
.github/workflows/tests.yml
vendored
102
.github/workflows/tests.yml
vendored
@@ -3,32 +3,116 @@ name: Run Tests
|
||||
on: [pull_request]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
contents: read
|
||||
|
||||
env:
|
||||
OPENAI_API_KEY: fake-api-key
|
||||
PYTHONUNBUFFERED: 1
|
||||
BRAVE_API_KEY: fake-brave-key
|
||||
SNOWFLAKE_USER: fake-snowflake-user
|
||||
SNOWFLAKE_PASSWORD: fake-snowflake-password
|
||||
SNOWFLAKE_ACCOUNT: fake-snowflake-account
|
||||
SNOWFLAKE_WAREHOUSE: fake-snowflake-warehouse
|
||||
SNOWFLAKE_DATABASE: fake-snowflake-database
|
||||
SNOWFLAKE_SCHEMA: fake-snowflake-schema
|
||||
EMBEDCHAIN_DB_URI: sqlite:///test.db
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: tests (${{ matrix.python-version }})
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12', '3.13']
|
||||
group: [1, 2, 3, 4, 5, 6, 7, 8]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Fetch all history for proper diff
|
||||
|
||||
- name: Restore global uv cache
|
||||
id: cache-restore
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
.venv
|
||||
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||
restore-keys: |
|
||||
uv-main-py${{ matrix.python-version }}-
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v3
|
||||
uses: astral-sh/setup-uv@v6
|
||||
with:
|
||||
enable-cache: true
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
run: uv python install ${{ matrix.python-version }}
|
||||
version: "0.8.4"
|
||||
python-version: ${{ matrix.python-version }}
|
||||
enable-cache: false
|
||||
|
||||
- name: Install the project
|
||||
run: uv sync --dev --all-extras
|
||||
run: uv sync --all-groups --all-extras
|
||||
|
||||
- name: Run tests
|
||||
run: uv run pytest --block-network --timeout=60 -vv
|
||||
- name: Restore test durations
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: .test_durations_py*
|
||||
key: test-durations-py${{ matrix.python-version }}
|
||||
|
||||
- name: Run tests (group ${{ matrix.group }} of 8)
|
||||
run: |
|
||||
PYTHON_VERSION_SAFE=$(echo "${{ matrix.python-version }}" | tr '.' '_')
|
||||
DURATION_FILE="../../.test_durations_py${PYTHON_VERSION_SAFE}"
|
||||
|
||||
# Temporarily always skip cached durations to fix test splitting
|
||||
# When durations don't match, pytest-split runs duplicate tests instead of splitting
|
||||
echo "Using even test splitting (duration cache disabled until fix merged)"
|
||||
DURATIONS_ARG=""
|
||||
|
||||
# Original logic (disabled temporarily):
|
||||
# if [ ! -f "$DURATION_FILE" ]; then
|
||||
# echo "No cached durations found, tests will be split evenly"
|
||||
# DURATIONS_ARG=""
|
||||
# elif git diff origin/${{ github.base_ref }}...HEAD --name-only 2>/dev/null | grep -q "^tests/.*\.py$"; then
|
||||
# echo "Test files have changed, skipping cached durations to avoid mismatches"
|
||||
# DURATIONS_ARG=""
|
||||
# else
|
||||
# echo "No test changes detected, using cached test durations for optimal splitting"
|
||||
# DURATIONS_ARG="--durations-path=${DURATION_FILE}"
|
||||
# fi
|
||||
|
||||
cd lib/crewai && uv run pytest \
|
||||
--block-network \
|
||||
--timeout=30 \
|
||||
-vv \
|
||||
--splits 8 \
|
||||
--group ${{ matrix.group }} \
|
||||
$DURATIONS_ARG \
|
||||
--durations=10 \
|
||||
-n auto \
|
||||
--maxfail=3
|
||||
|
||||
- name: Run tool tests (group ${{ matrix.group }} of 8)
|
||||
run: |
|
||||
cd lib/crewai-tools && uv run pytest \
|
||||
--block-network \
|
||||
--timeout=30 \
|
||||
-vv \
|
||||
--splits 8 \
|
||||
--group ${{ matrix.group }} \
|
||||
--durations=10 \
|
||||
-n auto \
|
||||
--maxfail=3
|
||||
|
||||
|
||||
- name: Save uv caches
|
||||
if: steps.cache-restore.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
.venv
|
||||
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||
|
||||
95
.github/workflows/type-checker.yml
vendored
95
.github/workflows/type-checker.yml
vendored
@@ -3,24 +3,99 @@ name: Run Type Checks
|
||||
on: [pull_request]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
type-checker:
|
||||
type-checker-matrix:
|
||||
name: type-checker (${{ matrix.python-version }})
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11.9"
|
||||
fetch-depth: 0 # Fetch all history for proper diff
|
||||
|
||||
- name: Install Requirements
|
||||
- name: Restore global uv cache
|
||||
id: cache-restore
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
.venv
|
||||
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||
restore-keys: |
|
||||
uv-main-py${{ matrix.python-version }}-
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
with:
|
||||
version: "0.8.4"
|
||||
python-version: ${{ matrix.python-version }}
|
||||
enable-cache: false
|
||||
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-groups --all-extras
|
||||
|
||||
- name: Get changed Python files
|
||||
id: changed-files
|
||||
run: |
|
||||
pip install mypy
|
||||
# Get the list of changed Python files compared to the base branch
|
||||
echo "Fetching changed files..."
|
||||
git diff --name-only --diff-filter=ACMRT origin/${{ github.base_ref }}...HEAD -- '*.py' > changed_files.txt
|
||||
|
||||
- name: Run type checks
|
||||
run: mypy src
|
||||
# Filter for files in src/ directory only (excluding tests/)
|
||||
grep -E "^src/" changed_files.txt > filtered_changed_files.txt || true
|
||||
|
||||
# Check if there are any changed files
|
||||
if [ -s filtered_changed_files.txt ]; then
|
||||
echo "Changed Python files in src/:"
|
||||
cat filtered_changed_files.txt
|
||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||
# Convert newlines to spaces for mypy command
|
||||
echo "files=$(cat filtered_changed_files.txt | tr '\n' ' ')" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "No Python files changed in src/"
|
||||
echo "has_changes=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Run type checks on changed files
|
||||
if: steps.changed-files.outputs.has_changes == 'true'
|
||||
run: |
|
||||
echo "Running mypy on changed files with Python ${{ matrix.python-version }}..."
|
||||
uv run mypy ${{ steps.changed-files.outputs.files }}
|
||||
|
||||
- name: No files to check
|
||||
if: steps.changed-files.outputs.has_changes == 'false'
|
||||
run: echo "No Python files in src/ were modified - skipping type checks"
|
||||
|
||||
- name: Save uv caches
|
||||
if: steps.cache-restore.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
.venv
|
||||
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||
|
||||
# Summary job to provide single status for branch protection
|
||||
type-checker:
|
||||
name: type-checker
|
||||
runs-on: ubuntu-latest
|
||||
needs: type-checker-matrix
|
||||
if: always()
|
||||
steps:
|
||||
- name: Check matrix results
|
||||
run: |
|
||||
if [ "${{ needs.type-checker-matrix.result }}" == "success" ] || [ "${{ needs.type-checker-matrix.result }}" == "skipped" ]; then
|
||||
echo "✅ All type checks passed"
|
||||
else
|
||||
echo "❌ Type checks failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
71
.github/workflows/update-test-durations.yml
vendored
Normal file
71
.github/workflows/update-test-durations.yml
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
name: Update Test Durations
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'tests/**/*.py'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
update-durations:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12', '3.13']
|
||||
env:
|
||||
OPENAI_API_KEY: fake-api-key
|
||||
PYTHONUNBUFFERED: 1
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Restore global uv cache
|
||||
id: cache-restore
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
.venv
|
||||
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||
restore-keys: |
|
||||
uv-main-py${{ matrix.python-version }}-
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
with:
|
||||
version: "0.8.4"
|
||||
python-version: ${{ matrix.python-version }}
|
||||
enable-cache: false
|
||||
|
||||
- name: Install the project
|
||||
run: uv sync --all-groups --all-extras
|
||||
|
||||
- name: Run all tests and store durations
|
||||
run: |
|
||||
PYTHON_VERSION_SAFE=$(echo "${{ matrix.python-version }}" | tr '.' '_')
|
||||
uv run pytest --store-durations --durations-path=.test_durations_py${PYTHON_VERSION_SAFE} -n auto
|
||||
continue-on-error: true
|
||||
|
||||
- name: Save durations to cache
|
||||
if: always()
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: .test_durations_py*
|
||||
key: test-durations-py${{ matrix.python-version }}
|
||||
|
||||
- name: Save uv caches
|
||||
if: steps.cache-restore.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
.venv
|
||||
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -2,7 +2,6 @@
|
||||
.pytest_cache
|
||||
__pycache__
|
||||
dist/
|
||||
lib/
|
||||
.env
|
||||
assets/*
|
||||
.idea
|
||||
@@ -21,9 +20,9 @@ crew_tasks_output.json
|
||||
.mypy_cache
|
||||
.ruff_cache
|
||||
.venv
|
||||
agentops.log
|
||||
test_flow.html
|
||||
crewairules.mdc
|
||||
plan.md
|
||||
conceptual_plan.md
|
||||
build_image
|
||||
build_image
|
||||
chromadb-*.lock
|
||||
|
||||
@@ -1,7 +1,21 @@
|
||||
repos:
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.8.2
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: ruff
|
||||
args: ["--fix"]
|
||||
name: ruff
|
||||
entry: uv run ruff check
|
||||
language: system
|
||||
types: [python]
|
||||
exclude: ^lib/crewai/
|
||||
- id: ruff-format
|
||||
name: ruff-format
|
||||
entry: uv run ruff format
|
||||
language: system
|
||||
types: [python]
|
||||
exclude: ^lib/crewai/
|
||||
- id: mypy
|
||||
name: mypy
|
||||
entry: uv run mypy
|
||||
language: system
|
||||
types: [python]
|
||||
exclude: ^lib/crewai/
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
exclude = [
|
||||
"templates",
|
||||
"__init__.py",
|
||||
]
|
||||
40
README.md
40
README.md
@@ -62,9 +62,9 @@
|
||||
With over 100,000 developers certified through our community courses at [learn.crewai.com](https://learn.crewai.com), CrewAI is rapidly becoming the
|
||||
standard for enterprise-ready AI automation.
|
||||
|
||||
# CrewAI Enterprise Suite
|
||||
# CrewAI AMP Suite
|
||||
|
||||
CrewAI Enterprise Suite is a comprehensive bundle tailored for organizations that require secure, scalable, and easy-to-manage agent-driven automation.
|
||||
CrewAI AMP Suite is a comprehensive bundle tailored for organizations that require secure, scalable, and easy-to-manage agent-driven automation.
|
||||
|
||||
You can try one part of the suite the [Crew Control Plane for free](https://app.crewai.com)
|
||||
|
||||
@@ -76,9 +76,9 @@ You can try one part of the suite the [Crew Control Plane for free](https://app.
|
||||
- **Advanced Security**: Built-in robust security and compliance measures ensuring safe deployment and management.
|
||||
- **Actionable Insights**: Real-time analytics and reporting to optimize performance and decision-making.
|
||||
- **24/7 Support**: Dedicated enterprise support to ensure uninterrupted operation and quick resolution of issues.
|
||||
- **On-premise and Cloud Deployment Options**: Deploy CrewAI Enterprise on-premise or in the cloud, depending on your security and compliance requirements.
|
||||
- **On-premise and Cloud Deployment Options**: Deploy CrewAI AMP on-premise or in the cloud, depending on your security and compliance requirements.
|
||||
|
||||
CrewAI Enterprise is designed for enterprises seeking a powerful, reliable solution to transform complex business processes into efficient,
|
||||
CrewAI AMP is designed for enterprises seeking a powerful, reliable solution to transform complex business processes into efficient,
|
||||
intelligent automations.
|
||||
|
||||
## Table of contents
|
||||
@@ -418,10 +418,10 @@ Choose CrewAI to easily build powerful, adaptable, and production-ready AI autom
|
||||
|
||||
You can test different real life examples of AI crews in the [CrewAI-examples repo](https://github.com/crewAIInc/crewAI-examples?tab=readme-ov-file):
|
||||
|
||||
- [Landing Page Generator](https://github.com/crewAIInc/crewAI-examples/tree/main/landing_page_generator)
|
||||
- [Landing Page Generator](https://github.com/crewAIInc/crewAI-examples/tree/main/crews/landing_page_generator)
|
||||
- [Having Human input on the execution](https://docs.crewai.com/how-to/Human-Input-on-Execution)
|
||||
- [Trip Planner](https://github.com/crewAIInc/crewAI-examples/tree/main/trip_planner)
|
||||
- [Stock Analysis](https://github.com/crewAIInc/crewAI-examples/tree/main/stock_analysis)
|
||||
- [Trip Planner](https://github.com/crewAIInc/crewAI-examples/tree/main/crews/trip_planner)
|
||||
- [Stock Analysis](https://github.com/crewAIInc/crewAI-examples/tree/main/crews/stock_analysis)
|
||||
|
||||
### Quick Tutorial
|
||||
|
||||
@@ -429,19 +429,19 @@ You can test different real life examples of AI crews in the [CrewAI-examples re
|
||||
|
||||
### Write Job Descriptions
|
||||
|
||||
[Check out code for this example](https://github.com/crewAIInc/crewAI-examples/tree/main/job-posting) or watch a video below:
|
||||
[Check out code for this example](https://github.com/crewAIInc/crewAI-examples/tree/main/crews/job-posting) or watch a video below:
|
||||
|
||||
[](https://www.youtube.com/watch?v=u98wEMz-9to "Jobs postings")
|
||||
|
||||
### Trip Planner
|
||||
|
||||
[Check out code for this example](https://github.com/crewAIInc/crewAI-examples/tree/main/trip_planner) or watch a video below:
|
||||
[Check out code for this example](https://github.com/crewAIInc/crewAI-examples/tree/main/crews/trip_planner) or watch a video below:
|
||||
|
||||
[](https://www.youtube.com/watch?v=xis7rWp-hjs "Trip Planner")
|
||||
|
||||
### Stock Analysis
|
||||
|
||||
[Check out code for this example](https://github.com/crewAIInc/crewAI-examples/tree/main/stock_analysis) or watch a video below:
|
||||
[Check out code for this example](https://github.com/crewAIInc/crewAI-examples/tree/main/crews/stock_analysis) or watch a video below:
|
||||
|
||||
[](https://www.youtube.com/watch?v=e0Uj4yWdaAg "Stock Analysis")
|
||||
|
||||
@@ -674,9 +674,9 @@ CrewAI is released under the [MIT License](https://github.com/crewAIInc/crewAI/b
|
||||
|
||||
### Enterprise Features
|
||||
|
||||
- [What additional features does CrewAI Enterprise offer?](#q-what-additional-features-does-crewai-enterprise-offer)
|
||||
- [Is CrewAI Enterprise available for cloud and on-premise deployments?](#q-is-crewai-enterprise-available-for-cloud-and-on-premise-deployments)
|
||||
- [Can I try CrewAI Enterprise for free?](#q-can-i-try-crewai-enterprise-for-free)
|
||||
- [What additional features does CrewAI AMP offer?](#q-what-additional-features-does-crewai-amp-offer)
|
||||
- [Is CrewAI AMP available for cloud and on-premise deployments?](#q-is-crewai-amp-available-for-cloud-and-on-premise-deployments)
|
||||
- [Can I try CrewAI AMP for free?](#q-can-i-try-crewai-amp-for-free)
|
||||
|
||||
### Q: What exactly is CrewAI?
|
||||
|
||||
@@ -732,17 +732,17 @@ A: Check out practical examples in the [CrewAI-examples repository](https://gith
|
||||
|
||||
A: Contributions are warmly welcomed! Fork the repository, create your branch, implement your changes, and submit a pull request. See the Contribution section of the README for detailed guidelines.
|
||||
|
||||
### Q: What additional features does CrewAI Enterprise offer?
|
||||
### Q: What additional features does CrewAI AMP offer?
|
||||
|
||||
A: CrewAI Enterprise provides advanced features such as a unified control plane, real-time observability, secure integrations, advanced security, actionable insights, and dedicated 24/7 enterprise support.
|
||||
A: CrewAI AMP provides advanced features such as a unified control plane, real-time observability, secure integrations, advanced security, actionable insights, and dedicated 24/7 enterprise support.
|
||||
|
||||
### Q: Is CrewAI Enterprise available for cloud and on-premise deployments?
|
||||
### Q: Is CrewAI AMP available for cloud and on-premise deployments?
|
||||
|
||||
A: Yes, CrewAI Enterprise supports both cloud-based and on-premise deployment options, allowing enterprises to meet their specific security and compliance requirements.
|
||||
A: Yes, CrewAI AMP supports both cloud-based and on-premise deployment options, allowing enterprises to meet their specific security and compliance requirements.
|
||||
|
||||
### Q: Can I try CrewAI Enterprise for free?
|
||||
### Q: Can I try CrewAI AMP for free?
|
||||
|
||||
A: Yes, you can explore part of the CrewAI Enterprise Suite by accessing the [Crew Control Plane](https://app.crewai.com) for free.
|
||||
A: Yes, you can explore part of the CrewAI AMP Suite by accessing the [Crew Control Plane](https://app.crewai.com) for free.
|
||||
|
||||
### Q: Does CrewAI support fine-tuning or training custom models?
|
||||
|
||||
@@ -762,7 +762,7 @@ A: CrewAI is highly scalable, supporting simple automations and large-scale ente
|
||||
|
||||
### Q: Does CrewAI offer debugging and monitoring tools?
|
||||
|
||||
A: Yes, CrewAI Enterprise includes advanced debugging, tracing, and real-time observability features, simplifying the management and troubleshooting of your automations.
|
||||
A: Yes, CrewAI AMP includes advanced debugging, tracing, and real-time observability features, simplifying the management and troubleshooting of your automations.
|
||||
|
||||
### Q: What programming languages does CrewAI support?
|
||||
|
||||
|
||||
808
docs/docs.json
808
docs/docs.json
File diff suppressed because it is too large
Load Diff
8
docs/en/api-reference/inputs.mdx
Normal file
8
docs/en/api-reference/inputs.mdx
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
title: "GET /inputs"
|
||||
description: "Get required inputs for your crew"
|
||||
openapi: "/enterprise-api.en.yaml GET /inputs"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
|
||||
@@ -1,28 +1,29 @@
|
||||
---
|
||||
title: "Introduction"
|
||||
description: "Complete reference for the CrewAI Enterprise REST API"
|
||||
description: "Complete reference for the CrewAI AMP REST API"
|
||||
icon: "code"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
# CrewAI Enterprise API
|
||||
# CrewAI AMP API
|
||||
|
||||
Welcome to the CrewAI Enterprise API reference. This API allows you to programmatically interact with your deployed crews, enabling integration with your applications, workflows, and services.
|
||||
Welcome to the CrewAI AMP API reference. This API allows you to programmatically interact with your deployed crews, enabling integration with your applications, workflows, and services.
|
||||
|
||||
## Quick Start
|
||||
|
||||
<Steps>
|
||||
<Step title="Get Your API Credentials">
|
||||
Navigate to your crew's detail page in the CrewAI Enterprise dashboard and copy your Bearer Token from the Status tab.
|
||||
Navigate to your crew's detail page in the CrewAI AMP dashboard and copy your Bearer Token from the Status tab.
|
||||
</Step>
|
||||
|
||||
|
||||
<Step title="Discover Required Inputs">
|
||||
Use the `GET /inputs` endpoint to see what parameters your crew expects.
|
||||
</Step>
|
||||
|
||||
|
||||
<Step title="Start a Crew Execution">
|
||||
Call `POST /kickoff` with your inputs to start the crew execution and receive a `kickoff_id`.
|
||||
</Step>
|
||||
|
||||
|
||||
<Step title="Monitor Progress">
|
||||
Use `GET /status/{kickoff_id}` to check execution status and retrieve results.
|
||||
</Step>
|
||||
@@ -45,7 +46,7 @@ curl -H "Authorization: Bearer YOUR_CREW_TOKEN" \
|
||||
| **User Bearer Token** | User-scoped access | Limited permissions, suitable for user-specific operations |
|
||||
|
||||
<Tip>
|
||||
You can find both token types in the Status tab of your crew's detail page in the CrewAI Enterprise dashboard.
|
||||
You can find both token types in the Status tab of your crew's detail page in the CrewAI AMP dashboard.
|
||||
</Tip>
|
||||
|
||||
## Base URL
|
||||
@@ -61,7 +62,7 @@ Replace `your-crew-name` with your actual crew's URL from the dashboard.
|
||||
## Typical Workflow
|
||||
|
||||
1. **Discovery**: Call `GET /inputs` to understand what your crew needs
|
||||
2. **Execution**: Submit inputs via `POST /kickoff` to start processing
|
||||
2. **Execution**: Submit inputs via `POST /kickoff` to start processing
|
||||
3. **Monitoring**: Poll `GET /status/{kickoff_id}` until completion
|
||||
4. **Results**: Extract the final output from the completed response
|
||||
|
||||
@@ -81,12 +82,12 @@ The API uses standard HTTP status codes:
|
||||
## Interactive Testing
|
||||
|
||||
<Info>
|
||||
**Why no "Send" button?** Since each CrewAI Enterprise user has their own unique crew URL, we use **reference mode** instead of an interactive playground to avoid confusion. This shows you exactly what the requests should look like without non-functional send buttons.
|
||||
**Why no "Send" button?** Since each CrewAI AMP user has their own unique crew URL, we use **reference mode** instead of an interactive playground to avoid confusion. This shows you exactly what the requests should look like without non-functional send buttons.
|
||||
</Info>
|
||||
|
||||
Each endpoint page shows you:
|
||||
- ✅ **Exact request format** with all parameters
|
||||
- ✅ **Response examples** for success and error cases
|
||||
- ✅ **Response examples** for success and error cases
|
||||
- ✅ **Code samples** in multiple languages (cURL, Python, JavaScript, etc.)
|
||||
- ✅ **Authentication examples** with proper Bearer token format
|
||||
|
||||
@@ -103,7 +104,7 @@ Each endpoint page shows you:
|
||||
|
||||
**Example workflow:**
|
||||
1. **Copy this cURL example** from any endpoint page
|
||||
2. **Replace `your-actual-crew-name.crewai.com`** with your real crew URL
|
||||
2. **Replace `your-actual-crew-name.crewai.com`** with your real crew URL
|
||||
3. **Replace the Bearer token** with your real token from the dashboard
|
||||
4. **Run the request** in your terminal or API client
|
||||
|
||||
|
||||
8
docs/en/api-reference/kickoff.mdx
Normal file
8
docs/en/api-reference/kickoff.mdx
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
title: "POST /kickoff"
|
||||
description: "Start a crew execution"
|
||||
openapi: "/enterprise-api.en.yaml POST /kickoff"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
|
||||
8
docs/en/api-reference/status.mdx
Normal file
8
docs/en/api-reference/status.mdx
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
title: "GET /status/{kickoff_id}"
|
||||
description: "Get execution status"
|
||||
openapi: "/enterprise-api.en.yaml GET /status/{kickoff_id}"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
|
||||
1917
docs/en/changelog.mdx
Normal file
1917
docs/en/changelog.mdx
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,7 @@
|
||||
title: Agents
|
||||
description: Detailed guide on creating and managing agents within the CrewAI framework.
|
||||
icon: robot
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview of an Agent
|
||||
@@ -19,7 +20,7 @@ Think of an agent as a specialized team member with specific skills, expertise,
|
||||
</Tip>
|
||||
|
||||
<Note type="info" title="Enterprise Enhancement: Visual Agent Builder">
|
||||
CrewAI Enterprise includes a Visual Agent Builder that simplifies agent creation and configuration without writing code. Design your agents visually and test them in real-time.
|
||||
CrewAI AMP includes a Visual Agent Builder that simplifies agent creation and configuration without writing code. Design your agents visually and test them in real-time.
|
||||
|
||||

|
||||
|
||||
@@ -526,6 +527,103 @@ agent = Agent(
|
||||
The context window management feature works automatically in the background. You don't need to call any special functions - just set `respect_context_window` to your preferred behavior and CrewAI handles the rest!
|
||||
</Note>
|
||||
|
||||
## Direct Agent Interaction with `kickoff()`
|
||||
|
||||
Agents can be used directly without going through a task or crew workflow using the `kickoff()` method. This provides a simpler way to interact with an agent when you don't need the full crew orchestration capabilities.
|
||||
|
||||
### How `kickoff()` Works
|
||||
|
||||
The `kickoff()` method allows you to send messages directly to an agent and get a response, similar to how you would interact with an LLM but with all the agent's capabilities (tools, reasoning, etc.).
|
||||
|
||||
```python Code
|
||||
from crewai import Agent
|
||||
from crewai_tools import SerperDevTool
|
||||
|
||||
# Create an agent
|
||||
researcher = Agent(
|
||||
role="AI Technology Researcher",
|
||||
goal="Research the latest AI developments",
|
||||
tools=[SerperDevTool()],
|
||||
verbose=True
|
||||
)
|
||||
|
||||
# Use kickoff() to interact directly with the agent
|
||||
result = researcher.kickoff("What are the latest developments in language models?")
|
||||
|
||||
# Access the raw response
|
||||
print(result.raw)
|
||||
```
|
||||
|
||||
### Parameters and Return Values
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| :---------------- | :---------------------------------- | :------------------------------------------------------------------------ |
|
||||
| `messages` | `Union[str, List[Dict[str, str]]]` | Either a string query or a list of message dictionaries with role/content |
|
||||
| `response_format` | `Optional[Type[Any]]` | Optional Pydantic model for structured output |
|
||||
|
||||
The method returns a `LiteAgentOutput` object with the following properties:
|
||||
|
||||
- `raw`: String containing the raw output text
|
||||
- `pydantic`: Parsed Pydantic model (if a `response_format` was provided)
|
||||
- `agent_role`: Role of the agent that produced the output
|
||||
- `usage_metrics`: Token usage metrics for the execution
|
||||
|
||||
### Structured Output
|
||||
|
||||
You can get structured output by providing a Pydantic model as the `response_format`:
|
||||
|
||||
```python Code
|
||||
from pydantic import BaseModel
|
||||
from typing import List
|
||||
|
||||
class ResearchFindings(BaseModel):
|
||||
main_points: List[str]
|
||||
key_technologies: List[str]
|
||||
future_predictions: str
|
||||
|
||||
# Get structured output
|
||||
result = researcher.kickoff(
|
||||
"Summarize the latest developments in AI for 2025",
|
||||
response_format=ResearchFindings
|
||||
)
|
||||
|
||||
# Access structured data
|
||||
print(result.pydantic.main_points)
|
||||
print(result.pydantic.future_predictions)
|
||||
```
|
||||
|
||||
### Multiple Messages
|
||||
|
||||
You can also provide a conversation history as a list of message dictionaries:
|
||||
|
||||
```python Code
|
||||
messages = [
|
||||
{"role": "user", "content": "I need information about large language models"},
|
||||
{"role": "assistant", "content": "I'd be happy to help with that! What specifically would you like to know?"},
|
||||
{"role": "user", "content": "What are the latest developments in 2025?"}
|
||||
]
|
||||
|
||||
result = researcher.kickoff(messages)
|
||||
```
|
||||
|
||||
### Async Support
|
||||
|
||||
An asynchronous version is available via `kickoff_async()` with the same parameters:
|
||||
|
||||
```python Code
|
||||
import asyncio
|
||||
|
||||
async def main():
|
||||
result = await researcher.kickoff_async("What are the latest developments in AI?")
|
||||
print(result.raw)
|
||||
|
||||
asyncio.run(main())
|
||||
```
|
||||
|
||||
<Note>
|
||||
The `kickoff()` method uses a `LiteAgent` internally, which provides a simpler execution flow while preserving all of the agent's configuration (role, goal, backstory, tools, etc.).
|
||||
</Note>
|
||||
|
||||
## Important Considerations and Best Practices
|
||||
|
||||
### Security and Code Execution
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
title: CLI
|
||||
description: Learn how to use the CrewAI CLI to interact with CrewAI.
|
||||
icon: terminal
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
<Warning>Since release 0.140.0, CrewAI AMP started a process of migrating their login provider. As such, the authentication flow via CLI was updated. Users that use Google to login, or that created their account after July 3rd, 2025 will be unable to log in with older versions of the `crewai` library.</Warning>
|
||||
|
||||
## Overview
|
||||
|
||||
The CrewAI CLI provides a set of commands to interact with CrewAI, allowing you to create, train, run, and manage crews & flows.
|
||||
@@ -86,7 +89,7 @@ crewai replay [OPTIONS]
|
||||
- `-t, --task_id TEXT`: Replay the crew from this task ID, including all subsequent tasks
|
||||
|
||||
Example:
|
||||
```shell Terminal
|
||||
```shell Terminal
|
||||
crewai replay -t task_123456
|
||||
```
|
||||
|
||||
@@ -132,7 +135,7 @@ crewai test [OPTIONS]
|
||||
- `-m, --model TEXT`: LLM Model to run the tests on the Crew (default: "gpt-4o-mini")
|
||||
|
||||
Example:
|
||||
```shell Terminal
|
||||
```shell Terminal
|
||||
crewai test -n 5 -m gpt-3.5-turbo
|
||||
```
|
||||
|
||||
@@ -149,7 +152,7 @@ Starting from version 0.103.0, the `crewai run` command can be used to run both
|
||||
</Note>
|
||||
|
||||
<Note>
|
||||
Make sure to run these commands from the directory where your CrewAI project is set up.
|
||||
Make sure to run these commands from the directory where your CrewAI project is set up.
|
||||
Some commands may require additional configuration or setup within your project structure.
|
||||
</Note>
|
||||
|
||||
@@ -183,13 +186,10 @@ def crew(self) -> Crew:
|
||||
|
||||
### 10. Deploy
|
||||
|
||||
Deploy the crew or flow to [CrewAI Enterprise](https://app.crewai.com).
|
||||
Deploy the crew or flow to [CrewAI AMP](https://app.crewai.com).
|
||||
|
||||
- **Authentication**: You need to be authenticated to deploy to CrewAI Enterprise.
|
||||
```shell Terminal
|
||||
crewai signup
|
||||
```
|
||||
If you already have an account, you can login with:
|
||||
- **Authentication**: You need to be authenticated to deploy to CrewAI AMP.
|
||||
You can login or create an account with:
|
||||
```shell Terminal
|
||||
crewai login
|
||||
```
|
||||
@@ -203,7 +203,7 @@ Deploy the crew or flow to [CrewAI Enterprise](https://app.crewai.com).
|
||||
|
||||
### 11. Organization Management
|
||||
|
||||
Manage your CrewAI Enterprise organizations.
|
||||
Manage your CrewAI AMP organizations.
|
||||
|
||||
```shell Terminal
|
||||
crewai org [COMMAND] [OPTIONS]
|
||||
@@ -227,17 +227,17 @@ crewai org switch <organization_id>
|
||||
```
|
||||
|
||||
<Note>
|
||||
You must be authenticated to CrewAI Enterprise to use these organization management commands.
|
||||
You must be authenticated to CrewAI AMP to use these organization management commands.
|
||||
</Note>
|
||||
|
||||
- **Create a deployment** (continued):
|
||||
- Links the deployment to the corresponding remote GitHub repository (it usually detects this automatically).
|
||||
|
||||
- **Deploy the Crew**: Once you are authenticated, you can deploy your crew or flow to CrewAI Enterprise.
|
||||
- **Deploy the Crew**: Once you are authenticated, you can deploy your crew or flow to CrewAI AMP.
|
||||
```shell Terminal
|
||||
crewai deploy push
|
||||
```
|
||||
- Initiates the deployment process on the CrewAI Enterprise platform.
|
||||
```
|
||||
- Initiates the deployment process on the CrewAI AMP platform.
|
||||
- Upon successful initiation, it will output the Deployment created successfully! message along with the Deployment Name and a unique Deployment ID (UUID).
|
||||
|
||||
- **Deployment Status**: You can check the status of your deployment with:
|
||||
@@ -262,7 +262,7 @@ You must be authenticated to CrewAI Enterprise to use these organization managem
|
||||
```shell Terminal
|
||||
crewai deploy remove
|
||||
```
|
||||
This deletes the deployment from the CrewAI Enterprise platform.
|
||||
This deletes the deployment from the CrewAI AMP platform.
|
||||
|
||||
- **Help Command**: You can get help with the CLI with:
|
||||
```shell Terminal
|
||||
@@ -270,20 +270,36 @@ You must be authenticated to CrewAI Enterprise to use these organization managem
|
||||
```
|
||||
This shows the help message for the CrewAI Deploy CLI.
|
||||
|
||||
Watch this video tutorial for a step-by-step demonstration of deploying your crew to [CrewAI Enterprise](http://app.crewai.com) using the CLI.
|
||||
Watch this video tutorial for a step-by-step demonstration of deploying your crew to [CrewAI AMP](http://app.crewai.com) using the CLI.
|
||||
|
||||
<iframe
|
||||
width="100%"
|
||||
height="400"
|
||||
className="w-full aspect-video rounded-xl"
|
||||
src="https://www.youtube.com/embed/3EqSV-CYDZA"
|
||||
title="CrewAI Deployment Guide"
|
||||
frameborder="0"
|
||||
style={{ borderRadius: '10px' }}
|
||||
frameBorder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowfullscreen
|
||||
allowFullScreen
|
||||
></iframe>
|
||||
|
||||
### 11. API Keys
|
||||
### 11. Login
|
||||
|
||||
Authenticate with CrewAI AMP using a secure device code flow (no email entry required).
|
||||
|
||||
```shell Terminal
|
||||
crewai login
|
||||
```
|
||||
|
||||
What happens:
|
||||
- A verification URL and short code are displayed in your terminal
|
||||
- Your browser opens to the verification URL
|
||||
- Enter/confirm the code to complete authentication
|
||||
|
||||
Notes:
|
||||
- The OAuth2 provider and domain are configured via `crewai config` (defaults use `login.crewai.com`)
|
||||
- After successful login, the CLI also attempts to authenticate to the Tool Repository automatically
|
||||
- If you reset your configuration, run `crewai login` again to re-authenticate
|
||||
|
||||
### 12. API Keys
|
||||
|
||||
When running ```crewai create crew``` command, the CLI will show you a list of available LLM providers to choose from, followed by model selection for your chosen provider.
|
||||
|
||||
@@ -310,3 +326,86 @@ When you select a provider, the CLI will prompt you to enter the Key name and th
|
||||
See the following link for each provider's key name:
|
||||
|
||||
* [LiteLLM Providers](https://docs.litellm.ai/docs/providers)
|
||||
|
||||
### 13. Configuration Management
|
||||
|
||||
Manage CLI configuration settings for CrewAI.
|
||||
|
||||
```shell Terminal
|
||||
crewai config [COMMAND] [OPTIONS]
|
||||
```
|
||||
|
||||
#### Commands:
|
||||
|
||||
- `list`: Display all CLI configuration parameters
|
||||
```shell Terminal
|
||||
crewai config list
|
||||
```
|
||||
|
||||
- `set`: Set a CLI configuration parameter
|
||||
```shell Terminal
|
||||
crewai config set <key> <value>
|
||||
```
|
||||
|
||||
- `reset`: Reset all CLI configuration parameters to default values
|
||||
```shell Terminal
|
||||
crewai config reset
|
||||
```
|
||||
|
||||
#### Available Configuration Parameters
|
||||
|
||||
- `enterprise_base_url`: Base URL of the CrewAI AMP instance
|
||||
- `oauth2_provider`: OAuth2 provider used for authentication (e.g., workos, okta, auth0)
|
||||
- `oauth2_audience`: OAuth2 audience value, typically used to identify the target API or resource
|
||||
- `oauth2_client_id`: OAuth2 client ID issued by the provider, used during authentication requests
|
||||
- `oauth2_domain`: OAuth2 provider's domain (e.g., your-org.auth0.com) used for issuing tokens
|
||||
|
||||
#### Examples
|
||||
|
||||
Display current configuration:
|
||||
```shell Terminal
|
||||
crewai config list
|
||||
```
|
||||
|
||||
Example output:
|
||||
| Setting | Value | Description |
|
||||
| :------------------ | :----------------------- | :---------------------------------------------------------- |
|
||||
| enterprise_base_url | https://app.crewai.com | Base URL of the CrewAI AMP instance |
|
||||
| org_name | Not set | Name of the currently active organization |
|
||||
| org_uuid | Not set | UUID of the currently active organization |
|
||||
| oauth2_provider | workos | OAuth2 provider (e.g., workos, okta, auth0) |
|
||||
| oauth2_audience | client_01YYY | Audience identifying the target API/resource |
|
||||
| oauth2_client_id | client_01XXX | OAuth2 client ID issued by the provider |
|
||||
| oauth2_domain | login.crewai.com | Provider domain (e.g., your-org.auth0.com) |
|
||||
|
||||
Set the enterprise base URL:
|
||||
```shell Terminal
|
||||
crewai config set enterprise_base_url https://my-enterprise.crewai.com
|
||||
```
|
||||
|
||||
Set OAuth2 provider:
|
||||
```shell Terminal
|
||||
crewai config set oauth2_provider auth0
|
||||
```
|
||||
|
||||
Set OAuth2 domain:
|
||||
```shell Terminal
|
||||
crewai config set oauth2_domain my-company.auth0.com
|
||||
```
|
||||
|
||||
Reset all configuration to defaults:
|
||||
```shell Terminal
|
||||
crewai config reset
|
||||
```
|
||||
|
||||
<Tip>
|
||||
After resetting configuration, re-run `crewai login` to authenticate again.
|
||||
</Tip>
|
||||
|
||||
<Tip>
|
||||
CrewAI CLI handles authentication to the Tool Repository automatically when adding packages to your project. Just append `crewai` before any `uv` command to use it. E.g. `crewai uv add requests`. For more information, see [Tool Repository](https://docs.crewai.com/enterprise/features/tool-repository) docs.
|
||||
</Tip>
|
||||
|
||||
<Note>
|
||||
Configuration settings are stored in `~/.config/crewai/settings.json`. Some settings like organization name and UUID are read-only and managed through authentication and organization commands. Tool repository related settings are hidden and cannot be set directly by users.
|
||||
</Note>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Collaboration
|
||||
description: How to enable agents to work together, delegate tasks, and communicate effectively within CrewAI teams.
|
||||
icon: screen-users
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Crews
|
||||
description: Understanding and utilizing crews in the crewAI framework with comprehensive attributes and functionalities.
|
||||
icon: people-group
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -20,8 +21,7 @@ A crew in crewAI represents a collaborative group of agents working together to
|
||||
| **Function Calling LLM** _(optional)_ | `function_calling_llm` | If passed, the crew will use this LLM to do function calling for tools for all agents in the crew. Each agent can have its own LLM, which overrides the crew's LLM for function calling. |
|
||||
| **Config** _(optional)_ | `config` | Optional configuration settings for the crew, in `Json` or `Dict[str, Any]` format. |
|
||||
| **Max RPM** _(optional)_ | `max_rpm` | Maximum requests per minute the crew adheres to during execution. Defaults to `None`. |
|
||||
| **Memory** _(optional)_ | `memory` | Utilized for storing execution memories (short-term, long-term, entity memory). |
|
||||
| **Memory Config** _(optional)_ | `memory_config` | Configuration for the memory provider to be used by the crew. |
|
||||
| **Memory** _(optional)_ | `memory` | Utilized for storing execution memories (short-term, long-term, entity memory). | |
|
||||
| **Cache** _(optional)_ | `cache` | Specifies whether to use a cache for storing the results of tools' execution. Defaults to `True`. |
|
||||
| **Embedder** _(optional)_ | `embedder` | Configuration for the embedder to be used by the crew. Mostly used by memory for now. Default is `{"provider": "openai"}`. |
|
||||
| **Step Callback** _(optional)_ | `step_callback` | A function that is called after each step of every agent. This can be used to log the agent's actions or to perform other operations; it won't override the agent-specific `step_callback`. |
|
||||
@@ -32,6 +32,7 @@ A crew in crewAI represents a collaborative group of agents working together to
|
||||
| **Prompt File** _(optional)_ | `prompt_file` | Path to the prompt JSON file to be used for the crew. |
|
||||
| **Planning** *(optional)* | `planning` | Adds planning ability to the Crew. When activated before each Crew iteration, all Crew data is sent to an AgentPlanner that will plan the tasks and this plan will be added to each task description. |
|
||||
| **Planning LLM** *(optional)* | `planning_llm` | The language model used by the AgentPlanner in a planning process. |
|
||||
| **Knowledge Sources** _(optional)_ | `knowledge_sources` | Knowledge sources available at the crew level, accessible to all the agents. |
|
||||
|
||||
<Tip>
|
||||
**Crew Max RPM**: The `max_rpm` attribute sets the maximum number of requests per minute the crew can perform to avoid rate limits and will override individual agents' `max_rpm` settings if you set it.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: 'Event Listeners'
|
||||
description: 'Tap into CrewAI events to build custom integrations and monitoring'
|
||||
icon: spinner
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -19,7 +20,7 @@ CrewAI uses an event bus architecture to emit events throughout the execution li
|
||||
When specific actions occur in CrewAI (like a Crew starting execution, an Agent completing a task, or a tool being used), the system emits corresponding events. You can register handlers for these events to execute custom code when they occur.
|
||||
|
||||
<Note type="info" title="Enterprise Enhancement: Prompt Tracing">
|
||||
CrewAI Enterprise provides a built-in Prompt Tracing feature that leverages the event system to track, store, and visualize all prompts, completions, and associated metadata. This provides powerful debugging capabilities and transparency into your agent operations.
|
||||
CrewAI AMP provides a built-in Prompt Tracing feature that leverages the event system to track, store, and visualize all prompts, completions, and associated metadata. This provides powerful debugging capabilities and transparency into your agent operations.
|
||||
|
||||

|
||||
|
||||
@@ -44,12 +45,12 @@ To create a custom event listener, you need to:
|
||||
Here's a simple example of a custom event listener class:
|
||||
|
||||
```python
|
||||
from crewai.utilities.events import (
|
||||
from crewai.events import (
|
||||
CrewKickoffStartedEvent,
|
||||
CrewKickoffCompletedEvent,
|
||||
AgentExecutionCompletedEvent,
|
||||
)
|
||||
from crewai.utilities.events.base_event_listener import BaseEventListener
|
||||
from crewai.events import BaseEventListener
|
||||
|
||||
class MyCustomListener(BaseEventListener):
|
||||
def __init__(self):
|
||||
@@ -146,7 +147,7 @@ my_project/
|
||||
|
||||
```python
|
||||
# my_custom_listener.py
|
||||
from crewai.utilities.events.base_event_listener import BaseEventListener
|
||||
from crewai.events import BaseEventListener
|
||||
# ... import events ...
|
||||
|
||||
class MyCustomListener(BaseEventListener):
|
||||
@@ -177,14 +178,7 @@ class MyCustomCrew:
|
||||
# Your crew implementation...
|
||||
```
|
||||
|
||||
This is exactly how CrewAI's built-in `agentops_listener` is registered. In the CrewAI codebase, you'll find:
|
||||
|
||||
```python
|
||||
# src/crewai/utilities/events/third_party/__init__.py
|
||||
from .agentops_listener import agentops_listener
|
||||
```
|
||||
|
||||
This ensures the `agentops_listener` is loaded when the `crewai.utilities.events` package is imported.
|
||||
This is how third-party event listeners are registered in the CrewAI codebase.
|
||||
|
||||
## Available Event Types
|
||||
|
||||
@@ -255,6 +249,17 @@ CrewAI provides a wide range of events that you can listen for:
|
||||
- **LLMCallFailedEvent**: Emitted when an LLM call fails
|
||||
- **LLMStreamChunkEvent**: Emitted for each chunk received during streaming LLM responses
|
||||
|
||||
### Memory Events
|
||||
|
||||
- **MemoryQueryStartedEvent**: Emitted when a memory query is started. Contains the query, limit, and optional score threshold.
|
||||
- **MemoryQueryCompletedEvent**: Emitted when a memory query is completed successfully. Contains the query, results, limit, score threshold, and query execution time.
|
||||
- **MemoryQueryFailedEvent**: Emitted when a memory query fails. Contains the query, limit, score threshold, and error message.
|
||||
- **MemorySaveStartedEvent**: Emitted when a memory save operation is started. Contains the value to be saved, metadata, and optional agent role.
|
||||
- **MemorySaveCompletedEvent**: Emitted when a memory save operation is completed successfully. Contains the saved value, metadata, agent role, and save execution time.
|
||||
- **MemorySaveFailedEvent**: Emitted when a memory save operation fails. Contains the value, metadata, agent role, and error message.
|
||||
- **MemoryRetrievalStartedEvent**: Emitted when memory retrieval for a task prompt starts. Contains the optional task ID.
|
||||
- **MemoryRetrievalCompletedEvent**: Emitted when memory retrieval for a task prompt completes successfully. Contains the task ID, memory content, and retrieval execution time.
|
||||
|
||||
## Event Handler Structure
|
||||
|
||||
Each event handler receives two parameters:
|
||||
@@ -269,84 +274,13 @@ The structure of the event object depends on the event type, but all events inhe
|
||||
|
||||
Additional fields vary by event type. For example, `CrewKickoffCompletedEvent` includes `crew_name` and `output` fields.
|
||||
|
||||
## Real-World Example: Integration with AgentOps
|
||||
|
||||
CrewAI includes an example of a third-party integration with [AgentOps](https://github.com/AgentOps-AI/agentops), a monitoring and observability platform for AI agents. Here's how it's implemented:
|
||||
|
||||
```python
|
||||
from typing import Optional
|
||||
|
||||
from crewai.utilities.events import (
|
||||
CrewKickoffCompletedEvent,
|
||||
ToolUsageErrorEvent,
|
||||
ToolUsageStartedEvent,
|
||||
)
|
||||
from crewai.utilities.events.base_event_listener import BaseEventListener
|
||||
from crewai.utilities.events.crew_events import CrewKickoffStartedEvent
|
||||
from crewai.utilities.events.task_events import TaskEvaluationEvent
|
||||
|
||||
try:
|
||||
import agentops
|
||||
AGENTOPS_INSTALLED = True
|
||||
except ImportError:
|
||||
AGENTOPS_INSTALLED = False
|
||||
|
||||
class AgentOpsListener(BaseEventListener):
|
||||
tool_event: Optional["agentops.ToolEvent"] = None
|
||||
session: Optional["agentops.Session"] = None
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
def setup_listeners(self, crewai_event_bus):
|
||||
if not AGENTOPS_INSTALLED:
|
||||
return
|
||||
|
||||
@crewai_event_bus.on(CrewKickoffStartedEvent)
|
||||
def on_crew_kickoff_started(source, event: CrewKickoffStartedEvent):
|
||||
self.session = agentops.init()
|
||||
for agent in source.agents:
|
||||
if self.session:
|
||||
self.session.create_agent(
|
||||
name=agent.role,
|
||||
agent_id=str(agent.id),
|
||||
)
|
||||
|
||||
@crewai_event_bus.on(CrewKickoffCompletedEvent)
|
||||
def on_crew_kickoff_completed(source, event: CrewKickoffCompletedEvent):
|
||||
if self.session:
|
||||
self.session.end_session(
|
||||
end_state="Success",
|
||||
end_state_reason="Finished Execution",
|
||||
)
|
||||
|
||||
@crewai_event_bus.on(ToolUsageStartedEvent)
|
||||
def on_tool_usage_started(source, event: ToolUsageStartedEvent):
|
||||
self.tool_event = agentops.ToolEvent(name=event.tool_name)
|
||||
if self.session:
|
||||
self.session.record(self.tool_event)
|
||||
|
||||
@crewai_event_bus.on(ToolUsageErrorEvent)
|
||||
def on_tool_usage_error(source, event: ToolUsageErrorEvent):
|
||||
agentops.ErrorEvent(exception=event.error, trigger_event=self.tool_event)
|
||||
```
|
||||
|
||||
This listener initializes an AgentOps session when a Crew starts, registers agents with AgentOps, tracks tool usage, and ends the session when the Crew completes.
|
||||
|
||||
The AgentOps listener is registered in CrewAI's event system through the import in `src/crewai/utilities/events/third_party/__init__.py`:
|
||||
|
||||
```python
|
||||
from .agentops_listener import agentops_listener
|
||||
```
|
||||
|
||||
This ensures the `agentops_listener` is loaded when the `crewai.utilities.events` package is imported.
|
||||
|
||||
## Advanced Usage: Scoped Handlers
|
||||
|
||||
For temporary event handling (useful for testing or specific operations), you can use the `scoped_handlers` context manager:
|
||||
|
||||
```python
|
||||
from crewai.utilities.events import crewai_event_bus, CrewKickoffStartedEvent
|
||||
from crewai.events import crewai_event_bus, CrewKickoffStartedEvent
|
||||
|
||||
with crewai_event_bus.scoped_handlers():
|
||||
@crewai_event_bus.on(CrewKickoffStartedEvent)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Flows
|
||||
description: Learn how to create and manage AI workflows using CrewAI Flows.
|
||||
icon: arrow-progress
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -97,7 +98,13 @@ The state's unique ID and stored data can be useful for tracking flow executions
|
||||
|
||||
### @start()
|
||||
|
||||
The `@start()` decorator is used to mark a method as the starting point of a Flow. When a Flow is started, all the methods decorated with `@start()` are executed in parallel. You can have multiple start methods in a Flow, and they will all be executed when the Flow is started.
|
||||
The `@start()` decorator marks entry points for a Flow. You can:
|
||||
|
||||
- Declare multiple unconditional starts: `@start()`
|
||||
- Gate a start on a prior method or router label: `@start("method_or_label")`
|
||||
- Provide a callable condition to control when a start should fire
|
||||
|
||||
All satisfied `@start()` methods will execute (often in parallel) when the Flow begins or resumes.
|
||||
|
||||
### @listen()
|
||||
|
||||
@@ -868,14 +875,13 @@ By exploring these examples, you can gain insights into how to leverage CrewAI F
|
||||
Also, check out our YouTube video on how to use flows in CrewAI below!
|
||||
|
||||
<iframe
|
||||
width="560"
|
||||
height="315"
|
||||
className="w-full aspect-video rounded-xl"
|
||||
src="https://www.youtube.com/embed/MTb5my6VOT8"
|
||||
title="YouTube video player"
|
||||
frameborder="0"
|
||||
title="CrewAI Flows overview"
|
||||
frameBorder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
referrerpolicy="strict-origin-when-cross-origin"
|
||||
allowfullscreen
|
||||
referrerPolicy="strict-origin-when-cross-origin"
|
||||
allowFullScreen
|
||||
></iframe>
|
||||
|
||||
## Running Flows
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Knowledge
|
||||
description: What is knowledge in CrewAI and how to use it.
|
||||
icon: book
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -24,6 +25,41 @@ For file-based Knowledge Sources, make sure to place your files in a `knowledge`
|
||||
Also, use relative paths from the `knowledge` directory when creating the source.
|
||||
</Tip>
|
||||
|
||||
### Vector store (RAG) client configuration
|
||||
|
||||
CrewAI exposes a provider-neutral RAG client abstraction for vector stores. The default provider is ChromaDB, and Qdrant is supported as well. You can switch providers using configuration utilities.
|
||||
|
||||
Supported today:
|
||||
- ChromaDB (default)
|
||||
- Qdrant
|
||||
|
||||
```python Code
|
||||
from crewai.rag.config.utils import set_rag_config, get_rag_client, clear_rag_config
|
||||
|
||||
# ChromaDB (default)
|
||||
from crewai.rag.chromadb.config import ChromaDBConfig
|
||||
set_rag_config(ChromaDBConfig())
|
||||
chromadb_client = get_rag_client()
|
||||
|
||||
# Qdrant
|
||||
from crewai.rag.qdrant.config import QdrantConfig
|
||||
set_rag_config(QdrantConfig())
|
||||
qdrant_client = get_rag_client()
|
||||
|
||||
# Example operations (same API for any provider)
|
||||
client = qdrant_client # or chromadb_client
|
||||
client.create_collection(collection_name="docs")
|
||||
client.add_documents(
|
||||
collection_name="docs",
|
||||
documents=[{"id": "1", "content": "CrewAI enables collaborative AI agents."}],
|
||||
)
|
||||
results = client.search(collection_name="docs", query="collaborative agents", limit=3)
|
||||
|
||||
clear_rag_config() # optional reset
|
||||
```
|
||||
|
||||
This RAG client is separate from Knowledge’s built-in storage. Use it when you need direct vector-store control or custom retrieval pipelines.
|
||||
|
||||
### Basic String Knowledge Example
|
||||
|
||||
```python Code
|
||||
@@ -681,11 +717,11 @@ CrewAI emits events during the knowledge retrieval process that you can listen f
|
||||
#### Example: Monitoring Knowledge Retrieval
|
||||
|
||||
```python
|
||||
from crewai.utilities.events import (
|
||||
from crewai.events import (
|
||||
KnowledgeRetrievalStartedEvent,
|
||||
KnowledgeRetrievalCompletedEvent,
|
||||
BaseEventListener,
|
||||
)
|
||||
from crewai.utilities.events.base_event_listener import BaseEventListener
|
||||
|
||||
class KnowledgeMonitorListener(BaseEventListener):
|
||||
def setup_listeners(self, crewai_event_bus):
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: 'LLMs'
|
||||
description: 'A comprehensive guide to configuring and using Large Language Models (LLMs) in your CrewAI projects'
|
||||
icon: 'microchip-ai'
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -270,7 +271,7 @@ In this section, you'll find detailed examples that help you select, configure,
|
||||
from crewai import LLM
|
||||
|
||||
llm = LLM(
|
||||
model="gemini/gemini-1.5-pro-latest",
|
||||
model="gemini-1.5-pro-latest", # or vertex_ai/gemini-1.5-pro-latest
|
||||
temperature=0.7,
|
||||
vertex_credentials=vertex_credentials_json
|
||||
)
|
||||
@@ -733,10 +734,10 @@ CrewAI supports streaming responses from LLMs, allowing your application to rece
|
||||
CrewAI emits events for each chunk received during streaming:
|
||||
|
||||
```python
|
||||
from crewai.utilities.events import (
|
||||
from crewai.events import (
|
||||
LLMStreamChunkEvent
|
||||
)
|
||||
from crewai.utilities.events.base_event_listener import BaseEventListener
|
||||
from crewai.events import BaseEventListener
|
||||
|
||||
class MyCustomListener(BaseEventListener):
|
||||
def setup_listeners(self, crewai_event_bus):
|
||||
@@ -758,8 +759,8 @@ CrewAI supports streaming responses from LLMs, allowing your application to rece
|
||||
|
||||
```python
|
||||
from crewai import LLM, Agent, Task, Crew
|
||||
from crewai.utilities.events import LLMStreamChunkEvent
|
||||
from crewai.utilities.events.base_event_listener import BaseEventListener
|
||||
from crewai.events import LLMStreamChunkEvent
|
||||
from crewai.events import BaseEventListener
|
||||
|
||||
class MyCustomListener(BaseEventListener):
|
||||
def setup_listeners(self, crewai_event_bus):
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
title: Memory
|
||||
description: Leveraging memory systems in the CrewAI framework to enhance agent capabilities.
|
||||
icon: database
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
The CrewAI framework provides a sophisticated memory system designed to significantly enhance AI agent capabilities. CrewAI offers **three distinct memory approaches** that serve different use cases:
|
||||
The CrewAI framework provides a sophisticated memory system designed to significantly enhance AI agent capabilities. CrewAI offers **two distinct memory approaches** that serve different use cases:
|
||||
|
||||
1. **Basic Memory System** - Built-in short-term, long-term, and entity memory
|
||||
2. **User Memory** - User-specific memory with Mem0 integration (legacy approach)
|
||||
3. **External Memory** - Standalone external memory providers (new approach)
|
||||
2. **External Memory** - Standalone external memory providers
|
||||
|
||||
## Memory System Components
|
||||
|
||||
@@ -19,7 +19,7 @@ The CrewAI framework provides a sophisticated memory system designed to signific
|
||||
| **Short-Term Memory**| Temporarily stores recent interactions and outcomes using `RAG`, enabling agents to recall and utilize information relevant to their current context during the current executions.|
|
||||
| **Long-Term Memory** | Preserves valuable insights and learnings from past executions, allowing agents to build and refine their knowledge over time. |
|
||||
| **Entity Memory** | Captures and organizes information about entities (people, places, concepts) encountered during tasks, facilitating deeper understanding and relationship mapping. Uses `RAG` for storing entity information. |
|
||||
| **Contextual Memory**| Maintains the context of interactions by combining `ShortTermMemory`, `LongTermMemory`, and `EntityMemory`, aiding in the coherence and relevance of agent responses over a sequence of tasks or a conversation. |
|
||||
| **Contextual Memory**| Maintains the context of interactions by combining `ShortTermMemory`, `LongTermMemory`, `ExternalMemory` and `EntityMemory`, aiding in the coherence and relevance of agent responses over a sequence of tasks or a conversation. |
|
||||
|
||||
## 1. Basic Memory System (Recommended)
|
||||
|
||||
@@ -62,7 +62,7 @@ By default, CrewAI uses the `appdirs` library to determine storage locations fol
|
||||
```
|
||||
~/Library/Application Support/CrewAI/{project_name}/
|
||||
├── knowledge/ # Knowledge base ChromaDB files
|
||||
├── short_term_memory/ # Short-term memory ChromaDB files
|
||||
├── short_term_memory/ # Short-term memory ChromaDB files
|
||||
├── long_term_memory/ # Long-term memory ChromaDB files
|
||||
├── entities/ # Entity memory ChromaDB files
|
||||
└── long_term_memory_storage.db # SQLite database
|
||||
@@ -202,7 +202,7 @@ crew = Crew(
|
||||
tasks=[task],
|
||||
memory=True,
|
||||
embedder={
|
||||
"provider": "anthropic", # Match your LLM provider
|
||||
"provider": "anthropic", # Match your LLM provider
|
||||
"config": {
|
||||
"api_key": "your-anthropic-key",
|
||||
"model": "text-embedding-3-small"
|
||||
@@ -252,7 +252,7 @@ chroma_path = os.path.join(storage_path, "knowledge")
|
||||
if os.path.exists(chroma_path):
|
||||
client = chromadb.PersistentClient(path=chroma_path)
|
||||
collections = client.list_collections()
|
||||
|
||||
|
||||
print("ChromaDB Collections:")
|
||||
for collection in collections:
|
||||
print(f" - {collection.name}: {collection.count()} documents")
|
||||
@@ -269,7 +269,7 @@ crew = Crew(agents=[...], tasks=[...], memory=True)
|
||||
|
||||
# Reset specific memory types
|
||||
crew.reset_memories(command_type='short') # Short-term memory
|
||||
crew.reset_memories(command_type='long') # Long-term memory
|
||||
crew.reset_memories(command_type='long') # Long-term memory
|
||||
crew.reset_memories(command_type='entity') # Entity memory
|
||||
crew.reset_memories(command_type='knowledge') # Knowledge storage
|
||||
```
|
||||
@@ -540,16 +540,71 @@ crew = Crew(
|
||||
)
|
||||
```
|
||||
|
||||
### Mem0 Provider
|
||||
|
||||
Short-Term Memory and Entity Memory both supports a tight integration with both Mem0 OSS and Mem0 Client as a provider. Here is how you can use Mem0 as a provider.
|
||||
|
||||
```python
|
||||
from crewai.memory.short_term.short_term_memory import ShortTermMemory
|
||||
from crewai.memory.entity_entity_memory import EntityMemory
|
||||
|
||||
mem0_oss_embedder_config = {
|
||||
"provider": "mem0",
|
||||
"config": {
|
||||
"user_id": "john",
|
||||
"local_mem0_config": {
|
||||
"vector_store": {"provider": "qdrant","config": {"host": "localhost", "port": 6333}},
|
||||
"llm": {"provider": "openai","config": {"api_key": "your-api-key", "model": "gpt-4"}},
|
||||
"embedder": {"provider": "openai","config": {"api_key": "your-api-key", "model": "text-embedding-3-small"}}
|
||||
},
|
||||
"infer": True # Optional defaults to True
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
mem0_client_embedder_config = {
|
||||
"provider": "mem0",
|
||||
"config": {
|
||||
"user_id": "john",
|
||||
"org_id": "my_org_id", # Optional
|
||||
"project_id": "my_project_id", # Optional
|
||||
"api_key": "custom-api-key" # Optional - overrides env var
|
||||
"run_id": "my_run_id", # Optional - for short-term memory
|
||||
"includes": "include1", # Optional
|
||||
"excludes": "exclude1", # Optional
|
||||
"infer": True # Optional defaults to True
|
||||
"custom_categories": new_categories # Optional - custom categories for user memory
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
short_term_memory_mem0_oss = ShortTermMemory(embedder_config=mem0_oss_embedder_config) # Short Term Memory with Mem0 OSS
|
||||
short_term_memory_mem0_client = ShortTermMemory(embedder_config=mem0_client_embedder_config) # Short Term Memory with Mem0 Client
|
||||
entity_memory_mem0_oss = EntityMemory(embedder_config=mem0_oss_embedder_config) # Entity Memory with Mem0 OSS
|
||||
entity_memory_mem0_client = EntityMemory(embedder_config=mem0_client_embedder_config) # Short Term Memory with Mem0 Client
|
||||
|
||||
crew = Crew(
|
||||
memory=True,
|
||||
short_term_memory=short_term_memory_mem0_oss, # or short_term_memory_mem0_client
|
||||
entity_memory=entity_memory_mem0_oss # or entity_memory_mem0_client
|
||||
)
|
||||
```
|
||||
|
||||
### Choosing the Right Embedding Provider
|
||||
|
||||
| Provider | Best For | Pros | Cons |
|
||||
|:---------|:----------|:------|:------|
|
||||
| **OpenAI** | General use, reliability | High quality, well-tested | Cost, requires API key |
|
||||
| **Ollama** | Privacy, cost savings | Free, local, private | Requires local setup |
|
||||
| **Google AI** | Google ecosystem | Good performance | Requires Google account |
|
||||
| **Azure OpenAI** | Enterprise, compliance | Enterprise features | Complex setup |
|
||||
| **Cohere** | Multilingual content | Great language support | Specialized use case |
|
||||
| **VoyageAI** | Retrieval tasks | Optimized for search | Newer provider |
|
||||
When selecting an embedding provider, consider factors like performance, privacy, cost, and integration needs.
|
||||
Below is a comparison to help you decide:
|
||||
|
||||
| Provider | Best For | Pros | Cons |
|
||||
| -------------- | ------------------------------ | --------------------------------- | ------------------------- |
|
||||
| **OpenAI** | General use, high reliability | High quality, widely tested | Paid service, API key required |
|
||||
| **Ollama** | Privacy-focused, cost savings | Free, runs locally, fully private | Requires local installation/setup |
|
||||
| **Google AI** | Integration in Google ecosystem| Strong performance, good support | Google account required |
|
||||
| **Azure OpenAI** | Enterprise & compliance needs| Enterprise-grade features, security | More complex setup process |
|
||||
| **Cohere** | Multilingual content handling | Excellent language support | More niche use cases |
|
||||
| **VoyageAI** | Information retrieval & search | Optimized for retrieval tasks | Relatively new provider |
|
||||
| **Mem0** | Per-user personalization | Search-optimized embeddings | Paid service, API key required |
|
||||
|
||||
|
||||
### Environment Variable Configuration
|
||||
|
||||
@@ -596,7 +651,7 @@ providers_to_test = [
|
||||
{
|
||||
"name": "Ollama",
|
||||
"config": {
|
||||
"provider": "ollama",
|
||||
"provider": "ollama",
|
||||
"config": {"model": "mxbai-embed-large"}
|
||||
}
|
||||
}
|
||||
@@ -604,7 +659,7 @@ providers_to_test = [
|
||||
|
||||
for provider in providers_to_test:
|
||||
print(f"\nTesting {provider['name']} embeddings...")
|
||||
|
||||
|
||||
# Create crew with specific embedder
|
||||
crew = Crew(
|
||||
agents=[...],
|
||||
@@ -612,7 +667,7 @@ for provider in providers_to_test:
|
||||
memory=True,
|
||||
embedder=provider['config']
|
||||
)
|
||||
|
||||
|
||||
# Run your test and measure performance
|
||||
result = crew.kickoff()
|
||||
print(f"{provider['name']} completed successfully")
|
||||
@@ -623,7 +678,7 @@ for provider in providers_to_test:
|
||||
**Model not found errors:**
|
||||
```python
|
||||
# Verify model availability
|
||||
from crewai.utilities.embedding_configurator import EmbeddingConfigurator
|
||||
from crewai.rag.embeddings.configurator import EmbeddingConfigurator
|
||||
|
||||
configurator = EmbeddingConfigurator()
|
||||
try:
|
||||
@@ -655,17 +710,17 @@ import time
|
||||
|
||||
def test_embedding_performance(embedder_config, test_text="This is a test document"):
|
||||
start_time = time.time()
|
||||
|
||||
|
||||
crew = Crew(
|
||||
agents=[...],
|
||||
tasks=[...],
|
||||
memory=True,
|
||||
embedder=embedder_config
|
||||
)
|
||||
|
||||
|
||||
# Simulate memory operation
|
||||
crew.kickoff()
|
||||
|
||||
|
||||
end_time = time.time()
|
||||
return end_time - start_time
|
||||
|
||||
@@ -676,7 +731,7 @@ openai_time = test_embedding_performance({
|
||||
})
|
||||
|
||||
ollama_time = test_embedding_performance({
|
||||
"provider": "ollama",
|
||||
"provider": "ollama",
|
||||
"config": {"model": "mxbai-embed-large"}
|
||||
})
|
||||
|
||||
@@ -684,67 +739,29 @@ print(f"OpenAI: {openai_time:.2f}s")
|
||||
print(f"Ollama: {ollama_time:.2f}s")
|
||||
```
|
||||
|
||||
## 2. User Memory with Mem0 (Legacy)
|
||||
### Entity Memory batching behavior
|
||||
|
||||
<Warning>
|
||||
**Legacy Approach**: While fully functional, this approach is considered legacy. For new projects requiring user-specific memory, consider using External Memory instead.
|
||||
</Warning>
|
||||
Entity Memory supports batching when saving multiple entities at once. When you pass a list of `EntityMemoryItem`, the system:
|
||||
|
||||
User Memory integrates with [Mem0](https://mem0.ai/) to provide user-specific memory that persists across sessions and integrates with the crew's contextual memory system.
|
||||
- Emits a single MemorySaveStartedEvent with `entity_count`
|
||||
- Saves each entity internally, collecting any partial errors
|
||||
- Emits MemorySaveCompletedEvent with aggregate metadata (saved count, errors)
|
||||
- Raises a partial-save exception if some entities failed (includes counts)
|
||||
|
||||
### Prerequisites
|
||||
```bash
|
||||
pip install mem0ai
|
||||
```
|
||||
This improves performance and observability when writing many entities in one operation.
|
||||
|
||||
### Mem0 Cloud Configuration
|
||||
## 2. External Memory
|
||||
External Memory provides a standalone memory system that operates independently from the crew's built-in memory. This is ideal for specialized memory providers or cross-application memory sharing.
|
||||
|
||||
### Basic External Memory with Mem0
|
||||
```python
|
||||
import os
|
||||
from crewai import Crew, Process
|
||||
from crewai import Agent, Crew, Process, Task
|
||||
from crewai.memory.external.external_memory import ExternalMemory
|
||||
|
||||
# Set your Mem0 API key
|
||||
os.environ["MEM0_API_KEY"] = "m0-your-api-key"
|
||||
|
||||
crew = Crew(
|
||||
agents=[...],
|
||||
tasks=[...],
|
||||
memory=True, # Required for contextual memory integration
|
||||
memory_config={
|
||||
"provider": "mem0",
|
||||
"config": {"user_id": "john"},
|
||||
"user_memory": {} # Required - triggers user memory initialization
|
||||
},
|
||||
process=Process.sequential,
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
### Advanced Mem0 Configuration
|
||||
```python
|
||||
crew = Crew(
|
||||
agents=[...],
|
||||
tasks=[...],
|
||||
memory=True,
|
||||
memory_config={
|
||||
"provider": "mem0",
|
||||
"config": {
|
||||
"user_id": "john",
|
||||
"org_id": "my_org_id", # Optional
|
||||
"project_id": "my_project_id", # Optional
|
||||
"api_key": "custom-api-key" # Optional - overrides env var
|
||||
},
|
||||
"user_memory": {}
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
### Local Mem0 Configuration
|
||||
```python
|
||||
crew = Crew(
|
||||
agents=[...],
|
||||
tasks=[...],
|
||||
memory=True,
|
||||
memory_config={
|
||||
# Create external memory instance with local Mem0 Configuration
|
||||
external_memory = ExternalMemory(
|
||||
embedder_config={
|
||||
"provider": "mem0",
|
||||
"config": {
|
||||
"user_id": "john",
|
||||
@@ -761,37 +778,60 @@ crew = Crew(
|
||||
"provider": "openai",
|
||||
"config": {"api_key": "your-api-key", "model": "text-embedding-3-small"}
|
||||
}
|
||||
}
|
||||
},
|
||||
"infer": True # Optional defaults to True
|
||||
},
|
||||
"user_memory": {}
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
## 3. External Memory (New Approach)
|
||||
|
||||
External Memory provides a standalone memory system that operates independently from the crew's built-in memory. This is ideal for specialized memory providers or cross-application memory sharing.
|
||||
|
||||
### Basic External Memory with Mem0
|
||||
```python
|
||||
import os
|
||||
from crewai import Agent, Crew, Process, Task
|
||||
from crewai.memory.external.external_memory import ExternalMemory
|
||||
|
||||
os.environ["MEM0_API_KEY"] = "your-api-key"
|
||||
|
||||
# Create external memory instance
|
||||
external_memory = ExternalMemory(
|
||||
embedder_config={
|
||||
"provider": "mem0",
|
||||
"config": {"user_id": "U-123"}
|
||||
}
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[...],
|
||||
tasks=[...],
|
||||
external_memory=external_memory, # Separate from basic memory
|
||||
external_memory=external_memory, # Separate from basic memory
|
||||
process=Process.sequential,
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
### Advanced External Memory with Mem0 Client
|
||||
When using Mem0 Client, you can customize the memory configuration further, by using parameters like 'includes', 'excludes', 'custom_categories', 'infer' and 'run_id' (this is only for short-term memory).
|
||||
You can find more details in the [Mem0 documentation](https://docs.mem0.ai/).
|
||||
|
||||
```python
|
||||
import os
|
||||
from crewai import Agent, Crew, Process, Task
|
||||
from crewai.memory.external.external_memory import ExternalMemory
|
||||
|
||||
new_categories = [
|
||||
{"lifestyle_management_concerns": "Tracks daily routines, habits, hobbies and interests including cooking, time management and work-life balance"},
|
||||
{"seeking_structure": "Documents goals around creating routines, schedules, and organized systems in various life areas"},
|
||||
{"personal_information": "Basic information about the user including name, preferences, and personality traits"}
|
||||
]
|
||||
|
||||
os.environ["MEM0_API_KEY"] = "your-api-key"
|
||||
|
||||
# Create external memory instance with Mem0 Client
|
||||
external_memory = ExternalMemory(
|
||||
embedder_config={
|
||||
"provider": "mem0",
|
||||
"config": {
|
||||
"user_id": "john",
|
||||
"org_id": "my_org_id", # Optional
|
||||
"project_id": "my_project_id", # Optional
|
||||
"api_key": "custom-api-key" # Optional - overrides env var
|
||||
"run_id": "my_run_id", # Optional - for short-term memory
|
||||
"includes": "include1", # Optional
|
||||
"excludes": "exclude1", # Optional
|
||||
"infer": True # Optional defaults to True
|
||||
"custom_categories": new_categories # Optional - custom categories for user memory
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[...],
|
||||
tasks=[...],
|
||||
external_memory=external_memory, # Separate from basic memory
|
||||
process=Process.sequential,
|
||||
verbose=True
|
||||
)
|
||||
@@ -808,8 +848,8 @@ class CustomStorage(Storage):
|
||||
|
||||
def save(self, value, metadata=None, agent=None):
|
||||
self.memories.append({
|
||||
"value": value,
|
||||
"metadata": metadata,
|
||||
"value": value,
|
||||
"metadata": metadata,
|
||||
"agent": agent
|
||||
})
|
||||
|
||||
@@ -830,17 +870,18 @@ crew = Crew(
|
||||
)
|
||||
```
|
||||
|
||||
## Memory System Comparison
|
||||
## 🧠 Memory System Comparison
|
||||
|
||||
| **Category** | **Feature** | **Basic Memory** | **External Memory** |
|
||||
|---------------------|------------------------|-----------------------------|------------------------------|
|
||||
| **Ease of Use** | Setup Complexity | Simple | Moderate |
|
||||
| | Integration | Built-in (contextual) | Standalone |
|
||||
| **Persistence** | Storage | Local files | Custom / Mem0 |
|
||||
| | Cross-session Support | ✅ | ✅ |
|
||||
| **Personalization** | User-specific Memory | ❌ | ✅ |
|
||||
| | Custom Providers | Limited | Any provider |
|
||||
| **Use Case Fit** | Recommended For | Most general use cases | Specialized / custom needs |
|
||||
|
||||
| Feature | Basic Memory | User Memory (Legacy) | External Memory |
|
||||
|---------|-------------|---------------------|----------------|
|
||||
| **Setup Complexity** | Simple | Medium | Medium |
|
||||
| **Integration** | Built-in contextual | Contextual + User-specific | Standalone |
|
||||
| **Storage** | Local files | Mem0 Cloud/Local | Custom/Mem0 |
|
||||
| **Cross-session** | ✅ | ✅ | ✅ |
|
||||
| **User-specific** | ❌ | ✅ | ✅ |
|
||||
| **Custom providers** | Limited | Mem0 only | Any provider |
|
||||
| **Recommended for** | Most use cases | Legacy projects | Specialized needs |
|
||||
|
||||
## Supported Embedding Providers
|
||||
|
||||
@@ -986,7 +1027,201 @@ crew = Crew(
|
||||
- 🫡 **Enhanced Personalization:** Memory enables agents to remember user preferences and historical interactions, leading to personalized experiences.
|
||||
- 🧠 **Improved Problem Solving:** Access to a rich memory store aids agents in making more informed decisions, drawing on past learnings and contextual insights.
|
||||
|
||||
## Memory Events
|
||||
|
||||
CrewAI's event system provides powerful insights into memory operations. By leveraging memory events, you can monitor, debug, and optimize your memory system's performance and behavior.
|
||||
|
||||
### Available Memory Events
|
||||
|
||||
CrewAI emits the following memory-related events:
|
||||
|
||||
| Event | Description | Key Properties |
|
||||
| :---- | :---------- | :------------- |
|
||||
| **MemoryQueryStartedEvent** | Emitted when a memory query begins | `query`, `limit`, `score_threshold` |
|
||||
| **MemoryQueryCompletedEvent** | Emitted when a memory query completes successfully | `query`, `results`, `limit`, `score_threshold`, `query_time_ms` |
|
||||
| **MemoryQueryFailedEvent** | Emitted when a memory query fails | `query`, `limit`, `score_threshold`, `error` |
|
||||
| **MemorySaveStartedEvent** | Emitted when a memory save operation begins | `value`, `metadata`, `agent_role` |
|
||||
| **MemorySaveCompletedEvent** | Emitted when a memory save operation completes successfully | `value`, `metadata`, `agent_role`, `save_time_ms` |
|
||||
| **MemorySaveFailedEvent** | Emitted when a memory save operation fails | `value`, `metadata`, `agent_role`, `error` |
|
||||
| **MemoryRetrievalStartedEvent** | Emitted when memory retrieval for a task prompt starts | `task_id` |
|
||||
| **MemoryRetrievalCompletedEvent** | Emitted when memory retrieval completes successfully | `task_id`, `memory_content`, `retrieval_time_ms` |
|
||||
|
||||
### Practical Applications
|
||||
|
||||
#### 1. Memory Performance Monitoring
|
||||
|
||||
Track memory operation timing to optimize your application:
|
||||
|
||||
```python
|
||||
from crewai.events import (
|
||||
BaseEventListener,
|
||||
MemoryQueryCompletedEvent,
|
||||
MemorySaveCompletedEvent
|
||||
)
|
||||
import time
|
||||
|
||||
class MemoryPerformanceMonitor(BaseEventListener):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.query_times = []
|
||||
self.save_times = []
|
||||
|
||||
def setup_listeners(self, crewai_event_bus):
|
||||
@crewai_event_bus.on(MemoryQueryCompletedEvent)
|
||||
def on_memory_query_completed(source, event: MemoryQueryCompletedEvent):
|
||||
self.query_times.append(event.query_time_ms)
|
||||
print(f"Memory query completed in {event.query_time_ms:.2f}ms. Query: '{event.query}'")
|
||||
print(f"Average query time: {sum(self.query_times)/len(self.query_times):.2f}ms")
|
||||
|
||||
@crewai_event_bus.on(MemorySaveCompletedEvent)
|
||||
def on_memory_save_completed(source, event: MemorySaveCompletedEvent):
|
||||
self.save_times.append(event.save_time_ms)
|
||||
print(f"Memory save completed in {event.save_time_ms:.2f}ms")
|
||||
print(f"Average save time: {sum(self.save_times)/len(self.save_times):.2f}ms")
|
||||
|
||||
# Create an instance of your listener
|
||||
memory_monitor = MemoryPerformanceMonitor()
|
||||
```
|
||||
|
||||
#### 2. Memory Content Logging
|
||||
|
||||
Log memory operations for debugging and insights:
|
||||
|
||||
```python
|
||||
from crewai.events import (
|
||||
BaseEventListener,
|
||||
MemorySaveStartedEvent,
|
||||
MemoryQueryStartedEvent,
|
||||
MemoryRetrievalCompletedEvent
|
||||
)
|
||||
import logging
|
||||
|
||||
# Configure logging
|
||||
logger = logging.getLogger('memory_events')
|
||||
|
||||
class MemoryLogger(BaseEventListener):
|
||||
def setup_listeners(self, crewai_event_bus):
|
||||
@crewai_event_bus.on(MemorySaveStartedEvent)
|
||||
def on_memory_save_started(source, event: MemorySaveStartedEvent):
|
||||
if event.agent_role:
|
||||
logger.info(f"Agent '{event.agent_role}' saving memory: {event.value[:50]}...")
|
||||
else:
|
||||
logger.info(f"Saving memory: {event.value[:50]}...")
|
||||
|
||||
@crewai_event_bus.on(MemoryQueryStartedEvent)
|
||||
def on_memory_query_started(source, event: MemoryQueryStartedEvent):
|
||||
logger.info(f"Memory query started: '{event.query}' (limit: {event.limit})")
|
||||
|
||||
@crewai_event_bus.on(MemoryRetrievalCompletedEvent)
|
||||
def on_memory_retrieval_completed(source, event: MemoryRetrievalCompletedEvent):
|
||||
if event.task_id:
|
||||
logger.info(f"Memory retrieved for task {event.task_id} in {event.retrieval_time_ms:.2f}ms")
|
||||
else:
|
||||
logger.info(f"Memory retrieved in {event.retrieval_time_ms:.2f}ms")
|
||||
logger.debug(f"Memory content: {event.memory_content}")
|
||||
|
||||
# Create an instance of your listener
|
||||
memory_logger = MemoryLogger()
|
||||
```
|
||||
|
||||
#### 3. Error Tracking and Notifications
|
||||
|
||||
Capture and respond to memory errors:
|
||||
|
||||
```python
|
||||
from crewai.events import (
|
||||
BaseEventListener,
|
||||
MemorySaveFailedEvent,
|
||||
MemoryQueryFailedEvent
|
||||
)
|
||||
import logging
|
||||
from typing import Optional
|
||||
|
||||
# Configure logging
|
||||
logger = logging.getLogger('memory_errors')
|
||||
|
||||
class MemoryErrorTracker(BaseEventListener):
|
||||
def __init__(self, notify_email: Optional[str] = None):
|
||||
super().__init__()
|
||||
self.notify_email = notify_email
|
||||
self.error_count = 0
|
||||
|
||||
def setup_listeners(self, crewai_event_bus):
|
||||
@crewai_event_bus.on(MemorySaveFailedEvent)
|
||||
def on_memory_save_failed(source, event: MemorySaveFailedEvent):
|
||||
self.error_count += 1
|
||||
agent_info = f"Agent '{event.agent_role}'" if event.agent_role else "Unknown agent"
|
||||
error_message = f"Memory save failed: {event.error}. {agent_info}"
|
||||
logger.error(error_message)
|
||||
|
||||
if self.notify_email and self.error_count % 5 == 0:
|
||||
self._send_notification(error_message)
|
||||
|
||||
@crewai_event_bus.on(MemoryQueryFailedEvent)
|
||||
def on_memory_query_failed(source, event: MemoryQueryFailedEvent):
|
||||
self.error_count += 1
|
||||
error_message = f"Memory query failed: {event.error}. Query: '{event.query}'"
|
||||
logger.error(error_message)
|
||||
|
||||
if self.notify_email and self.error_count % 5 == 0:
|
||||
self._send_notification(error_message)
|
||||
|
||||
def _send_notification(self, message):
|
||||
# Implement your notification system (email, Slack, etc.)
|
||||
print(f"[NOTIFICATION] Would send to {self.notify_email}: {message}")
|
||||
|
||||
# Create an instance of your listener
|
||||
error_tracker = MemoryErrorTracker(notify_email="admin@example.com")
|
||||
```
|
||||
|
||||
### Integrating with Analytics Platforms
|
||||
|
||||
Memory events can be forwarded to analytics and monitoring platforms to track performance metrics, detect anomalies, and visualize memory usage patterns:
|
||||
|
||||
```python
|
||||
from crewai.events import (
|
||||
BaseEventListener,
|
||||
MemoryQueryCompletedEvent,
|
||||
MemorySaveCompletedEvent
|
||||
)
|
||||
|
||||
class MemoryAnalyticsForwarder(BaseEventListener):
|
||||
def __init__(self, analytics_client):
|
||||
super().__init__()
|
||||
self.client = analytics_client
|
||||
|
||||
def setup_listeners(self, crewai_event_bus):
|
||||
@crewai_event_bus.on(MemoryQueryCompletedEvent)
|
||||
def on_memory_query_completed(source, event: MemoryQueryCompletedEvent):
|
||||
# Forward query metrics to analytics platform
|
||||
self.client.track_metric({
|
||||
"event_type": "memory_query",
|
||||
"query": event.query,
|
||||
"duration_ms": event.query_time_ms,
|
||||
"result_count": len(event.results) if hasattr(event.results, "__len__") else 0,
|
||||
"timestamp": event.timestamp
|
||||
})
|
||||
|
||||
@crewai_event_bus.on(MemorySaveCompletedEvent)
|
||||
def on_memory_save_completed(source, event: MemorySaveCompletedEvent):
|
||||
# Forward save metrics to analytics platform
|
||||
self.client.track_metric({
|
||||
"event_type": "memory_save",
|
||||
"agent_role": event.agent_role,
|
||||
"duration_ms": event.save_time_ms,
|
||||
"timestamp": event.timestamp
|
||||
})
|
||||
```
|
||||
|
||||
### Best Practices for Memory Event Listeners
|
||||
|
||||
1. **Keep handlers lightweight**: Avoid complex processing in event handlers to prevent performance impacts
|
||||
2. **Use appropriate logging levels**: Use INFO for normal operations, DEBUG for details, ERROR for issues
|
||||
3. **Batch metrics when possible**: Accumulate metrics before sending to external systems
|
||||
4. **Handle exceptions gracefully**: Ensure your event handlers don't crash due to unexpected data
|
||||
5. **Consider memory consumption**: Be mindful of storing large amounts of event data
|
||||
|
||||
## Conclusion
|
||||
|
||||
Integrating CrewAI's memory system into your projects is straightforward. By leveraging the provided memory components and configurations,
|
||||
Integrating CrewAI's memory system into your projects is straightforward. By leveraging the provided memory components and configurations,
|
||||
you can quickly empower your agents with the ability to remember, reason, and learn from their interactions, unlocking new levels of intelligence and capability.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Planning
|
||||
description: Learn how to add planning to your CrewAI Crew and improve their performance.
|
||||
icon: ruler-combined
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Processes
|
||||
description: Detailed guide on workflow management through processes in CrewAI, with updated implementation details.
|
||||
icon: bars-staggered
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Reasoning
|
||||
description: "Learn how to enable and use agent reasoning to improve task execution."
|
||||
icon: brain
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Tasks
|
||||
description: Detailed guide on managing and creating tasks within the CrewAI framework.
|
||||
icon: list-check
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -13,7 +14,7 @@ Tasks provide all necessary details for execution, such as a description, the ag
|
||||
Tasks within CrewAI can be collaborative, requiring multiple agents to work together. This is managed through the task properties and orchestrated by the Crew's process, enhancing teamwork and efficiency.
|
||||
|
||||
<Note type="info" title="Enterprise Enhancement: Visual Task Builder">
|
||||
CrewAI Enterprise includes a Visual Task Builder in Crew Studio that simplifies complex task creation and chaining. Design your task flows visually and test them in real-time without writing code.
|
||||
CrewAI AMP includes a Visual Task Builder in Crew Studio that simplifies complex task creation and chaining. Design your task flows visually and test them in real-time without writing code.
|
||||
|
||||

|
||||
|
||||
@@ -54,9 +55,17 @@ crew = Crew(
|
||||
| **Markdown** _(optional)_ | `markdown` | `Optional[bool]` | Whether the task should instruct the agent to return the final answer formatted in Markdown. Defaults to False. |
|
||||
| **Config** _(optional)_ | `config` | `Optional[Dict[str, Any]]` | Task-specific configuration parameters. |
|
||||
| **Output File** _(optional)_ | `output_file` | `Optional[str]` | File path for storing the task output. |
|
||||
| **Create Directory** _(optional)_ | `create_directory` | `Optional[bool]` | Whether to create the directory for output_file if it doesn't exist. Defaults to True. |
|
||||
| **Output JSON** _(optional)_ | `output_json` | `Optional[Type[BaseModel]]` | A Pydantic model to structure the JSON output. |
|
||||
| **Output Pydantic** _(optional)_ | `output_pydantic` | `Optional[Type[BaseModel]]` | A Pydantic model for task output. |
|
||||
| **Callback** _(optional)_ | `callback` | `Optional[Any]` | Function/object to be executed after task completion. |
|
||||
| **Guardrail** _(optional)_ | `guardrail` | `Optional[Callable]` | Function to validate task output before proceeding to next task. |
|
||||
| **Guardrail Max Retries** _(optional)_ | `guardrail_max_retries` | `Optional[int]` | Maximum number of retries when guardrail validation fails. Defaults to 3. |
|
||||
|
||||
<Note type="warning" title="Deprecated: max_retries">
|
||||
The task attribute `max_retries` is deprecated and will be removed in v1.0.0.
|
||||
Use `guardrail_max_retries` instead to control retry attempts when a guardrail fails.
|
||||
</Note>
|
||||
|
||||
## Creating Tasks
|
||||
|
||||
@@ -332,9 +341,11 @@ Task guardrails provide a way to validate and transform task outputs before they
|
||||
are passed to the next task. This feature helps ensure data quality and provides
|
||||
feedback to agents when their output doesn't meet specific criteria.
|
||||
|
||||
### Using Task Guardrails
|
||||
Guardrails are implemented as Python functions that contain custom validation logic, giving you complete control over the validation process and ensuring reliable, deterministic results.
|
||||
|
||||
To add a guardrail to a task, provide a validation function through the `guardrail` parameter:
|
||||
### Function-Based Guardrails
|
||||
|
||||
To add a function-based guardrail to a task, provide a validation function through the `guardrail` parameter:
|
||||
|
||||
```python Code
|
||||
from typing import Tuple, Union, Dict, Any
|
||||
@@ -372,9 +383,7 @@ blog_task = Task(
|
||||
- On success: it returns a tuple of `(bool, Any)`. For example: `(True, validated_result)`
|
||||
- On Failure: it returns a tuple of `(bool, str)`. For example: `(False, "Error message explain the failure")`
|
||||
|
||||
### LLMGuardrail
|
||||
|
||||
The `LLMGuardrail` class offers a robust mechanism for validating task outputs.
|
||||
|
||||
### Error Handling Best Practices
|
||||
|
||||
@@ -429,7 +438,7 @@ When a guardrail returns `(False, error)`:
|
||||
2. The agent attempts to fix the issue
|
||||
3. The process repeats until:
|
||||
- The guardrail returns `(True, result)`
|
||||
- Maximum retries are reached
|
||||
- Maximum retries are reached (`guardrail_max_retries`)
|
||||
|
||||
Example with retry handling:
|
||||
```python Code
|
||||
@@ -450,7 +459,7 @@ task = Task(
|
||||
expected_output="A valid JSON object",
|
||||
agent=analyst,
|
||||
guardrail=validate_json_output,
|
||||
max_retries=3 # Limit retry attempts
|
||||
guardrail_max_retries=3 # Limit retry attempts
|
||||
)
|
||||
```
|
||||
|
||||
@@ -798,197 +807,103 @@ While creating and executing tasks, certain validation mechanisms are in place t
|
||||
|
||||
These validations help in maintaining the consistency and reliability of task executions within the crewAI framework.
|
||||
|
||||
## Task Guardrails
|
||||
|
||||
Task guardrails provide a powerful way to validate, transform, or filter task outputs before they are passed to the next task. Guardrails are optional functions that execute before the next task starts, allowing you to ensure that task outputs meet specific requirements or formats.
|
||||
|
||||
### Basic Usage
|
||||
|
||||
#### Define your own logic to validate
|
||||
|
||||
```python Code
|
||||
from typing import Tuple, Union
|
||||
from crewai import Task
|
||||
|
||||
def validate_json_output(result: str) -> Tuple[bool, Union[dict, str]]:
|
||||
"""Validate that the output is valid JSON."""
|
||||
try:
|
||||
json_data = json.loads(result)
|
||||
return (True, json_data)
|
||||
except json.JSONDecodeError:
|
||||
return (False, "Output must be valid JSON")
|
||||
|
||||
task = Task(
|
||||
description="Generate JSON data",
|
||||
expected_output="Valid JSON object",
|
||||
guardrail=validate_json_output
|
||||
)
|
||||
```
|
||||
|
||||
#### Leverage a no-code approach for validation
|
||||
|
||||
```python Code
|
||||
from crewai import Task
|
||||
|
||||
task = Task(
|
||||
description="Generate JSON data",
|
||||
expected_output="Valid JSON object",
|
||||
guardrail="Ensure the response is a valid JSON object"
|
||||
)
|
||||
```
|
||||
|
||||
#### Using YAML
|
||||
|
||||
```yaml
|
||||
research_task:
|
||||
...
|
||||
guardrail: make sure each bullet contains a minimum of 100 words
|
||||
...
|
||||
```
|
||||
|
||||
```python Code
|
||||
@CrewBase
|
||||
class InternalCrew:
|
||||
agents_config = "config/agents.yaml"
|
||||
tasks_config = "config/tasks.yaml"
|
||||
|
||||
...
|
||||
@task
|
||||
def research_task(self):
|
||||
return Task(config=self.tasks_config["research_task"]) # type: ignore[index]
|
||||
...
|
||||
```
|
||||
|
||||
|
||||
#### Use custom models for code generation
|
||||
|
||||
```python Code
|
||||
from crewai import Task
|
||||
from crewai.llm import LLM
|
||||
|
||||
task = Task(
|
||||
description="Generate JSON data",
|
||||
expected_output="Valid JSON object",
|
||||
guardrail=LLMGuardrail(
|
||||
description="Ensure the response is a valid JSON object",
|
||||
llm=LLM(model="gpt-4o-mini"),
|
||||
)
|
||||
)
|
||||
```
|
||||
|
||||
### How Guardrails Work
|
||||
|
||||
1. **Optional Attribute**: Guardrails are an optional attribute at the task level, allowing you to add validation only where needed.
|
||||
2. **Execution Timing**: The guardrail function is executed before the next task starts, ensuring valid data flow between tasks.
|
||||
3. **Return Format**: Guardrails must return a tuple of `(success, data)`:
|
||||
- If `success` is `True`, `data` is the validated/transformed result
|
||||
- If `success` is `False`, `data` is the error message
|
||||
4. **Result Routing**:
|
||||
- On success (`True`), the result is automatically passed to the next task
|
||||
- On failure (`False`), the error is sent back to the agent to generate a new answer
|
||||
|
||||
### Common Use Cases
|
||||
|
||||
#### Data Format Validation
|
||||
```python Code
|
||||
def validate_email_format(result: str) -> Tuple[bool, Union[str, str]]:
|
||||
"""Ensure the output contains a valid email address."""
|
||||
import re
|
||||
email_pattern = r'^[\w\.-]+@[\w\.-]+\.\w+$'
|
||||
if re.match(email_pattern, result.strip()):
|
||||
return (True, result.strip())
|
||||
return (False, "Output must be a valid email address")
|
||||
```
|
||||
|
||||
#### Content Filtering
|
||||
```python Code
|
||||
def filter_sensitive_info(result: str) -> Tuple[bool, Union[str, str]]:
|
||||
"""Remove or validate sensitive information."""
|
||||
sensitive_patterns = ['SSN:', 'password:', 'secret:']
|
||||
for pattern in sensitive_patterns:
|
||||
if pattern.lower() in result.lower():
|
||||
return (False, f"Output contains sensitive information ({pattern})")
|
||||
return (True, result)
|
||||
```
|
||||
|
||||
#### Data Transformation
|
||||
```python Code
|
||||
def normalize_phone_number(result: str) -> Tuple[bool, Union[str, str]]:
|
||||
"""Ensure phone numbers are in a consistent format."""
|
||||
import re
|
||||
digits = re.sub(r'\D', '', result)
|
||||
if len(digits) == 10:
|
||||
formatted = f"({digits[:3]}) {digits[3:6]}-{digits[6:]}"
|
||||
return (True, formatted)
|
||||
return (False, "Output must be a 10-digit phone number")
|
||||
```
|
||||
|
||||
### Advanced Features
|
||||
|
||||
#### Chaining Multiple Validations
|
||||
```python Code
|
||||
def chain_validations(*validators):
|
||||
"""Chain multiple validators together."""
|
||||
def combined_validator(result):
|
||||
for validator in validators:
|
||||
success, data = validator(result)
|
||||
if not success:
|
||||
return (False, data)
|
||||
result = data
|
||||
return (True, result)
|
||||
return combined_validator
|
||||
|
||||
# Usage
|
||||
task = Task(
|
||||
description="Get user contact info",
|
||||
expected_output="Email and phone",
|
||||
guardrail=chain_validations(
|
||||
validate_email_format,
|
||||
filter_sensitive_info
|
||||
)
|
||||
)
|
||||
```
|
||||
|
||||
#### Custom Retry Logic
|
||||
```python Code
|
||||
task = Task(
|
||||
description="Generate data",
|
||||
expected_output="Valid data",
|
||||
guardrail=validate_data,
|
||||
max_retries=5 # Override default retry limit
|
||||
)
|
||||
```
|
||||
|
||||
## Creating Directories when Saving Files
|
||||
|
||||
You can now specify if a task should create directories when saving its output to a file. This is particularly useful for organizing outputs and ensuring that file paths are correctly structured.
|
||||
The `create_directory` parameter controls whether CrewAI should automatically create directories when saving task outputs to files. This feature is particularly useful for organizing outputs and ensuring that file paths are correctly structured, especially when working with complex project hierarchies.
|
||||
|
||||
### Default Behavior
|
||||
|
||||
By default, `create_directory=True`, which means CrewAI will automatically create any missing directories in the output file path:
|
||||
|
||||
```python Code
|
||||
# ...
|
||||
|
||||
save_output_task = Task(
|
||||
description='Save the summarized AI news to a file',
|
||||
expected_output='File saved successfully',
|
||||
agent=research_agent,
|
||||
tools=[file_save_tool],
|
||||
output_file='outputs/ai_news_summary.txt',
|
||||
create_directory=True
|
||||
# Default behavior - directories are created automatically
|
||||
report_task = Task(
|
||||
description='Generate a comprehensive market analysis report',
|
||||
expected_output='A detailed market analysis with charts and insights',
|
||||
agent=analyst_agent,
|
||||
output_file='reports/2025/market_analysis.md', # Creates 'reports/2025/' if it doesn't exist
|
||||
markdown=True
|
||||
)
|
||||
```
|
||||
|
||||
#...
|
||||
### Disabling Directory Creation
|
||||
|
||||
If you want to prevent automatic directory creation and ensure that the directory already exists, set `create_directory=False`:
|
||||
|
||||
```python Code
|
||||
# Strict mode - directory must already exist
|
||||
strict_output_task = Task(
|
||||
description='Save critical data that requires existing infrastructure',
|
||||
expected_output='Data saved to pre-configured location',
|
||||
agent=data_agent,
|
||||
output_file='secure/vault/critical_data.json',
|
||||
create_directory=False # Will raise RuntimeError if 'secure/vault/' doesn't exist
|
||||
)
|
||||
```
|
||||
|
||||
### YAML Configuration
|
||||
|
||||
You can also configure this behavior in your YAML task definitions:
|
||||
|
||||
```yaml tasks.yaml
|
||||
analysis_task:
|
||||
description: >
|
||||
Generate quarterly financial analysis
|
||||
expected_output: >
|
||||
A comprehensive financial report with quarterly insights
|
||||
agent: financial_analyst
|
||||
output_file: reports/quarterly/q4_2024_analysis.pdf
|
||||
create_directory: true # Automatically create 'reports/quarterly/' directory
|
||||
|
||||
audit_task:
|
||||
description: >
|
||||
Perform compliance audit and save to existing audit directory
|
||||
expected_output: >
|
||||
A compliance audit report
|
||||
agent: auditor
|
||||
output_file: audit/compliance_report.md
|
||||
create_directory: false # Directory must already exist
|
||||
```
|
||||
|
||||
### Use Cases
|
||||
|
||||
**Automatic Directory Creation (`create_directory=True`):**
|
||||
- Development and prototyping environments
|
||||
- Dynamic report generation with date-based folders
|
||||
- Automated workflows where directory structure may vary
|
||||
- Multi-tenant applications with user-specific folders
|
||||
|
||||
**Manual Directory Management (`create_directory=False`):**
|
||||
- Production environments with strict file system controls
|
||||
- Security-sensitive applications where directories must be pre-configured
|
||||
- Systems with specific permission requirements
|
||||
- Compliance environments where directory creation is audited
|
||||
|
||||
### Error Handling
|
||||
|
||||
When `create_directory=False` and the directory doesn't exist, CrewAI will raise a `RuntimeError`:
|
||||
|
||||
```python Code
|
||||
try:
|
||||
result = crew.kickoff()
|
||||
except RuntimeError as e:
|
||||
# Handle missing directory error
|
||||
print(f"Directory creation failed: {e}")
|
||||
# Create directory manually or use fallback location
|
||||
```
|
||||
|
||||
Check out the video below to see how to use structured outputs in CrewAI:
|
||||
|
||||
<iframe
|
||||
width="560"
|
||||
height="315"
|
||||
className="w-full aspect-video rounded-xl"
|
||||
src="https://www.youtube.com/embed/dNpKQk5uxHw"
|
||||
title="YouTube video player"
|
||||
frameborder="0"
|
||||
title="Structured outputs in CrewAI"
|
||||
frameBorder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
referrerpolicy="strict-origin-when-cross-origin"
|
||||
allowfullscreen
|
||||
referrerPolicy="strict-origin-when-cross-origin"
|
||||
allowFullScreen
|
||||
></iframe>
|
||||
|
||||
## Conclusion
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Testing
|
||||
description: Learn how to test your CrewAI Crew and evaluate their performance.
|
||||
icon: vial
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Tools
|
||||
description: Understanding and leveraging tools within the CrewAI framework for agent collaboration and task execution.
|
||||
icon: screwdriver-wrench
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -16,7 +17,7 @@ This includes tools from the [CrewAI Toolkit](https://github.com/joaomdmoura/cre
|
||||
enabling everything from simple searches to complex interactions and effective teamwork among agents.
|
||||
|
||||
<Note type="info" title="Enterprise Enhancement: Tools Repository">
|
||||
CrewAI Enterprise provides a comprehensive Tools Repository with pre-built integrations for common business systems and APIs. Deploy agents with enterprise tools in minutes instead of days.
|
||||
CrewAI AMP provides a comprehensive Tools Repository with pre-built integrations for common business systems and APIs. Deploy agents with enterprise tools in minutes instead of days.
|
||||
|
||||
The Enterprise Tools Repository includes:
|
||||
- Pre-built connectors for popular enterprise systems
|
||||
@@ -207,7 +208,7 @@ from crewai.tools import BaseTool
|
||||
class AsyncCustomTool(BaseTool):
|
||||
name: str = "async_custom_tool"
|
||||
description: str = "An asynchronous custom tool"
|
||||
|
||||
|
||||
async def _run(self, query: str = "") -> str:
|
||||
"""Asynchronously run the tool"""
|
||||
# Your async implementation here
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Training
|
||||
description: Learn how to train your CrewAI agents by giving them feedback early on and get consistent results.
|
||||
icon: dumbbell
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -21,13 +22,17 @@ To use the training feature, follow these steps:
|
||||
3. Run the following command:
|
||||
|
||||
```shell
|
||||
crewai train -n <n_iterations> <filename> (optional)
|
||||
crewai train -n <n_iterations> -f <filename.pkl>
|
||||
```
|
||||
<Tip>
|
||||
Replace `<n_iterations>` with the desired number of training iterations and `<filename>` with the appropriate filename ending with `.pkl`.
|
||||
</Tip>
|
||||
|
||||
### Training Your Crew Programmatically
|
||||
<Note>
|
||||
If you omit `-f`, the output defaults to `trained_agents_data.pkl` in the current working directory. You can pass an absolute path to control where the file is written.
|
||||
</Note>
|
||||
|
||||
### Training your Crew programmatically
|
||||
|
||||
To train your crew programmatically, use the following steps:
|
||||
|
||||
@@ -51,19 +56,65 @@ except Exception as e:
|
||||
raise Exception(f"An error occurred while training the crew: {e}")
|
||||
```
|
||||
|
||||
### Key Points to Note
|
||||
## How trained data is used by agents
|
||||
|
||||
- **Positive Integer Requirement:** Ensure that the number of iterations (`n_iterations`) is a positive integer. The code will raise a `ValueError` if this condition is not met.
|
||||
- **Filename Requirement:** Ensure that the filename ends with `.pkl`. The code will raise a `ValueError` if this condition is not met.
|
||||
- **Error Handling:** The code handles subprocess errors and unexpected exceptions, providing error messages to the user.
|
||||
CrewAI uses the training artifacts in two ways: during training to incorporate your human feedback, and after training to guide agents with consolidated suggestions.
|
||||
|
||||
It is important to note that the training process may take some time, depending on the complexity of your agents and will also require your feedback on each iteration.
|
||||
### Training data flow
|
||||
|
||||
Once the training is complete, your agents will be equipped with enhanced capabilities and knowledge, ready to tackle complex tasks and provide more consistent and valuable insights.
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A["Start training<br/>CLI: crewai train -n -f<br/>or Python: crew.train(...)"] --> B["Setup training mode<br/>- task.human_input = true<br/>- disable delegation<br/>- init training_data.pkl + trained file"]
|
||||
|
||||
Remember to regularly update and retrain your agents to ensure they stay up-to-date with the latest information and advancements in the field.
|
||||
subgraph "Iterations"
|
||||
direction LR
|
||||
C["Iteration i<br/>initial_output"] --> D["User human_feedback"]
|
||||
D --> E["improved_output"]
|
||||
E --> F["Append to training_data.pkl<br/>by agent_id and iteration"]
|
||||
end
|
||||
|
||||
Happy training with CrewAI! 🚀
|
||||
B --> C
|
||||
F --> G{"More iterations?"}
|
||||
G -- "Yes" --> C
|
||||
G -- "No" --> H["Evaluate per agent<br/>aggregate iterations"]
|
||||
|
||||
H --> I["Consolidate<br/>suggestions[] + quality + final_summary"]
|
||||
I --> J["Save by agent role to trained file<br/>(default: trained_agents_data.pkl)"]
|
||||
|
||||
J --> K["Normal (non-training) runs"]
|
||||
K --> L["Auto-load suggestions<br/>from trained_agents_data.pkl"]
|
||||
L --> M["Append to prompt<br/>for consistent improvements"]
|
||||
```
|
||||
|
||||
### During training runs
|
||||
|
||||
- On each iteration, the system records for every agent:
|
||||
- `initial_output`: the agent’s first answer
|
||||
- `human_feedback`: your inline feedback when prompted
|
||||
- `improved_output`: the agent’s follow-up answer after feedback
|
||||
- This data is stored in a working file named `training_data.pkl` keyed by the agent’s internal ID and iteration.
|
||||
- While training is active, the agent automatically appends your prior human feedback to its prompt to enforce those instructions on subsequent attempts within the training session.
|
||||
Training is interactive: tasks set `human_input = true`, so running in a non-interactive environment will block on user input.
|
||||
|
||||
### After training completes
|
||||
|
||||
- When `train(...)` finishes, CrewAI evaluates the collected training data per agent and produces a consolidated result containing:
|
||||
- `suggestions`: clear, actionable instructions distilled from your feedback and the difference between initial/improved outputs
|
||||
- `quality`: a 0–10 score capturing improvement
|
||||
- `final_summary`: a step-by-step set of action items for future tasks
|
||||
- These consolidated results are saved to the filename you pass to `train(...)` (default via CLI is `trained_agents_data.pkl`). Entries are keyed by the agent’s `role` so they can be applied across sessions.
|
||||
- During normal (non-training) execution, each agent automatically loads its consolidated `suggestions` and appends them to the task prompt as mandatory instructions. This gives you consistent improvements without changing your agent definitions.
|
||||
|
||||
### File summary
|
||||
|
||||
- `training_data.pkl` (ephemeral, per-session):
|
||||
- Structure: `agent_id -> { iteration_number: { initial_output, human_feedback, improved_output } }`
|
||||
- Purpose: capture raw data and human feedback during training
|
||||
- Location: saved in the current working directory (CWD)
|
||||
- `trained_agents_data.pkl` (or your custom filename):
|
||||
- Structure: `agent_role -> { suggestions: string[], quality: number, final_summary: string }`
|
||||
- Purpose: persist consolidated guidance for future runs
|
||||
- Location: written to the CWD by default; use `-f` to set a custom (including absolute) path
|
||||
|
||||
## Small Language Model Considerations
|
||||
|
||||
@@ -129,3 +180,18 @@ Happy training with CrewAI! 🚀
|
||||
</Warning>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
### Key Points to Note
|
||||
|
||||
- **Positive Integer Requirement:** Ensure that the number of iterations (`n_iterations`) is a positive integer. The code will raise a `ValueError` if this condition is not met.
|
||||
- **Filename Requirement:** Ensure that the filename ends with `.pkl`. The code will raise a `ValueError` if this condition is not met.
|
||||
- **Error Handling:** The code handles subprocess errors and unexpected exceptions, providing error messages to the user.
|
||||
- Trained guidance is applied at prompt time; it does not modify your Python/YAML agent configuration.
|
||||
- Agents automatically load trained suggestions from a file named `trained_agents_data.pkl` located in the current working directory. If you trained to a different filename, either rename it to `trained_agents_data.pkl` before running, or adjust the loader in code.
|
||||
- You can change the output filename when calling `crewai train` with `-f/--filename`. Absolute paths are supported if you want to save outside the CWD.
|
||||
|
||||
It is important to note that the training process may take some time, depending on the complexity of your agents and will also require your feedback on each iteration.
|
||||
|
||||
Once the training is complete, your agents will be equipped with enhanced capabilities and knowledge, ready to tackle complex tasks and provide more consistent and valuable insights.
|
||||
|
||||
Remember to regularly update and retrain your agents to ensure they stay up-to-date with the latest information and advancements in the field.
|
||||
|
||||
155
docs/en/enterprise/features/agent-repositories.mdx
Normal file
155
docs/en/enterprise/features/agent-repositories.mdx
Normal file
@@ -0,0 +1,155 @@
|
||||
---
|
||||
title: 'Agent Repositories'
|
||||
description: 'Learn how to use Agent Repositories to share and reuse your agents across teams and projects'
|
||||
icon: 'people-group'
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
Agent Repositories allow enterprise users to store, share, and reuse agent definitions across teams and projects. This feature enables organizations to maintain a centralized library of standardized agents, promoting consistency and reducing duplication of effort.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
## Benefits of Agent Repositories
|
||||
|
||||
- **Standardization**: Maintain consistent agent definitions across your organization
|
||||
- **Reusability**: Create an agent once and use it in multiple crews and projects
|
||||
- **Governance**: Implement organization-wide policies for agent configurations
|
||||
- **Collaboration**: Enable teams to share and build upon each other's work
|
||||
|
||||
## Creating and Use Agent Repositories
|
||||
|
||||
1. You must have an account at CrewAI, try the [free plan](https://app.crewai.com).
|
||||
2. Create agents with specific roles and goals for your workflows.
|
||||
3. Configure tools and capabilities for each specialized assistant.
|
||||
4. Deploy agents across projects via visual interface or API integration.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
|
||||
### Loading Agents from Repositories
|
||||
|
||||
You can load agents from repositories in your code using the `from_repository` parameter to run locally:
|
||||
|
||||
```python
|
||||
from crewai import Agent
|
||||
|
||||
# Create an agent by loading it from a repository
|
||||
# The agent is loaded with all its predefined configurations
|
||||
researcher = Agent(
|
||||
from_repository="market-research-agent"
|
||||
)
|
||||
```
|
||||
|
||||
### Overriding Repository Settings
|
||||
|
||||
You can override specific settings from the repository by providing them in the configuration:
|
||||
|
||||
```python
|
||||
researcher = Agent(
|
||||
from_repository="market-research-agent",
|
||||
goal="Research the latest trends in AI development", # Override the repository goal
|
||||
verbose=True # Add a setting not in the repository
|
||||
)
|
||||
```
|
||||
|
||||
### Example: Creating a Crew with Repository Agents
|
||||
|
||||
```python
|
||||
from crewai import Crew, Agent, Task
|
||||
|
||||
# Load agents from repositories
|
||||
researcher = Agent(
|
||||
from_repository="market-research-agent"
|
||||
)
|
||||
|
||||
writer = Agent(
|
||||
from_repository="content-writer-agent"
|
||||
)
|
||||
|
||||
# Create tasks
|
||||
research_task = Task(
|
||||
description="Research the latest trends in AI",
|
||||
agent=researcher
|
||||
)
|
||||
|
||||
writing_task = Task(
|
||||
description="Write a comprehensive report based on the research",
|
||||
agent=writer
|
||||
)
|
||||
|
||||
# Create the crew
|
||||
crew = Crew(
|
||||
agents=[researcher, writer],
|
||||
tasks=[research_task, writing_task],
|
||||
verbose=True
|
||||
)
|
||||
|
||||
# Run the crew
|
||||
result = crew.kickoff()
|
||||
```
|
||||
|
||||
### Example: Using `kickoff()` with Repository Agents
|
||||
|
||||
You can also use repository agents directly with the `kickoff()` method for simpler interactions:
|
||||
|
||||
```python
|
||||
from crewai import Agent
|
||||
from pydantic import BaseModel
|
||||
from typing import List
|
||||
|
||||
# Define a structured output format
|
||||
class MarketAnalysis(BaseModel):
|
||||
key_trends: List[str]
|
||||
opportunities: List[str]
|
||||
recommendation: str
|
||||
|
||||
# Load an agent from repository
|
||||
analyst = Agent(
|
||||
from_repository="market-analyst-agent",
|
||||
verbose=True
|
||||
)
|
||||
|
||||
# Get a free-form response
|
||||
result = analyst.kickoff("Analyze the AI market in 2025")
|
||||
print(result.raw) # Access the raw response
|
||||
|
||||
# Get structured output
|
||||
structured_result = analyst.kickoff(
|
||||
"Provide a structured analysis of the AI market in 2025",
|
||||
response_format=MarketAnalysis
|
||||
)
|
||||
|
||||
# Access structured data
|
||||
print(f"Key Trends: {structured_result.pydantic.key_trends}")
|
||||
print(f"Recommendation: {structured_result.pydantic.recommendation}")
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Naming Convention**: Use clear, descriptive names for your repository agents
|
||||
2. **Documentation**: Include comprehensive descriptions for each agent
|
||||
3. **Tool Management**: Ensure that tools referenced by repository agents are available in your environment
|
||||
4. **Access Control**: Manage permissions to ensure only authorized team members can modify repository agents
|
||||
|
||||
## Organization Management
|
||||
|
||||
To switch between organizations or see your current organization, use the CrewAI CLI:
|
||||
|
||||
```bash
|
||||
# View current organization
|
||||
crewai org current
|
||||
|
||||
# Switch to a different organization
|
||||
crewai org switch <org_id>
|
||||
|
||||
# List all available organizations
|
||||
crewai org list
|
||||
```
|
||||
|
||||
<Note>
|
||||
When loading agents from repositories, you must be authenticated and switched to the correct organization. If you receive errors, check your authentication status and organization settings using the CLI commands above.
|
||||
</Note>
|
||||
104
docs/en/enterprise/features/automations.mdx
Normal file
104
docs/en/enterprise/features/automations.mdx
Normal file
@@ -0,0 +1,104 @@
|
||||
---
|
||||
title: Automations
|
||||
description: "Manage, deploy, and monitor your live crews (automations) in one place."
|
||||
icon: "rocket"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Automations is the live operations hub for your deployed crews. Use it to deploy from GitHub or a ZIP file, manage environment variables, re‑deploy when needed, and monitor the status of each automation.
|
||||
|
||||
<Frame>
|
||||

|
||||
|
||||
</Frame>
|
||||
|
||||
## Deployment Methods
|
||||
|
||||
### Deploy from GitHub
|
||||
|
||||
Use this for version‑controlled projects and continuous deployment.
|
||||
|
||||
<Steps>
|
||||
<Step title="Connect GitHub">
|
||||
Click <b>Configure GitHub</b> and authorize access.
|
||||
</Step>
|
||||
<Step title="Select Repository & Branch">
|
||||
Choose the <b>Repository</b> and <b>Branch</b> you want to deploy from.
|
||||
</Step>
|
||||
<Step title="Enable Auto‑deploy (optional)">
|
||||
Turn on <b>Automatically deploy new commits</b> to ship updates on every push.
|
||||
</Step>
|
||||
<Step title="Add Environment Variables">
|
||||
Add secrets individually or use <b>Bulk View</b> for multiple variables.
|
||||
</Step>
|
||||
<Step title="Deploy">
|
||||
Click <b>Deploy</b> to create your live automation.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
### Deploy from ZIP
|
||||
|
||||
Ship quickly without Git—upload a compressed package of your project.
|
||||
|
||||
<Steps>
|
||||
<Step title="Choose File">
|
||||
Select the ZIP archive from your computer.
|
||||
</Step>
|
||||
<Step title="Add Environment Variables">
|
||||
Provide any required variables or keys.
|
||||
</Step>
|
||||
<Step title="Deploy">
|
||||
Click <b>Deploy</b> to create your live automation.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
## Automations Dashboard
|
||||
|
||||
The table lists all live automations with key details:
|
||||
|
||||
- **CREW**: Automation name
|
||||
- **STATUS**: Online / Failed / In Progress
|
||||
- **URL**: Endpoint for kickoff/status
|
||||
- **TOKEN**: Automation token
|
||||
- **ACTIONS**: Re‑deploy, delete, and more
|
||||
|
||||
Use the top‑right controls to filter and search:
|
||||
|
||||
- Search by name
|
||||
- Filter by <b>Status</b>
|
||||
- Filter by <b>Source</b> (GitHub / Studio / ZIP)
|
||||
|
||||
Once deployed, you can view the automation details and have the **Options** dropdown menu to `chat with this crew`, `Export React Component` and `Export as MCP`.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
## Best Practices
|
||||
|
||||
- Prefer GitHub deployments for version control and CI/CD
|
||||
- Use re‑deploy to roll forward after code or config updates or set it to auto-deploy on every push
|
||||
|
||||
## Related
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Deploy a Crew" href="/en/enterprise/guides/deploy-crew" icon="rocket">
|
||||
Deploy a Crew from GitHub or ZIP file.
|
||||
</Card>
|
||||
<Card title="Automation Triggers" href="/en/enterprise/guides/automation-triggers" icon="trigger">
|
||||
Trigger automations via webhooks or API.
|
||||
</Card>
|
||||
<Card title="Webhook Automation" href="/en/enterprise/guides/webhook-automation" icon="webhook">
|
||||
Stream real-time events and updates to your systems.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
88
docs/en/enterprise/features/crew-studio.mdx
Normal file
88
docs/en/enterprise/features/crew-studio.mdx
Normal file
@@ -0,0 +1,88 @@
|
||||
---
|
||||
title: Crew Studio
|
||||
description: "Build new automations with AI assistance, a visual editor, and integrated testing."
|
||||
icon: "pencil"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Crew Studio is an interactive, AI‑assisted workspace for creating new automations from scratch using natural language and a visual workflow editor.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
## Prompt‑based Creation
|
||||
|
||||
- Describe the automation you want; the AI generates agents, tasks, and tools.
|
||||
- Use voice input via the microphone icon if preferred.
|
||||
- Start from built‑in prompts for common use cases.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
## Visual Editor
|
||||
|
||||
The canvas reflects the workflow as nodes and edges with three supporting panels that allow you to configure the workflow easily without writing code; a.k.a. "**vibe coding AI Agents**".
|
||||
|
||||
You can use the drag-and-drop functionality to add agents, tasks, and tools to the canvas or you can use the chat section to build the agents. Both approaches share state and can be used interchangeably.
|
||||
|
||||
- **AI Thoughts (left)**: streaming reasoning as the workflow is designed
|
||||
- **Canvas (center)**: agents and tasks as connected nodes
|
||||
- **Resources (right)**: drag‑and‑drop components (agents, tasks, tools)
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
## Execution & Debugging
|
||||
|
||||
Switch to the <b>Execution</b> view to run and observe the workflow:
|
||||
|
||||
- Event timeline
|
||||
- Detailed logs (Details, Messages, Raw Data)
|
||||
- Local test runs before publishing
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
## Publish & Export
|
||||
|
||||
- <b>Publish</b> to deploy a live automation
|
||||
- <b>Download</b> source as a ZIP for local development or customization
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
Once published, you can view the automation details and have the **Options** dropdown menu to `chat with this crew`, `Export React Component` and `Export as MCP`.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
## Best Practices
|
||||
|
||||
- Iterate quickly in Studio; publish only when stable
|
||||
- Keep tools constrained to minimum permissions needed
|
||||
- Use Traces to validate behavior and performance
|
||||
|
||||
## Related
|
||||
|
||||
<CardGroup cols={4}>
|
||||
<Card title="Enable Crew Studio" href="/en/enterprise/guides/enable-crew-studio" icon="palette">
|
||||
Enable Crew Studio.
|
||||
</Card>
|
||||
<Card title="Build a Crew" href="/en/enterprise/guides/build-crew" icon="paintbrush">
|
||||
Build a Crew.
|
||||
</Card>
|
||||
<Card title="Deploy a Crew" href="/en/enterprise/guides/deploy-crew" icon="rocket">
|
||||
Deploy a Crew from GitHub or ZIP file.
|
||||
</Card>
|
||||
<Card title="Export a React Component" href="/en/enterprise/guides/react-component-export" icon="download">
|
||||
Export a React Component.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Hallucination Guardrail
|
||||
description: "Prevent and detect AI hallucinations in your CrewAI tasks"
|
||||
icon: "shield-check"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -1,185 +0,0 @@
|
||||
---
|
||||
title: Integrations
|
||||
description: "Connected applications for your agents to take actions."
|
||||
icon: "plug"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Enable your agents to authenticate with any OAuth enabled provider and take actions. From Salesforce and HubSpot to Google and GitHub, we've got you covered with 16+ integrated services.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
## Supported Integrations
|
||||
|
||||
### **Communication & Collaboration**
|
||||
- **Gmail** - Manage emails and drafts
|
||||
- **Slack** - Workspace notifications and alerts
|
||||
- **Microsoft** - Office 365 and Teams integration
|
||||
|
||||
### **Project Management**
|
||||
- **Jira** - Issue tracking and project management
|
||||
- **ClickUp** - Task and productivity management
|
||||
- **Asana** - Team task and project coordination
|
||||
- **Notion** - Page and database management
|
||||
- **Linear** - Software project and bug tracking
|
||||
- **GitHub** - Repository and issue management
|
||||
|
||||
### **Customer Relationship Management**
|
||||
- **Salesforce** - CRM account and opportunity management
|
||||
- **HubSpot** - Sales pipeline and contact management
|
||||
- **Zendesk** - Customer support ticket management
|
||||
|
||||
### **Business & Finance**
|
||||
- **Stripe** - Payment processing and customer management
|
||||
- **Shopify** - E-commerce store and product management
|
||||
|
||||
### **Productivity & Storage**
|
||||
- **Google Sheets** - Spreadsheet data synchronization
|
||||
- **Google Calendar** - Event and schedule management
|
||||
- **Box** - File storage and document management
|
||||
|
||||
and more to come!
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using Authentication Integrations, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account. You can get started with a free trial.
|
||||
|
||||
|
||||
## Setting Up Integrations
|
||||
|
||||
### 1. Connect Your Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise](https://app.crewai.com)
|
||||
2. Go to **Integrations** tab - https://app.crewai.com/crewai_plus/connectors
|
||||
3. Click **Connect** on your desired service from the Authentication Integrations section
|
||||
4. Complete the OAuth authentication flow
|
||||
5. Grant necessary permissions for your use case
|
||||
6. Get your Enterprise Token from your [CrewAI Enterprise](https://app.crewai.com) account page - https://app.crewai.com/crewai_plus/settings/account
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
### 2. Install Integration Tools
|
||||
|
||||
All you need is the latest version of `crewai-tools` package.
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic Usage
|
||||
<Tip>
|
||||
All the services you are authenticated into will be available as tools. So all you need to do is add the `CrewaiEnterpriseTools` to your agent and you are good to go.
|
||||
</Tip>
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (Gmail tool will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
# print the tools
|
||||
print(enterprise_tools)
|
||||
|
||||
# Create an agent with Gmail capabilities
|
||||
email_agent = Agent(
|
||||
role="Email Manager",
|
||||
goal="Manage and organize email communications",
|
||||
backstory="An AI assistant specialized in email management and communication.",
|
||||
tools=enterprise_tools
|
||||
)
|
||||
|
||||
# Task to send an email
|
||||
email_task = Task(
|
||||
description="Draft and send a follow-up email to john@example.com about the project update",
|
||||
agent=email_agent,
|
||||
expected_output="Confirmation that email was sent successfully"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[email_agent],
|
||||
tasks=[email_task]
|
||||
)
|
||||
|
||||
# Run the crew
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Filtering Tools
|
||||
|
||||
```python
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
actions_list=["gmail_find_email"] # only gmail_find_email tool will be available
|
||||
)
|
||||
gmail_tool = enterprise_tools["gmail_find_email"]
|
||||
|
||||
gmail_agent = Agent(
|
||||
role="Gmail Manager",
|
||||
goal="Manage gmail communications and notifications",
|
||||
backstory="An AI assistant that helps coordinate gmail communications.",
|
||||
tools=[gmail_tool]
|
||||
)
|
||||
|
||||
notification_task = Task(
|
||||
description="Find the email from john@example.com",
|
||||
agent=gmail_agent,
|
||||
expected_output="Email found from john@example.com"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[slack_agent],
|
||||
tasks=[notification_task]
|
||||
)
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Security
|
||||
- **Principle of Least Privilege**: Only grant the minimum permissions required for your agents' tasks
|
||||
- **Regular Audits**: Periodically review connected integrations and their permissions
|
||||
- **Secure Credentials**: Never hardcode credentials; use CrewAI's secure authentication flow
|
||||
|
||||
|
||||
### Filtering Tools
|
||||
On a deployed crew, you can specify which actions are avialbel for each integration from the settings page of the service you connected to.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
|
||||
### Scoped Deployments for multi user organizations
|
||||
You can deploy your crew and scope each integration to a specific user. For example, a crew that connects to google can use a specific user's gmail account.
|
||||
|
||||
<Tip>
|
||||
This is useful for multi user organizations where you want to scope the integration to a specific user.
|
||||
</Tip>
|
||||
|
||||
|
||||
Use the `user_bearer_token` to scope the integration to a specific user so that when the crew is kicked off, it will use the user's bearer token to authenticate with the integration. If user is not logged in, then the crew will not use any connected integrations. Use the default bearer token to authenticate with the integrations thats deployed with the crew.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
|
||||
|
||||
### Getting Help
|
||||
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with integration setup or troubleshooting.
|
||||
</Card>
|
||||
46
docs/en/enterprise/features/marketplace.mdx
Normal file
46
docs/en/enterprise/features/marketplace.mdx
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
title: Marketplace
|
||||
description: "Discover, install, and govern reusable assets for your enterprise crews."
|
||||
icon: "store"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
The Marketplace provides a curated surface for discovering integrations, internal tools, and reusable assets that accelerate crew development.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
## Discoverability
|
||||
|
||||
- Browse by category and capability
|
||||
- Search for assets by name or keyword
|
||||
|
||||
## Install & Enable
|
||||
|
||||
- One‑click install for approved assets
|
||||
- Enable or disable per crew as needed
|
||||
- Configure required environment variables and scopes
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
You can also download the templates directly from the marketplace by clicking on the `Download` button so
|
||||
you can use them locally or refine them to your needs.
|
||||
|
||||
## Related
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Tools & Integrations" href="/en/enterprise/features/tools-and-integrations" icon="wrench">
|
||||
Connect external apps and manage internal tools your agents can use.
|
||||
</Card>
|
||||
<Card title="Tool Repository" href="/en/enterprise/features/tool-repository" icon="toolbox">
|
||||
Publish and install tools to enhance your crews' capabilities.
|
||||
</Card>
|
||||
<Card title="Agents Repository" href="/en/enterprise/features/agent-repositories" icon="people-group">
|
||||
Store, share, and reuse agent definitions across teams and projects.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
102
docs/en/enterprise/features/rbac.mdx
Normal file
102
docs/en/enterprise/features/rbac.mdx
Normal file
@@ -0,0 +1,102 @@
|
||||
---
|
||||
title: "Role-Based Access Control (RBAC)"
|
||||
description: "Control access to crews, tools, and data with roles, scopes, and granular permissions."
|
||||
icon: "shield"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
RBAC in CrewAI AMP enables secure, scalable access management through a combination of organization‑level roles and automation‑level visibility controls.
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/users_and_roles.png" alt="RBAC overview in CrewAI AMP" />
|
||||
|
||||
</Frame>
|
||||
|
||||
## Users and Roles
|
||||
|
||||
Each member in your CrewAI workspace is assigned a role, which determines their access across various features.
|
||||
|
||||
You can:
|
||||
|
||||
- Use predefined roles (Owner, Member)
|
||||
- Create custom roles tailored to specific permissions
|
||||
- Assign roles at any time through the settings panel
|
||||
|
||||
You can configure users and roles in Settings → Roles.
|
||||
|
||||
<Steps>
|
||||
<Step title="Open Roles settings">
|
||||
Go to <b>Settings → Roles</b> in CrewAI AMP.
|
||||
</Step>
|
||||
<Step title="Choose a role type">
|
||||
Use a predefined role (<b>Owner</b>, <b>Member</b>) or click <b>Create role</b> to define a custom one.
|
||||
</Step>
|
||||
<Step title="Assign to members">
|
||||
Select users and assign the role. You can change this anytime.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### Configuration summary
|
||||
|
||||
| Area | Where to configure | Options |
|
||||
|:---|:---|:---|
|
||||
| Users & Roles | Settings → Roles | Predefined: Owner, Member; Custom roles |
|
||||
| Automation visibility | Automation → Settings → Visibility | Private; Whitelist users/roles |
|
||||
|
||||
## Automation‑level Access Control
|
||||
|
||||
In addition to organization‑wide roles, CrewAI Automations support fine‑grained visibility settings that let you restrict access to specific automations by user or role.
|
||||
|
||||
This is useful for:
|
||||
|
||||
- Keeping sensitive or experimental automations private
|
||||
- Managing visibility across large teams or external collaborators
|
||||
- Testing automations in isolated contexts
|
||||
|
||||
Deployments can be configured as private, meaning only whitelisted users and roles will be able to:
|
||||
|
||||
- View the deployment
|
||||
- Run it or interact with its API
|
||||
- Access its logs, metrics, and settings
|
||||
|
||||
The organization owner always has access, regardless of visibility settings.
|
||||
|
||||
You can configure automation‑level access control in Automation → Settings → Visibility tab.
|
||||
|
||||
<Steps>
|
||||
<Step title="Open Visibility tab">
|
||||
Navigate to <b>Automation → Settings → Visibility</b>.
|
||||
</Step>
|
||||
<Step title="Set visibility">
|
||||
Choose <b>Private</b> to restrict access. The organization owner always retains access.
|
||||
</Step>
|
||||
<Step title="Whitelist access">
|
||||
Add specific users and roles allowed to view, run, and access logs/metrics/settings.
|
||||
</Step>
|
||||
<Step title="Save and verify">
|
||||
Save changes, then confirm that non‑whitelisted users cannot view or run the automation.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### Private visibility: access outcomes
|
||||
|
||||
| Action | Owner | Whitelisted user/role | Not whitelisted |
|
||||
|:---|:---|:---|:---|
|
||||
| View automation | ✓ | ✓ | ✗ |
|
||||
| Run automation/API | ✓ | ✓ | ✗ |
|
||||
| Access logs/metrics/settings | ✓ | ✓ | ✗ |
|
||||
|
||||
<Tip>
|
||||
The organization owner always has access. In private mode, only whitelisted users and roles can view, run, and access logs/metrics/settings.
|
||||
</Tip>
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/visibility.png" alt="Automation Visibility settings in CrewAI AMP" />
|
||||
|
||||
</Frame>
|
||||
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with RBAC questions.
|
||||
</Card>
|
||||
249
docs/en/enterprise/features/tools-and-integrations.mdx
Normal file
249
docs/en/enterprise/features/tools-and-integrations.mdx
Normal file
@@ -0,0 +1,249 @@
|
||||
---
|
||||
title: Tools & Integrations
|
||||
description: "Connect external apps and manage internal tools your agents can use."
|
||||
icon: "wrench"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Tools & Integrations is the central hub for connecting third‑party apps and managing internal tools that your agents can use at runtime.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
## Explore
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Integrations" icon="plug">
|
||||
|
||||
## Agent Apps (Integrations)
|
||||
|
||||
Connect enterprise‑grade applications (e.g., Gmail, Google Drive, HubSpot, Slack) via OAuth to enable agent actions.
|
||||
|
||||
<Steps>
|
||||
<Step title="Connect">
|
||||
Click <b>Connect</b> on an app and complete OAuth.
|
||||
</Step>
|
||||
<Step title="Configure">
|
||||
Optionally adjust scopes, triggers, and action availability.
|
||||
</Step>
|
||||
<Step title="Use in Agents">
|
||||
Connected services become available as tools for your agents.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
### Connect your Account
|
||||
|
||||
1. Go to <Link href="https://app.crewai.com/crewai_plus/connectors">Integrations</Link>
|
||||
2. Click <b>Connect</b> on the desired service
|
||||
3. Complete the OAuth flow and grant scopes
|
||||
4. Copy your Enterprise Token from the <b>Integration</b> tab
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
### Install Integration Tools
|
||||
|
||||
To use the integrations locally, you need to install the latest `crewai-tools` package.
|
||||
|
||||
```bash
|
||||
uv add crewai-tools
|
||||
```
|
||||
|
||||
### Usage Example
|
||||
|
||||
<Tip>
|
||||
All services you have authenticated will be available as tools. Add `CrewaiEnterpriseTools` to your agent and you’re set.
|
||||
</Tip>
|
||||
|
||||
```python
|
||||
from crewai import Agent, Task, Crew
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
# Get enterprise tools (Gmail tool will be included)
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
enterprise_token="your_enterprise_token"
|
||||
)
|
||||
# print the tools
|
||||
print(enterprise_tools)
|
||||
|
||||
# Create an agent with Gmail capabilities
|
||||
email_agent = Agent(
|
||||
role="Email Manager",
|
||||
goal="Manage and organize email communications",
|
||||
backstory="An AI assistant specialized in email management and communication.",
|
||||
tools=enterprise_tools
|
||||
)
|
||||
|
||||
# Task to send an email
|
||||
email_task = Task(
|
||||
description="Draft and send a follow-up email to john@example.com about the project update",
|
||||
agent=email_agent,
|
||||
expected_output="Confirmation that email was sent successfully"
|
||||
)
|
||||
|
||||
# Run the task
|
||||
crew = Crew(
|
||||
agents=[email_agent],
|
||||
tasks=[email_task]
|
||||
)
|
||||
|
||||
# Run the crew
|
||||
crew.kickoff()
|
||||
```
|
||||
|
||||
### Filtering Tools
|
||||
|
||||
```python
|
||||
from crewai_tools import CrewaiEnterpriseTools
|
||||
|
||||
enterprise_tools = CrewaiEnterpriseTools(
|
||||
actions_list=["gmail_find_email"] # only gmail_find_email tool will be available
|
||||
)
|
||||
|
||||
|
||||
gmail_tool = enterprise_tools["gmail_find_email"]
|
||||
|
||||
|
||||
gmail_agent = Agent(
|
||||
role="Gmail Manager",
|
||||
goal="Manage gmail communications and notifications",
|
||||
backstory="An AI assistant that helps coordinate gmail communications.",
|
||||
tools=[gmail_tool]
|
||||
)
|
||||
|
||||
notification_task = Task(
|
||||
description="Find the email from john@example.com",
|
||||
agent=gmail_agent,
|
||||
expected_output="Email found from john@example.com"
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[gmail_agent],
|
||||
tasks=[notification_task]
|
||||
)
|
||||
```
|
||||
|
||||
On a deployed crew, you can specify which actions are available for each integration from the service settings page.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
### Scoped Deployments (multi‑user orgs)
|
||||
|
||||
You can scope each integration to a specific user. For example, a crew that connects to Google can use a specific user’s Gmail account.
|
||||
|
||||
<Tip>
|
||||
Useful when different teams/users must keep data access separated.
|
||||
</Tip>
|
||||
|
||||
Use the `user_bearer_token` to scope authentication to the requesting user. If the user isn’t logged in, the crew won’t use connected integrations. Otherwise it falls back to the default bearer token configured for the deployment.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
<div id="catalog"></div>
|
||||
### Catalog
|
||||
|
||||
#### Communication & Collaboration
|
||||
- Gmail — Manage emails and drafts
|
||||
- Slack — Workspace notifications and alerts
|
||||
- Microsoft — Office 365 and Teams integration
|
||||
|
||||
#### Project Management
|
||||
- Jira — Issue tracking and project management
|
||||
- ClickUp — Task and productivity management
|
||||
- Asana — Team task and project coordination
|
||||
- Notion — Page and database management
|
||||
- Linear — Software project and bug tracking
|
||||
- GitHub — Repository and issue management
|
||||
|
||||
#### Customer Relationship Management
|
||||
- Salesforce — CRM account and opportunity management
|
||||
- HubSpot — Sales pipeline and contact management
|
||||
- Zendesk — Customer support ticket management
|
||||
|
||||
#### Business & Finance
|
||||
- Stripe — Payment processing and customer management
|
||||
- Shopify — E‑commerce store and product management
|
||||
|
||||
#### Productivity & Storage
|
||||
- Google Sheets — Spreadsheet data synchronization
|
||||
- Google Calendar — Event and schedule management
|
||||
- Box — File storage and document management
|
||||
|
||||
…and more to come!
|
||||
|
||||
</Tab>
|
||||
<Tab title="Internal Tools" icon="toolbox">
|
||||
|
||||
## Internal Tools
|
||||
|
||||
Create custom tools locally, publish them on CrewAI AMP Tool Repository and use them in your agents.
|
||||
|
||||
<Tip>
|
||||
Before running the commands below, make sure you log in to your CrewAI AMP account by running this command:
|
||||
```bash
|
||||
crewai login
|
||||
```
|
||||
</Tip>
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
<Steps>
|
||||
<Step title="Create">
|
||||
Create a new tool locally.
|
||||
```bash
|
||||
crewai tool create your-tool
|
||||
```
|
||||
</Step>
|
||||
<Step title="Publish">
|
||||
Publish the tool to the CrewAI AMP Tool Repository.
|
||||
```bash
|
||||
crewai tool publish
|
||||
```
|
||||
</Step>
|
||||
<Step title="Install">
|
||||
Install the tool from the CrewAI AMP Tool Repository.
|
||||
```bash
|
||||
crewai tool install your-tool
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
Manage:
|
||||
|
||||
- Name and description
|
||||
- Visibility (Private / Public)
|
||||
- Required environment variables
|
||||
- Version history and downloads
|
||||
- Team and role access
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Related
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Tool Repository" href="/en/enterprise/features/tool-repository" icon="toolbox">
|
||||
Create, publish, and version custom tools for your organization.
|
||||
</Card>
|
||||
<Card title="Webhook Automation" href="/en/enterprise/guides/webhook-automation" icon="bolt">
|
||||
Automate workflows and integrate with external platforms and services.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Traces
|
||||
description: "Using Traces to monitor your Crews"
|
||||
icon: "timeline"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -10,7 +11,7 @@ Traces provide comprehensive visibility into your crew executions, helping you m
|
||||
|
||||
## What are Traces?
|
||||
|
||||
Traces in CrewAI Enterprise are detailed execution records that capture every aspect of your crew's operation, from initial inputs to final outputs. They record:
|
||||
Traces in CrewAI AMP are detailed execution records that capture every aspect of your crew's operation, from initial inputs to final outputs. They record:
|
||||
|
||||
- Agent thoughts and reasoning
|
||||
- Task execution details
|
||||
@@ -27,9 +28,9 @@ Traces in CrewAI Enterprise are detailed execution records that capture every as
|
||||
|
||||
<Steps>
|
||||
<Step title="Navigate to the Traces Tab">
|
||||
Once in your CrewAI Enterprise dashboard, click on the **Traces** to view all execution records.
|
||||
Once in your CrewAI AMP dashboard, click on the **Traces** to view all execution records.
|
||||
</Step>
|
||||
|
||||
|
||||
<Step title="Select an Execution">
|
||||
You'll see a list of all crew executions, sorted by date. Click on any execution to view its detailed trace.
|
||||
</Step>
|
||||
@@ -111,7 +112,7 @@ Traces are invaluable for troubleshooting issues with your crews:
|
||||
<Steps>
|
||||
<Step title="Identify Failure Points">
|
||||
When a crew execution doesn't produce the expected results, examine the trace to find where things went wrong. Look for:
|
||||
|
||||
|
||||
- Failed tasks
|
||||
- Unexpected agent decisions
|
||||
- Tool usage errors
|
||||
@@ -121,19 +122,19 @@ Traces are invaluable for troubleshooting issues with your crews:
|
||||

|
||||
</Frame>
|
||||
</Step>
|
||||
|
||||
|
||||
<Step title="Optimize Performance">
|
||||
Use execution metrics to identify performance bottlenecks:
|
||||
|
||||
|
||||
- Tasks that took longer than expected
|
||||
- Excessive token usage
|
||||
- Redundant tool operations
|
||||
- Unnecessary API calls
|
||||
</Step>
|
||||
|
||||
|
||||
<Step title="Improve Cost Efficiency">
|
||||
Analyze token usage and cost estimates to optimize your crew's efficiency:
|
||||
|
||||
|
||||
- Consider using smaller models for simpler tasks
|
||||
- Refine prompts to be more concise
|
||||
- Cache frequently accessed information
|
||||
@@ -141,6 +142,16 @@ Traces are invaluable for troubleshooting issues with your crews:
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Performance and batching
|
||||
|
||||
CrewAI batches trace uploads to reduce overhead on high-volume runs:
|
||||
|
||||
- A TraceBatchManager buffers events and sends them in batches via the Plus API client
|
||||
- Reduces network chatter and improves reliability on flaky connections
|
||||
- Automatically enabled in the default trace listener; no configuration needed
|
||||
|
||||
This yields more stable tracing under load while preserving detailed task/agent telemetry.
|
||||
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with trace analysis or any other CrewAI Enterprise features.
|
||||
</Card>
|
||||
Contact our support team for assistance with trace analysis or any other CrewAI AMP features.
|
||||
</Card>
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
title: Webhook Streaming
|
||||
description: "Using Webhook Streaming to stream events to your webhook"
|
||||
icon: "webhook"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Enterprise Event Streaming lets you receive real-time webhook updates about your crews and flows deployed to
|
||||
CrewAI Enterprise, such as model calls, tool usage, and flow steps.
|
||||
Enterprise Event Streaming lets you receive real-time webhook updates about your crews and flows deployed to
|
||||
CrewAI AMP, such as model calls, tool usage, and flow steps.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -62,21 +63,106 @@ As requests are sent over HTTP, the order of events can't be guaranteed. If you
|
||||
|
||||
CrewAI supports both system events and custom events in Enterprise Event Streaming. These events are sent to your configured webhook endpoint during crew and flow execution.
|
||||
|
||||
- `crew_kickoff_started`
|
||||
- `crew_step_started`
|
||||
- `crew_step_completed`
|
||||
- `crew_execution_completed`
|
||||
- `llm_call_started`
|
||||
- `llm_call_completed`
|
||||
- `tool_usage_started`
|
||||
- `tool_usage_completed`
|
||||
- `crew_test_failed`
|
||||
- *...and others*
|
||||
### Flow Events:
|
||||
|
||||
Event names match the internal event bus. See [GitHub source](https://github.com/crewAIInc/crewAI/tree/main/src/crewai/utilities/events) for the full list.
|
||||
- `flow_created`
|
||||
- `flow_started`
|
||||
- `flow_finished`
|
||||
- `flow_plot`
|
||||
- `method_execution_started`
|
||||
- `method_execution_finished`
|
||||
- `method_execution_failed`
|
||||
|
||||
### Agent Events:
|
||||
|
||||
- `agent_execution_started`
|
||||
- `agent_execution_completed`
|
||||
- `agent_execution_error`
|
||||
- `lite_agent_execution_started`
|
||||
- `lite_agent_execution_completed`
|
||||
- `lite_agent_execution_error`
|
||||
- `agent_logs_started`
|
||||
- `agent_logs_execution`
|
||||
- `agent_evaluation_started`
|
||||
- `agent_evaluation_completed`
|
||||
- `agent_evaluation_failed`
|
||||
|
||||
### Crew Events:
|
||||
|
||||
- `crew_kickoff_started`
|
||||
- `crew_kickoff_completed`
|
||||
- `crew_kickoff_failed`
|
||||
- `crew_train_started`
|
||||
- `crew_train_completed`
|
||||
- `crew_train_failed`
|
||||
- `crew_test_started`
|
||||
- `crew_test_completed`
|
||||
- `crew_test_failed`
|
||||
- `crew_test_result`
|
||||
|
||||
### Task Events:
|
||||
|
||||
- `task_started`
|
||||
- `task_completed`
|
||||
- `task_failed`
|
||||
- `task_evaluation`
|
||||
|
||||
### Tool Usage Events:
|
||||
|
||||
- `tool_usage_started`
|
||||
- `tool_usage_finished`
|
||||
- `tool_usage_error`
|
||||
- `tool_validate_input_error`
|
||||
- `tool_selection_error`
|
||||
- `tool_execution_error`
|
||||
|
||||
### LLM Events:
|
||||
|
||||
- `llm_call_started`
|
||||
- `llm_call_completed`
|
||||
- `llm_call_failed`
|
||||
- `llm_stream_chunk`
|
||||
|
||||
### LLM Guardrail Events:
|
||||
|
||||
- `llm_guardrail_started`
|
||||
- `llm_guardrail_completed`
|
||||
|
||||
### Memory Events:
|
||||
|
||||
- `memory_query_started`
|
||||
- `memory_query_completed`
|
||||
- `memory_query_failed`
|
||||
- `memory_save_started`
|
||||
- `memory_save_completed`
|
||||
- `memory_save_failed`
|
||||
- `memory_retrieval_started`
|
||||
- `memory_retrieval_completed`
|
||||
|
||||
### Knowledge Events:
|
||||
|
||||
- `knowledge_search_query_started`
|
||||
- `knowledge_search_query_completed`
|
||||
- `knowledge_search_query_failed`
|
||||
- `knowledge_query_started`
|
||||
- `knowledge_query_completed`
|
||||
- `knowledge_query_failed`
|
||||
|
||||
### Reasoning Events:
|
||||
|
||||
- `agent_reasoning_started`
|
||||
- `agent_reasoning_completed`
|
||||
- `agent_reasoning_failed`
|
||||
|
||||
Event names match the internal event bus. See GitHub for the full list of events.
|
||||
|
||||
You can emit your own custom events, and they will be delivered through the webhook stream alongside system events.
|
||||
|
||||
<CardGroup>
|
||||
<Card title="GitHub" icon="github" href="https://github.com/crewAIInc/crewAI/tree/main/src/crewai/utilities/events">
|
||||
Full list of events
|
||||
</Card>
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with webhook integration or troubleshooting.
|
||||
</Card>
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
255
docs/en/enterprise/guides/automation-triggers.mdx
Normal file
255
docs/en/enterprise/guides/automation-triggers.mdx
Normal file
@@ -0,0 +1,255 @@
|
||||
---
|
||||
title: "Triggers Overview"
|
||||
description: "Understand how CrewAI AMP triggers work, how to manage them, and where to find integration-specific playbooks"
|
||||
icon: "face-smile"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
CrewAI AMP triggers connect your automations to real-time events across the tools your teams already use. Instead of polling systems or relying on manual kickoffs, triggers listen for changes—new emails, calendar updates, CRM status changes—and immediately launch the crew or flow you specify.
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
|
||||
### Integration Playbooks
|
||||
|
||||
Deep-dive guides walk through setup and sample workflows for each integration:
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Gmail Trigger" icon="envelope">
|
||||
<a href="/en/enterprise/guides/gmail-trigger">Enable crews when emails arrive or threads update.</a>
|
||||
</Card>
|
||||
|
||||
<Card title="Google Calendar Trigger" icon="calendar-days">
|
||||
<a href="/en/enterprise/guides/google-calendar-trigger">React to calendar events as they are created, updated, or cancelled.</a>
|
||||
</Card>
|
||||
|
||||
<Card title="Google Drive Trigger" icon="folder-open">
|
||||
<a href="/en/enterprise/guides/google-drive-trigger">Handle Drive file uploads, edits, and deletions.</a>
|
||||
</Card>
|
||||
|
||||
<Card title="Outlook Trigger" icon="envelope-open">
|
||||
<a href="/en/enterprise/guides/outlook-trigger">Automate responses to new Outlook messages and calendar updates.</a>
|
||||
</Card>
|
||||
|
||||
<Card title="OneDrive Trigger" icon="cloud">
|
||||
<a href="/en/enterprise/guides/onedrive-trigger">Audit file activity and sharing changes in OneDrive.</a>
|
||||
</Card>
|
||||
|
||||
<Card title="Microsoft Teams Trigger" icon="comments">
|
||||
<a href="/en/enterprise/guides/microsoft-teams-trigger">Kick off workflows when new Teams chats start.</a>
|
||||
</Card>
|
||||
|
||||
<Card title="HubSpot Trigger" icon="hubspot">
|
||||
<a href="/en/enterprise/guides/hubspot-trigger">Launch automations from HubSpot workflows and lifecycle events.</a>
|
||||
</Card>
|
||||
|
||||
<Card title="Salesforce Trigger" icon="salesforce">
|
||||
<a href="/en/enterprise/guides/salesforce-trigger">Connect Salesforce processes to CrewAI for CRM automation.</a>
|
||||
</Card>
|
||||
|
||||
<Card title="Slack Trigger" icon="slack">
|
||||
<a href="/en/enterprise/guides/slack-trigger">Start crews directly from Slack slash commands.</a>
|
||||
</Card>
|
||||
|
||||
<Card title="Zapier Trigger" icon="bolt">
|
||||
<a href="/en/enterprise/guides/zapier-trigger">Bridge CrewAI with thousands of Zapier-supported apps.</a>
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Trigger Capabilities
|
||||
|
||||
With triggers, you can:
|
||||
|
||||
- **Respond to real-time events** - Automatically execute workflows when specific conditions are met
|
||||
- **Integrate with external systems** - Connect with platforms like Gmail, Outlook, OneDrive, JIRA, Slack, Stripe and more
|
||||
- **Scale your automation** - Handle high-volume events without manual intervention
|
||||
- **Maintain context** - Access trigger data within your crews and flows
|
||||
|
||||
## Managing Triggers
|
||||
|
||||
### Viewing Available Triggers
|
||||
|
||||
To access and manage your automation triggers:
|
||||
|
||||
1. Navigate to your deployment in the CrewAI dashboard
|
||||
2. Click on the **Triggers** tab to view all available trigger integrations
|
||||
|
||||
<Frame caption="Example of available automation triggers for a Gmail deployment">
|
||||
<img src="/images/enterprise/list-available-triggers.png" alt="List of available automation triggers" />
|
||||
</Frame>
|
||||
|
||||
This view shows all the trigger integrations available for your deployment, along with their current connection status.
|
||||
|
||||
### Enabling and Disabling Triggers
|
||||
|
||||
Each trigger can be easily enabled or disabled using the toggle switch:
|
||||
|
||||
<Frame caption="Enable or disable triggers with toggle">
|
||||
<img src="/images/enterprise/trigger-selected.png" alt="Enable or disable triggers with toggle" />
|
||||
</Frame>
|
||||
|
||||
- **Enabled (blue toggle)**: The trigger is active and will automatically execute your deployment when the specified events occur
|
||||
- **Disabled (gray toggle)**: The trigger is inactive and will not respond to events
|
||||
|
||||
Simply click the toggle to change the trigger state. Changes take effect immediately.
|
||||
|
||||
### Monitoring Trigger Executions
|
||||
|
||||
Track the performance and history of your triggered executions:
|
||||
|
||||
<Frame caption="List of executions triggered by automation">
|
||||
<img src="/images/enterprise/list-executions.png" alt="List of executions triggered by automation" />
|
||||
</Frame>
|
||||
|
||||
## Building Trigger-Driven Automations
|
||||
|
||||
Before building your automation, it's helpful to understand the structure of trigger payloads that your crews and flows will receive.
|
||||
|
||||
### Trigger Setup Checklist
|
||||
|
||||
Before wiring a trigger into production, make sure you:
|
||||
|
||||
- Connect the integration under **Tools & Integrations** and complete any OAuth or API key steps
|
||||
- Enable the trigger toggle on the deployment that should respond to events
|
||||
- Provide any required environment variables (API tokens, tenant IDs, shared secrets)
|
||||
- Create or update tasks that can parse the incoming payload within the first crew task or flow step
|
||||
- Decide whether to pass trigger context automatically using `allow_crewai_trigger_context`
|
||||
- Set up monitoring—webhook logs, CrewAI execution history, and optional external alerting
|
||||
|
||||
### Payload & Crew Examples Repository
|
||||
|
||||
We maintain a comprehensive repository with end-to-end trigger examples to help you build and test your automations:
|
||||
|
||||
This repository contains:
|
||||
|
||||
- **Realistic payload samples** for every supported trigger integration
|
||||
- **Ready-to-run crew implementations** that parse each payload and turn it into a business workflow
|
||||
- **Multiple scenarios per integration** (e.g., new events, updates, deletions) so you can match the shape of your data
|
||||
|
||||
| Integration | When it fires | Payload Samples | Crew Examples |
|
||||
| :-- | :-- | :-- | :-- |
|
||||
| Gmail | New messages, thread updates | [New alerts, thread updates](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/gmail) | [`new-email-crew.py`, `gmail-alert-crew.py`](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/gmail) |
|
||||
| Google Calendar | Event created / updated / started / ended / cancelled | [Event lifecycle payloads](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/google_calendar) | [`calendar-event-crew.py`, `calendar-meeting-crew.py`, `calendar-working-location-crew.py`](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/google_calendar) |
|
||||
| Google Drive | File created / updated / deleted | [File lifecycle payloads](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/google_drive) | [`drive-file-crew.py`, `drive-file-deletion-crew.py`](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/google_drive) |
|
||||
| Outlook | New email, calendar event removed | [Outlook payloads](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/outlook) | [`outlook-message-crew.py`, `outlook-event-removal-crew.py`](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/outlook) |
|
||||
| OneDrive | File operations (create, update, share, delete) | [OneDrive payloads](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/onedrive) | [`onedrive-file-crew.py`](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/onedrive) |
|
||||
| HubSpot | Record created / updated (contacts, companies, deals) | [HubSpot payloads](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/hubspot) | [`hubspot-company-crew.py`, `hubspot-contact-crew.py`, `hubspot-record-crew.py`](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/hubspot) |
|
||||
| Microsoft Teams | Chat thread created | [Teams chat payload](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/microsoft-teams) | [`teams-chat-created-crew.py`](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/microsoft-teams) |
|
||||
|
||||
Use these samples to understand payload shape, copy the matching crew, and then replace the test payload with your live trigger data.
|
||||
|
||||
### Triggers with Crew
|
||||
|
||||
Your existing crew definitions work seamlessly with triggers, you just need to have a task to parse the received payload:
|
||||
|
||||
```python
|
||||
@CrewBase
|
||||
class MyAutomatedCrew:
|
||||
@agent
|
||||
def researcher(self) -> Agent:
|
||||
return Agent(
|
||||
config=self.agents_config['researcher'],
|
||||
)
|
||||
|
||||
@task
|
||||
def parse_trigger_payload(self) -> Task:
|
||||
return Task(
|
||||
config=self.tasks_config['parse_trigger_payload'],
|
||||
agent=self.researcher(),
|
||||
)
|
||||
|
||||
@task
|
||||
def analyze_trigger_content(self) -> Task:
|
||||
return Task(
|
||||
config=self.tasks_config['analyze_trigger_data'],
|
||||
agent=self.researcher(),
|
||||
)
|
||||
```
|
||||
|
||||
The crew will automatically receive and can access the trigger payload through the standard CrewAI context mechanisms.
|
||||
|
||||
<Note>
|
||||
Crew and Flow inputs can include `crewai_trigger_payload`. CrewAI automatically injects this payload:
|
||||
- Tasks: appended to the first task's description by default ("Trigger Payload: {crewai_trigger_payload}")
|
||||
- Control via `allow_crewai_trigger_context`: set `True` to always inject, `False` to never inject
|
||||
- Flows: any `@start()` method that accepts a `crewai_trigger_payload` parameter will receive it
|
||||
</Note>
|
||||
|
||||
### Integration with Flows
|
||||
|
||||
For flows, you have more control over how trigger data is handled:
|
||||
|
||||
#### Accessing Trigger Payload
|
||||
|
||||
All `@start()` methods in your flows will accept an additional parameter called `crewai_trigger_payload`:
|
||||
|
||||
```python
|
||||
from crewai.flow import Flow, start, listen
|
||||
|
||||
class MyAutomatedFlow(Flow):
|
||||
@start()
|
||||
def handle_trigger(self, crewai_trigger_payload: dict = None):
|
||||
"""
|
||||
This start method can receive trigger data
|
||||
"""
|
||||
if crewai_trigger_payload:
|
||||
# Process the trigger data
|
||||
trigger_id = crewai_trigger_payload.get('id')
|
||||
event_data = crewai_trigger_payload.get('payload', {})
|
||||
|
||||
# Store in flow state for use by other methods
|
||||
self.state.trigger_id = trigger_id
|
||||
self.state.trigger_type = event_data
|
||||
|
||||
return event_data
|
||||
|
||||
# Handle manual execution
|
||||
return None
|
||||
|
||||
@listen(handle_trigger)
|
||||
def process_data(self, trigger_data):
|
||||
"""
|
||||
Process the data from the trigger
|
||||
"""
|
||||
# ... process the trigger
|
||||
```
|
||||
|
||||
#### Triggering Crews from Flows
|
||||
|
||||
When kicking off a crew within a flow that was triggered, pass the trigger payload as it:
|
||||
|
||||
```python
|
||||
@start()
|
||||
def delegate_to_crew(self, crewai_trigger_payload: dict = None):
|
||||
"""
|
||||
Delegate processing to a specialized crew
|
||||
"""
|
||||
crew = MySpecializedCrew()
|
||||
|
||||
# Pass the trigger payload to the crew
|
||||
result = crew.crew().kickoff(
|
||||
inputs={
|
||||
'a_custom_parameter': "custom_value",
|
||||
'crewai_trigger_payload': crewai_trigger_payload
|
||||
},
|
||||
)
|
||||
|
||||
return result
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**Trigger not firing:**
|
||||
- Verify the trigger is enabled
|
||||
- Check integration connection status
|
||||
|
||||
**Execution failures:**
|
||||
- Check the execution logs for error details
|
||||
- If you are developing, make sure the inputs include the `crewai_trigger_payload` parameter with the correct payload
|
||||
|
||||
Automation triggers transform your CrewAI deployments into responsive, event-driven systems that can seamlessly integrate with your existing business processes and tools.
|
||||
|
||||
<Card title="CrewAI AMP Trigger Examples" href="https://github.com/crewAIInc/crewai-enterprise-trigger-examples" icon="github">
|
||||
Check them out on GitHub!
|
||||
</Card>
|
||||
@@ -2,6 +2,7 @@
|
||||
title: "Azure OpenAI Setup"
|
||||
description: "Configure Azure OpenAI with Crew Studio for enterprise LLM connections"
|
||||
icon: "microsoft"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
This guide walks you through connecting Azure OpenAI with Crew Studio for seamless enterprise AI operations.
|
||||
@@ -9,17 +10,17 @@ This guide walks you through connecting Azure OpenAI with Crew Studio for seamle
|
||||
## Setup Process
|
||||
|
||||
<Steps>
|
||||
<Step title="Access Azure OpenAI Studio">
|
||||
1. In Azure, go to `Azure AI Services > select your deployment > open Azure OpenAI Studio`.
|
||||
<Step title="Access Azure AI Foundry">
|
||||
1. In Azure, go to [Azure AI Foundry](https://ai.azure.com/) > select your Azure OpenAI deployment.
|
||||
2. On the left menu, click `Deployments`. If you don't have one, create a deployment with your desired model.
|
||||
3. Once created, select your deployment and locate the `Target URI` and `Key` on the right side of the page. Keep this page open, as you'll need this information.
|
||||
<Frame>
|
||||
<img src="/images/enterprise/azure-openai-studio.png" alt="Azure OpenAI Studio" />
|
||||
<img src="/images/enterprise/azure-openai-studio.png" alt="Azure AI Foundry" />
|
||||
</Frame>
|
||||
</Step>
|
||||
|
||||
<Step title="Configure CrewAI Enterprise Connection">
|
||||
4. In another tab, open `CrewAI Enterprise > LLM Connections`. Name your LLM Connection, select Azure as the provider, and choose the same model you selected in Azure.
|
||||
<Step title="Configure CrewAI AMP Connection">
|
||||
4. In another tab, open `CrewAI AMP > LLM Connections`. Name your LLM Connection, select Azure as the provider, and choose the same model you selected in Azure.
|
||||
5. On the same page, add environment variables from step 3:
|
||||
- One named `AZURE_DEPLOYMENT_TARGET_URL` (using the Target URI). The URL should look like this: https://your-deployment.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-08-01-preview
|
||||
- Another named `AZURE_API_KEY` (using the Key).
|
||||
@@ -27,7 +28,7 @@ This guide walks you through connecting Azure OpenAI with Crew Studio for seamle
|
||||
</Step>
|
||||
|
||||
<Step title="Set Default Configuration">
|
||||
7. In `CrewAI Enterprise > Settings > Defaults > Crew Studio LLM Settings`, set the new LLM Connection and model as defaults.
|
||||
7. In `CrewAI AMP > Settings > Defaults > Crew Studio LLM Settings`, set the new LLM Connection and model as defaults.
|
||||
</Step>
|
||||
|
||||
<Step title="Configure Network Access">
|
||||
@@ -48,4 +49,4 @@ If you encounter issues:
|
||||
- Verify the Target URI format matches the expected pattern
|
||||
- Check that the API key is correct and has proper permissions
|
||||
- Ensure network access is configured to allow CrewAI connections
|
||||
- Confirm the deployment model matches what you've configured in CrewAI
|
||||
- Confirm the deployment model matches what you've configured in CrewAI
|
||||
|
||||
@@ -2,23 +2,22 @@
|
||||
title: "Build Crew"
|
||||
description: "A Crew is a group of agents that work together to complete a task."
|
||||
icon: "people-arrows"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
[CrewAI Enterprise](https://app.crewai.com) streamlines the process of **creating**, **deploying**, and **managing** your AI agents in production environments.
|
||||
[CrewAI AMP](https://app.crewai.com) streamlines the process of **creating**, **deploying**, and **managing** your AI agents in production environments.
|
||||
|
||||
## Getting Started
|
||||
|
||||
<iframe
|
||||
width="100%"
|
||||
height="400"
|
||||
src="https://www.youtube.com/embed/-kSOTtYzgEw"
|
||||
title="Building Crews with CrewAI CLI"
|
||||
frameborder="0"
|
||||
style={{ borderRadius: '10px' }}
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowfullscreen
|
||||
className="w-full aspect-video rounded-xl"
|
||||
src="https://www.youtube.com/embed/-kSOTtYzgEw"
|
||||
title="Building crews with the CrewAI CLI"
|
||||
frameBorder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowFullScreen
|
||||
></iframe>
|
||||
|
||||
### Installation and Setup
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
---
|
||||
title: "Deploy Crew"
|
||||
description: "Deploying a Crew on CrewAI Enterprise"
|
||||
description: "Deploying a Crew on CrewAI AMP"
|
||||
icon: "rocket"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
<Note>
|
||||
After creating a crew locally or through Crew Studio, the next step is deploying it to the CrewAI Enterprise platform. This guide covers multiple deployment methods to help you choose the best approach for your workflow.
|
||||
After creating a crew locally or through Crew Studio, the next step is deploying it to the CrewAI AMP platform. This guide covers multiple deployment methods to help you choose the best approach for your workflow.
|
||||
</Note>
|
||||
|
||||
## Prerequisites
|
||||
@@ -38,14 +39,11 @@ The CLI provides the fastest way to deploy locally developed crews to the Enterp
|
||||
</Step>
|
||||
|
||||
<Step title="Authenticate with the Enterprise Platform">
|
||||
First, you need to authenticate your CLI with the CrewAI Enterprise platform:
|
||||
First, you need to authenticate your CLI with the CrewAI AMP platform:
|
||||
|
||||
```bash
|
||||
# If you already have a CrewAI Enterprise account
|
||||
# If you already have a CrewAI AMP account, or want to create one:
|
||||
crewai login
|
||||
|
||||
# If you're creating a new account
|
||||
crewai signup
|
||||
```
|
||||
|
||||
When you run either command, the CLI will:
|
||||
@@ -126,7 +124,7 @@ The CrewAI CLI offers several commands to manage your deployments:
|
||||
|
||||
## Option 2: Deploy Directly via Web Interface
|
||||
|
||||
You can also deploy your crews directly through the CrewAI Enterprise web interface by connecting your GitHub account. This approach doesn't require using the CLI on your local machine.
|
||||
You can also deploy your crews directly through the CrewAI AMP web interface by connecting your GitHub account. This approach doesn't require using the CLI on your local machine.
|
||||
|
||||
<Steps>
|
||||
|
||||
@@ -136,9 +134,9 @@ You can also deploy your crews directly through the CrewAI Enterprise web interf
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="Connecting GitHub to CrewAI Enterprise">
|
||||
<Step title="Connecting GitHub to CrewAI AMP">
|
||||
|
||||
1. Log in to [CrewAI Enterprise](https://app.crewai.com)
|
||||
1. Log in to [CrewAI AMP](https://app.crewai.com)
|
||||
2. Click on the button "Connect GitHub"
|
||||
|
||||
<Frame>
|
||||
@@ -192,7 +190,7 @@ You can also deploy your crews directly through the CrewAI Enterprise web interf
|
||||
## ⚠️ Environment Variable Security Requirements
|
||||
|
||||
<Warning>
|
||||
**Important**: CrewAI Enterprise has security restrictions on environment variable names that can cause deployment failures if not followed.
|
||||
**Important**: CrewAI AMP has security restrictions on environment variable names that can cause deployment failures if not followed.
|
||||
</Warning>
|
||||
|
||||
### Blocked Environment Variable Patterns
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
---
|
||||
title: "Enable Crew Studio"
|
||||
description: "Enabling Crew Studio on CrewAI Enterprise"
|
||||
description: "Enabling Crew Studio on CrewAI AMP"
|
||||
icon: "comments"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
<Tip>
|
||||
Crew Studio is a powerful **no-code/low-code** tool that allows you to quickly scaffold or build Crews through a conversational interface.
|
||||
Crew Studio is a powerful **no-code/low-code** tool that allows you to quickly scaffold or build Crews through a conversational interface.
|
||||
</Tip>
|
||||
|
||||
## What is Crew Studio?
|
||||
|
||||
Crew Studio is an innovative way to create AI agent crews without writing code.
|
||||
Crew Studio is an innovative way to create AI agent crews without writing code.
|
||||
|
||||
<Frame>
|
||||

|
||||
@@ -23,7 +24,7 @@ With Crew Studio, you can:
|
||||
- Select appropriate tools
|
||||
- Configure necessary inputs
|
||||
- Generate downloadable code for customization
|
||||
- Deploy directly to the CrewAI Enterprise platform
|
||||
- Deploy directly to the CrewAI AMP platform
|
||||
|
||||
## Configuration Steps
|
||||
|
||||
@@ -31,14 +32,14 @@ Before you can start using Crew Studio, you need to configure your LLM connectio
|
||||
|
||||
<Steps>
|
||||
<Step title="Set Up LLM Connection">
|
||||
Go to the **LLM Connections** tab in your CrewAI Enterprise dashboard and create a new LLM connection.
|
||||
Go to the **LLM Connections** tab in your CrewAI AMP dashboard and create a new LLM connection.
|
||||
|
||||
<Note>
|
||||
Feel free to use any LLM provider you want that is supported by CrewAI.
|
||||
</Note>
|
||||
|
||||
|
||||
Configure your LLM connection:
|
||||
|
||||
|
||||
- Enter a `Connection Name` (e.g., `OpenAI`)
|
||||
- Select your model provider: `openai` or `azure`
|
||||
- Select models you'd like to use in your Studio-generated Crews
|
||||
@@ -47,28 +48,28 @@ Before you can start using Crew Studio, you need to configure your LLM connectio
|
||||
- For OpenAI: Add `OPENAI_API_KEY` with your API key
|
||||
- For Azure OpenAI: Refer to [this article](https://blog.crewai.com/configuring-azure-openai-with-crewai-a-comprehensive-guide/) for configuration details
|
||||
- Click `Add Connection` to save your configuration
|
||||
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
</Step>
|
||||
|
||||
|
||||
<Step title="Verify Connection Added">
|
||||
Once you complete the setup, you'll see your new connection added to the list of available connections.
|
||||
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
</Step>
|
||||
|
||||
|
||||
<Step title="Configure LLM Defaults">
|
||||
In the main menu, go to **Settings → Defaults** and configure the LLM Defaults settings:
|
||||
|
||||
|
||||
- Select default models for agents and other components
|
||||
- Set default configurations for Crew Studio
|
||||
|
||||
|
||||
Click `Save Settings` to apply your changes.
|
||||
|
||||
|
||||
<Frame>
|
||||

|
||||
</Frame>
|
||||
@@ -81,38 +82,38 @@ Now that you've configured your LLM connection and default settings, you're read
|
||||
|
||||
<Steps>
|
||||
<Step title="Access Studio">
|
||||
Navigate to the **Studio** section in your CrewAI Enterprise dashboard.
|
||||
Navigate to the **Studio** section in your CrewAI AMP dashboard.
|
||||
</Step>
|
||||
|
||||
|
||||
<Step title="Start a Conversation">
|
||||
Start a conversation with the Crew Assistant by describing the problem you want to solve:
|
||||
|
||||
|
||||
```md
|
||||
I need a crew that can research the latest AI developments and create a summary report.
|
||||
```
|
||||
|
||||
|
||||
The Crew Assistant will ask clarifying questions to better understand your requirements.
|
||||
</Step>
|
||||
|
||||
|
||||
<Step title="Review Generated Crew">
|
||||
Review the generated crew configuration, including:
|
||||
|
||||
|
||||
- Agents and their roles
|
||||
- Tasks to be performed
|
||||
- Required inputs
|
||||
- Tools to be used
|
||||
|
||||
|
||||
This is your opportunity to refine the configuration before proceeding.
|
||||
</Step>
|
||||
|
||||
|
||||
<Step title="Deploy or Download">
|
||||
Once you're satisfied with the configuration, you can:
|
||||
|
||||
|
||||
- Download the generated code for local customization
|
||||
- Deploy the crew directly to the CrewAI Enterprise platform
|
||||
- Deploy the crew directly to the CrewAI AMP platform
|
||||
- Modify the configuration and regenerate the crew
|
||||
</Step>
|
||||
|
||||
|
||||
<Step title="Test Your Crew">
|
||||
After deployment, test your crew with sample inputs to ensure it performs as expected.
|
||||
</Step>
|
||||
@@ -129,38 +130,37 @@ Here's a typical workflow for creating a crew with Crew Studio:
|
||||
<Steps>
|
||||
<Step title="Describe Your Problem">
|
||||
Start by describing your problem:
|
||||
|
||||
|
||||
```md
|
||||
I need a crew that can analyze financial news and provide investment recommendations
|
||||
```
|
||||
</Step>
|
||||
|
||||
|
||||
<Step title="Answer Questions">
|
||||
Respond to clarifying questions from the Crew Assistant to refine your requirements.
|
||||
</Step>
|
||||
|
||||
|
||||
<Step title="Review the Plan">
|
||||
Review the generated crew plan, which might include:
|
||||
|
||||
|
||||
- A Research Agent to gather financial news
|
||||
- An Analysis Agent to interpret the data
|
||||
- A Recommendations Agent to provide investment advice
|
||||
</Step>
|
||||
|
||||
|
||||
<Step title="Approve or Modify">
|
||||
Approve the plan or request changes if necessary.
|
||||
</Step>
|
||||
|
||||
|
||||
<Step title="Download or Deploy">
|
||||
Download the code for customization or deploy directly to the platform.
|
||||
</Step>
|
||||
|
||||
|
||||
<Step title="Test and Refine">
|
||||
Test your crew with sample inputs and refine as needed.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with Crew Studio or any other CrewAI Enterprise features.
|
||||
Contact our support team for assistance with Crew Studio or any other CrewAI AMP features.
|
||||
</Card>
|
||||
|
||||
|
||||
85
docs/en/enterprise/guides/gmail-trigger.mdx
Normal file
85
docs/en/enterprise/guides/gmail-trigger.mdx
Normal file
@@ -0,0 +1,85 @@
|
||||
---
|
||||
title: "Gmail Trigger"
|
||||
description: "Trigger automations when Gmail events occur (e.g., new emails, labels)."
|
||||
icon: "envelope"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Use the Gmail Trigger to kick off your deployed crews when Gmail events happen in connected accounts, such as receiving a new email or messages matching a label/filter.
|
||||
|
||||
<Tip>
|
||||
Make sure Gmail is connected in Tools & Integrations and the trigger is enabled for your deployment.
|
||||
</Tip>
|
||||
|
||||
## Enabling the Gmail Trigger
|
||||
|
||||
1. Open your deployment in CrewAI AMP
|
||||
2. Go to the **Triggers** tab
|
||||
3. Locate **Gmail** and switch the toggle to enable
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/trigger-selected.png" alt="Enable or disable triggers with toggle" />
|
||||
</Frame>
|
||||
|
||||
## Example: Process new emails
|
||||
|
||||
When a new email arrives, the Gmail Trigger will send the payload to your Crew or Flow. Below is a Crew example that parses and processes the trigger payload.
|
||||
|
||||
```python
|
||||
@CrewBase
|
||||
class GmailProcessingCrew:
|
||||
@agent
|
||||
def parser(self) -> Agent:
|
||||
return Agent(
|
||||
config=self.agents_config['parser'],
|
||||
)
|
||||
|
||||
@task
|
||||
def parse_gmail_payload(self) -> Task:
|
||||
return Task(
|
||||
config=self.tasks_config['parse_gmail_payload'],
|
||||
agent=self.parser(),
|
||||
)
|
||||
|
||||
@task
|
||||
def act_on_email(self) -> Task:
|
||||
return Task(
|
||||
config=self.tasks_config['act_on_email'],
|
||||
agent=self.parser(),
|
||||
)
|
||||
```
|
||||
|
||||
The Gmail payload will be available via the standard context mechanisms. See the payload samples repository for structure and fields.
|
||||
|
||||
### Sample payloads & crews
|
||||
|
||||
The [CrewAI AMP Trigger Examples repository](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/gmail) includes:
|
||||
|
||||
- `new-email-payload-1.json` / `new-email-payload-2.json` — production-style new message alerts with matching crews in `new-email-crew.py`
|
||||
- `thread-updated-sample-1.json` — follow-up messages on an existing thread, processed by `gmail-alert-crew.py`
|
||||
|
||||
Use these samples to validate your parsing logic locally before wiring the trigger to your live Gmail accounts.
|
||||
|
||||
## Monitoring Executions
|
||||
|
||||
Track history and performance of triggered runs:
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/list-executions.png" alt="List of executions triggered by automation" />
|
||||
</Frame>
|
||||
|
||||
## Payload Reference
|
||||
|
||||
See the sample payloads and field descriptions:
|
||||
|
||||
<Card title="Gmail samples in Trigger Examples Repo" href="https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/gmail" icon="envelopes-bulk">
|
||||
Gmail samples in Trigger Examples Repo
|
||||
</Card>
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- Ensure Gmail is connected in Tools & Integrations
|
||||
- Verify the Gmail Trigger is enabled on the Triggers tab
|
||||
- Check the execution logs and confirm the payload is passed as `crewai_trigger_payload`
|
||||
65
docs/en/enterprise/guides/google-calendar-trigger.mdx
Normal file
65
docs/en/enterprise/guides/google-calendar-trigger.mdx
Normal file
@@ -0,0 +1,65 @@
|
||||
---
|
||||
title: "Google Calendar Trigger"
|
||||
description: "Kick off crews when Google Calendar events are created, updated, or cancelled"
|
||||
icon: "calendar"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Use the Google Calendar trigger to launch automations whenever calendar events change. Common use cases include briefing a team before a meeting, notifying stakeholders when a critical event is cancelled, or summarizing daily schedules.
|
||||
|
||||
<Tip>
|
||||
Make sure Google Calendar is connected in **Tools & Integrations** and enabled for the deployment you want to automate.
|
||||
</Tip>
|
||||
|
||||
## Enabling the Google Calendar Trigger
|
||||
|
||||
1. Open your deployment in CrewAI AMP
|
||||
2. Go to the **Triggers** tab
|
||||
3. Locate **Google Calendar** and switch the toggle to enable
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/calendar-trigger.png" alt="Enable or disable triggers with toggle" />
|
||||
</Frame>
|
||||
|
||||
## Example: Summarize meeting details
|
||||
|
||||
The snippet below mirrors the `calendar-event-crew.py` example in the trigger repository. It parses the payload, analyses the attendees and timing, and produces a meeting brief for downstream tools.
|
||||
|
||||
```python
|
||||
from calendar_event_crew import GoogleCalendarEventTrigger
|
||||
|
||||
crew = GoogleCalendarEventTrigger().crew()
|
||||
result = crew.kickoff({
|
||||
"crewai_trigger_payload": calendar_payload,
|
||||
})
|
||||
print(result.raw)
|
||||
```
|
||||
|
||||
Use `crewai_trigger_payload` exactly as it is delivered by the trigger so the crew can extract the proper fields.
|
||||
|
||||
## Sample payloads & crews
|
||||
|
||||
The [Google Calendar examples](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/google_calendar) show how to handle multiple event types:
|
||||
|
||||
- `new-event.json` → standard event creation handled by `calendar-event-crew.py`
|
||||
- `event-updated.json` / `event-started.json` / `event-ended.json` → in-flight updates processed by `calendar-meeting-crew.py`
|
||||
- `event-canceled.json` → cancellation workflow that alerts attendees via `calendar-meeting-crew.py`
|
||||
- Working location events use `calendar-working-location-crew.py` to extract on-site schedules
|
||||
|
||||
Each crew transforms raw event metadata (attendees, rooms, working locations) into the summaries your teams need.
|
||||
|
||||
## Monitoring Executions
|
||||
|
||||
The **Executions** list in the deployment dashboard tracks every triggered run and surfaces payload metadata, output summaries, and errors.
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/list-executions.png" alt="List of executions triggered by automation" />
|
||||
</Frame>
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- Ensure the correct Google account is connected and the trigger is enabled
|
||||
- Confirm your workflow handles all-day events (payloads use `start.date` and `end.date` instead of timestamps)
|
||||
- Check execution logs if reminders or attendee arrays are missing—calendar permissions can limit fields in the payload
|
||||
61
docs/en/enterprise/guides/google-drive-trigger.mdx
Normal file
61
docs/en/enterprise/guides/google-drive-trigger.mdx
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
title: "Google Drive Trigger"
|
||||
description: "Respond to Google Drive file events with automated crews"
|
||||
icon: "folder"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Trigger your automations when files are created, updated, or removed in Google Drive. Typical workflows include summarizing newly uploaded content, enforcing sharing policies, or notifying owners when critical files change.
|
||||
|
||||
<Tip>
|
||||
Connect Google Drive in **Tools & Integrations** and confirm the trigger is enabled for the automation you want to monitor.
|
||||
</Tip>
|
||||
|
||||
## Enabling the Google Drive Trigger
|
||||
|
||||
1. Open your deployment in CrewAI AMP
|
||||
2. Go to the **Triggers** tab
|
||||
3. Locate **Google Drive** and switch the toggle to enable
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/gdrive-trigger.png" alt="Enable or disable triggers with toggle" />
|
||||
</Frame>
|
||||
|
||||
## Example: Summarize file activity
|
||||
|
||||
The drive example crews parse the payload to extract file metadata, evaluate permissions, and publish a summary.
|
||||
|
||||
```python
|
||||
from drive_file_crew import GoogleDriveFileTrigger
|
||||
|
||||
crew = GoogleDriveFileTrigger().crew()
|
||||
crew.kickoff({
|
||||
"crewai_trigger_payload": drive_payload,
|
||||
})
|
||||
```
|
||||
|
||||
## Sample payloads & crews
|
||||
|
||||
Explore the [Google Drive examples](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/google_drive) to cover different operations:
|
||||
|
||||
- `new-file.json` → new uploads processed by `drive-file-crew.py`
|
||||
- `updated-file.json` → file edits and metadata changes handled by `drive-file-crew.py`
|
||||
- `deleted-file.json` → deletion events routed through `drive-file-deletion-crew.py`
|
||||
|
||||
Each crew highlights the file name, operation type, owner, permissions, and security considerations so downstream systems can respond appropriately.
|
||||
|
||||
## Monitoring Executions
|
||||
|
||||
Track history and performance of triggered runs with the **Executions** list in the deployment dashboard.
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/list-executions.png" alt="List of executions triggered by automation" />
|
||||
</Frame>
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- Verify Google Drive is connected and the trigger toggle is enabled
|
||||
- If a payload is missing permission data, ensure the connected account has access to the file or folder
|
||||
- The trigger sends file IDs only; use the Drive API if you need to fetch binary content during the crew run
|
||||
@@ -2,24 +2,25 @@
|
||||
title: "HubSpot Trigger"
|
||||
description: "Trigger CrewAI crews directly from HubSpot Workflows"
|
||||
icon: "hubspot"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
This guide provides a step-by-step process to set up HubSpot triggers for CrewAI Enterprise, enabling you to initiate crews directly from HubSpot Workflows.
|
||||
This guide provides a step-by-step process to set up HubSpot triggers for CrewAI AMP, enabling you to initiate crews directly from HubSpot Workflows.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- A CrewAI Enterprise account
|
||||
- A CrewAI AMP account
|
||||
- A HubSpot account with the [HubSpot Workflows](https://knowledge.hubspot.com/workflows/create-workflows) feature
|
||||
|
||||
## Setup Steps
|
||||
|
||||
<Steps>
|
||||
<Step title="Connect your HubSpot account with CrewAI Enterprise">
|
||||
- Log in to your `CrewAI Enterprise account > Triggers`
|
||||
<Step title="Connect your HubSpot account with CrewAI AMP">
|
||||
- Log in to your `CrewAI AMP account > Triggers`
|
||||
- Select `HubSpot` from the list of available triggers
|
||||
- Choose the HubSpot account you want to connect with CrewAI Enterprise
|
||||
- Follow the on-screen prompts to authorize CrewAI Enterprise access to your HubSpot account
|
||||
- A confirmation message will appear once HubSpot is successfully connected with CrewAI Enterprise
|
||||
- Choose the HubSpot account you want to connect with CrewAI AMP
|
||||
- Follow the on-screen prompts to authorize CrewAI AMP access to your HubSpot account
|
||||
- A confirmation message will appear once HubSpot is successfully connected with CrewAI AMP
|
||||
</Step>
|
||||
<Step title="Create a HubSpot Workflow">
|
||||
- Log in to your `HubSpot account > Automations > Workflows > New workflow`
|
||||
@@ -50,4 +51,14 @@ This guide provides a step-by-step process to set up HubSpot triggers for CrewAI
|
||||
|
||||
## Additional Resources
|
||||
|
||||
For more detailed information on available actions and customization options, refer to the [HubSpot Workflows Documentation](https://knowledge.hubspot.com/workflows/create-workflows).
|
||||
### Sample payloads & crews
|
||||
|
||||
You can jump-start development with the [HubSpot examples in the trigger repository](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/hubspot):
|
||||
|
||||
- `record-created-contact.json`, `record-updated-contact.json` → contact lifecycle events handled by `hubspot-contact-crew.py`
|
||||
- `record-created-company.json`, `record-updated-company.json` → company enrichment flows in `hubspot-company-crew.py`
|
||||
- `record-created-deals.json`, `record-updated-deals.json` → deal pipeline automation in `hubspot-record-crew.py`
|
||||
|
||||
Each crew demonstrates how to parse HubSpot record fields, enrich context, and return structured insights.
|
||||
|
||||
For more detailed information on available actions and customization options, refer to the [HubSpot Workflows Documentation](https://knowledge.hubspot.com/workflows/create-workflows).
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: "HITL Workflows"
|
||||
description: "Learn how to implement Human-In-The-Loop workflows in CrewAI for enhanced decision-making"
|
||||
icon: "user-check"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
Human-In-The-Loop (HITL) is a powerful approach that combines artificial intelligence with human expertise to enhance decision-making and improve task outcomes. This guide shows you how to implement HITL within CrewAI.
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
---
|
||||
title: "Kickoff Crew"
|
||||
description: "Kickoff a Crew on CrewAI Enterprise"
|
||||
description: "Kickoff a Crew on CrewAI AMP"
|
||||
icon: "flag-checkered"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Once you've deployed your crew to the CrewAI Enterprise platform, you can kickoff executions through the web interface or the API. This guide covers both approaches.
|
||||
Once you've deployed your crew to the CrewAI AMP platform, you can kickoff executions through the web interface or the API. This guide covers both approaches.
|
||||
|
||||
## Method 1: Using the Web Interface
|
||||
|
||||
### Step 1: Navigate to Your Deployed Crew
|
||||
|
||||
1. Log in to [CrewAI Enterprise](https://app.crewai.com)
|
||||
1. Log in to [CrewAI AMP](https://app.crewai.com)
|
||||
2. Click on the crew name from your projects list
|
||||
3. You'll be taken to the crew's detail page
|
||||
|
||||
@@ -82,7 +83,7 @@ Once execution is complete:
|
||||
|
||||
## Method 2: Using the API
|
||||
|
||||
You can also kickoff crews programmatically using the CrewAI Enterprise REST API.
|
||||
You can also kickoff crews programmatically using the CrewAI AMP REST API.
|
||||
|
||||
### Authentication
|
||||
|
||||
@@ -183,4 +184,3 @@ If an execution fails:
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with execution issues or questions about the Enterprise platform.
|
||||
</Card>
|
||||
|
||||
|
||||
52
docs/en/enterprise/guides/microsoft-teams-trigger.mdx
Normal file
52
docs/en/enterprise/guides/microsoft-teams-trigger.mdx
Normal file
@@ -0,0 +1,52 @@
|
||||
---
|
||||
title: "Microsoft Teams Trigger"
|
||||
description: "Kick off crews from Microsoft Teams chat activity"
|
||||
icon: "microsoft"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Use the Microsoft Teams trigger to start automations whenever a new chat is created. Common patterns include summarizing inbound requests, routing urgent messages to support teams, or creating follow-up tasks in other systems.
|
||||
|
||||
<Tip>
|
||||
Confirm Microsoft Teams is connected under **Tools & Integrations** and enabled in the **Triggers** tab for your deployment.
|
||||
</Tip>
|
||||
|
||||
## Enabling the Microsoft Teams Trigger
|
||||
|
||||
1. Open your deployment in CrewAI AMP
|
||||
2. Go to the **Triggers** tab
|
||||
3. Locate **Microsoft Teams** and switch the toggle to enable
|
||||
|
||||
<Frame caption="Microsoft Teams trigger connection">
|
||||
<img src="/images/enterprise/msteams-trigger.png" alt="Enable or disable triggers with toggle" />
|
||||
</Frame>
|
||||
|
||||
## Example: Summarize a new chat thread
|
||||
|
||||
```python
|
||||
from teams_chat_created_crew import MicrosoftTeamsChatTrigger
|
||||
|
||||
crew = MicrosoftTeamsChatTrigger().crew()
|
||||
result = crew.kickoff({
|
||||
"crewai_trigger_payload": teams_payload,
|
||||
})
|
||||
print(result.raw)
|
||||
```
|
||||
|
||||
The crew parses thread metadata (subject, created time, roster) and generates an action plan for the receiving team.
|
||||
|
||||
## Sample payloads & crews
|
||||
|
||||
The [Microsoft Teams examples](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/microsoft-teams) include:
|
||||
|
||||
- `chat-created.json` → chat creation payload processed by `teams-chat-created-crew.py`
|
||||
|
||||
The crew demonstrates how to extract participants, initial messages, tenant information, and compliance metadata from the Microsoft Graph webhook payload.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- Ensure the Teams connection is active; it must be refreshed if the tenant revokes permissions
|
||||
- Confirm the webhook subscription in Microsoft 365 is still valid if payloads stop arriving
|
||||
- Review execution logs for payload shape mismatches—Graph notifications may omit fields when a chat is private or restricted
|
||||
53
docs/en/enterprise/guides/onedrive-trigger.mdx
Normal file
53
docs/en/enterprise/guides/onedrive-trigger.mdx
Normal file
@@ -0,0 +1,53 @@
|
||||
---
|
||||
title: "OneDrive Trigger"
|
||||
description: "Automate responses to OneDrive file activity"
|
||||
icon: "cloud"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Start automations when files change inside OneDrive. You can generate audit summaries, notify security teams about external sharing, or update downstream line-of-business systems with new document metadata.
|
||||
|
||||
<Tip>
|
||||
Connect OneDrive in **Tools & Integrations** and toggle the trigger on for your deployment.
|
||||
</Tip>
|
||||
|
||||
## Enabling the OneDrive Trigger
|
||||
|
||||
1. Open your deployment in CrewAI AMP
|
||||
2. Go to the **Triggers** tab
|
||||
3. Locate **OneDrive** and switch the toggle to enable
|
||||
|
||||
<Frame caption="Microsoft OneDrive trigger connection">
|
||||
<img src="/images/enterprise/onedrive-trigger.png" alt="Enable or disable triggers with toggle" />
|
||||
</Frame>
|
||||
|
||||
## Example: Audit file permissions
|
||||
|
||||
```python
|
||||
from onedrive_file_crew import OneDriveFileTrigger
|
||||
|
||||
crew = OneDriveFileTrigger().crew()
|
||||
crew.kickoff({
|
||||
"crewai_trigger_payload": onedrive_payload,
|
||||
})
|
||||
```
|
||||
|
||||
The crew inspects file metadata, user activity, and permission changes to produce a compliance-friendly summary.
|
||||
|
||||
## Sample payloads & crews
|
||||
|
||||
The [OneDrive examples](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/onedrive) showcase how to:
|
||||
|
||||
- Parse file metadata, size, and folder paths
|
||||
- Track who created and last modified the file
|
||||
- Highlight permission and external sharing changes
|
||||
|
||||
`onedrive-file-crew.py` bundles the analysis and summarization tasks so you can add remediation steps as needed.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- Ensure the connected account has permission to read the file metadata included in the webhook
|
||||
- If the trigger fires but the payload is missing `permissions`, confirm the site-level sharing settings allow Graph to return this field
|
||||
- For large tenants, filter notifications upstream so the crew only runs on relevant directories
|
||||
52
docs/en/enterprise/guides/outlook-trigger.mdx
Normal file
52
docs/en/enterprise/guides/outlook-trigger.mdx
Normal file
@@ -0,0 +1,52 @@
|
||||
---
|
||||
title: "Outlook Trigger"
|
||||
description: "Launch automations from Outlook emails and calendar updates"
|
||||
icon: "microsoft"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Automate responses when Outlook delivers a new message or when an event is removed from the calendar. Teams commonly route escalations, file tickets, or alert attendees of cancellations.
|
||||
|
||||
<Tip>
|
||||
Connect Outlook in **Tools & Integrations** and ensure the trigger is enabled for your deployment.
|
||||
</Tip>
|
||||
|
||||
## Enabling the Outlook Trigger
|
||||
|
||||
1. Open your deployment in CrewAI AMP
|
||||
2. Go to the **Triggers** tab
|
||||
3. Locate **Outlook** and switch the toggle to enable
|
||||
|
||||
<Frame caption="Microsoft Outlook trigger connection">
|
||||
<img src="/images/enterprise/outlook-trigger.png" alt="Enable or disable triggers with toggle" />
|
||||
</Frame>
|
||||
|
||||
## Example: Summarize a new email
|
||||
|
||||
```python
|
||||
from outlook_message_crew import OutlookMessageTrigger
|
||||
|
||||
crew = OutlookMessageTrigger().crew()
|
||||
crew.kickoff({
|
||||
"crewai_trigger_payload": outlook_payload,
|
||||
})
|
||||
```
|
||||
|
||||
The crew extracts sender details, subject, body preview, and attachments before generating a structured response.
|
||||
|
||||
## Sample payloads & crews
|
||||
|
||||
Review the [Outlook examples](https://github.com/crewAIInc/crewai-enterprise-trigger-examples/tree/main/outlook) for two common scenarios:
|
||||
|
||||
- `new-message.json` → new mail notifications parsed by `outlook-message-crew.py`
|
||||
- `event-removed.json` → calendar cleanup handled by `outlook-event-removal-crew.py`
|
||||
|
||||
Each crew demonstrates how to handle Microsoft Graph payloads, normalize headers, and keep humans in-the-loop with concise summaries.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- Verify the Outlook connector is still authorized; the subscription must be renewed periodically
|
||||
- If attachments are missing, confirm the webhook subscription includes the `includeResourceData` flag
|
||||
- Review execution logs when events fail to match—cancellation payloads lack attendee lists by design and the crew should account for that
|
||||
@@ -1,10 +1,11 @@
|
||||
---
|
||||
title: "React Component Export"
|
||||
description: "Learn how to export and integrate CrewAI Enterprise React components into your applications"
|
||||
description: "Learn how to export and integrate CrewAI AMP React components into your applications"
|
||||
icon: "react"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
This guide explains how to export CrewAI Enterprise crews as React components and integrate them into your own applications.
|
||||
This guide explains how to export CrewAI AMP crews as React components and integrate them into your own applications.
|
||||
|
||||
## Exporting a React Component
|
||||
|
||||
@@ -37,7 +38,7 @@ To run this React component locally, you'll need to set up a React development e
|
||||
npx create-react-app my-crew-app
|
||||
```
|
||||
- Change into the project directory:
|
||||
|
||||
|
||||
```bash
|
||||
cd my-crew-app
|
||||
```
|
||||
@@ -76,7 +77,7 @@ To run this React component locally, you'll need to set up a React development e
|
||||
|
||||
<Step title="Start the development server">
|
||||
- In your project directory, run:
|
||||
|
||||
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
@@ -100,4 +101,4 @@ You can then customise the `CrewLead.jsx` to add color, title etc
|
||||
- Customize the component styling to match your application's design
|
||||
- Add additional props for configuration
|
||||
- Integrate with your application's state management
|
||||
- Add error handling and loading states
|
||||
- Add error handling and loading states
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
title: "Salesforce Trigger"
|
||||
description: "Trigger CrewAI crews from Salesforce workflows for CRM automation"
|
||||
icon: "salesforce"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
CrewAI Enterprise can be triggered from Salesforce to automate customer relationship management workflows and enhance your sales operations.
|
||||
CrewAI AMP can be triggered from Salesforce to automate customer relationship management workflows and enhance your sales operations.
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -17,15 +18,20 @@ Salesforce is a leading customer relationship management (CRM) platform that hel
|
||||
|
||||
## Demo
|
||||
|
||||
<Frame>
|
||||
<iframe width="100%" height="400" src="https://www.youtube.com/embed/oJunVqjjfu4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
</Frame>
|
||||
<iframe
|
||||
className="w-full aspect-video rounded-xl"
|
||||
src="https://www.youtube.com/embed/oJunVqjjfu4"
|
||||
title="CrewAI + Salesforce trigger demo"
|
||||
frameBorder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowFullScreen
|
||||
></iframe>
|
||||
|
||||
## Getting Started
|
||||
|
||||
To set up Salesforce triggers:
|
||||
|
||||
1. **Contact Support**: Reach out to CrewAI Enterprise support for assistance with Salesforce trigger setup
|
||||
1. **Contact Support**: Reach out to CrewAI AMP support for assistance with Salesforce trigger setup
|
||||
2. **Review Requirements**: Ensure you have the necessary Salesforce permissions and API access
|
||||
3. **Configure Connection**: Work with the support team to establish the connection between CrewAI and your Salesforce instance
|
||||
4. **Test Triggers**: Verify the triggers work correctly with your specific use cases
|
||||
@@ -41,4 +47,4 @@ Common Salesforce + CrewAI trigger scenarios include:
|
||||
|
||||
## Next Steps
|
||||
|
||||
For detailed setup instructions and advanced configuration options, please contact CrewAI Enterprise support who can provide tailored guidance for your specific Salesforce environment and business needs.
|
||||
For detailed setup instructions and advanced configuration options, please contact CrewAI AMP support who can provide tailored guidance for your specific Salesforce environment and business needs.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: "Slack Trigger"
|
||||
description: "Trigger CrewAI crews directly from Slack using slash commands"
|
||||
icon: "slack"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
This guide explains how to start a crew directly from Slack using CrewAI triggers.
|
||||
|
||||
@@ -1,26 +1,27 @@
|
||||
---
|
||||
title: "Team Management"
|
||||
description: "Learn how to invite and manage team members in your CrewAI Enterprise organization"
|
||||
description: "Learn how to invite and manage team members in your CrewAI AMP organization"
|
||||
icon: "users"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
As an administrator of a CrewAI Enterprise account, you can easily invite new team members to join your organization. This guide will walk you through the process step-by-step.
|
||||
As an administrator of a CrewAI AMP account, you can easily invite new team members to join your organization. This guide will walk you through the process step-by-step.
|
||||
|
||||
## Inviting Team Members
|
||||
|
||||
<Steps>
|
||||
<Step title="Access the Settings Page">
|
||||
- Log in to your CrewAI Enterprise account
|
||||
- Log in to your CrewAI AMP account
|
||||
- Look for the gear icon (⚙️) in the top right corner of the dashboard
|
||||
- Click on the gear icon to access the **Settings** page:
|
||||
<Frame>
|
||||
<Frame caption="Settings page">
|
||||
<img src="/images/enterprise/settings-page.png" alt="Settings Page" />
|
||||
</Frame>
|
||||
</Step>
|
||||
<Step title="Navigate to the Members Section">
|
||||
- On the Settings page, you'll see a `Members` tab
|
||||
- Click on the `Members` tab to access the **Members** page:
|
||||
<Frame>
|
||||
<Frame caption="Members tab">
|
||||
<img src="/images/enterprise/members-tab.png" alt="Members Tab" />
|
||||
</Frame>
|
||||
</Step>
|
||||
@@ -42,7 +43,7 @@ You can add roles to your team members to control their access to different part
|
||||
|
||||
<Steps>
|
||||
<Step title="Access the Settings Page">
|
||||
- Log in to your CrewAI Enterprise account
|
||||
- Log in to your CrewAI AMP account
|
||||
- Look for the gear icon (⚙️) in the top right corner of the dashboard
|
||||
- Click on the gear icon to access the **Settings** page:
|
||||
<Frame>
|
||||
@@ -84,4 +85,4 @@ You can add roles to your team members to control their access to different part
|
||||
- **Invitation Acceptance**: Invited members will need to accept the invitation to join your organization
|
||||
- **Email Notifications**: You may want to inform your team members to check their email (including spam folders) for the invitation
|
||||
|
||||
By following these steps, you can easily expand your team and collaborate more effectively within your CrewAI Enterprise organization.
|
||||
By following these steps, you can easily expand your team and collaborate more effectively within your CrewAI AMP organization.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Tool Repository
|
||||
description: "Using the Tool Repository to manage your tools"
|
||||
icon: "toolbox"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -19,11 +20,11 @@ The repository is not a version control system. Use Git to track code changes an
|
||||
|
||||
Before using the Tool Repository, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account
|
||||
- A [CrewAI AMP](https://app.crewai.com) account
|
||||
- [CrewAI CLI](https://docs.crewai.com/concepts/cli#cli) installed
|
||||
- uv>=0.5.0 installed. Check out [how to upgrade](https://docs.astral.sh/uv/getting-started/installation/#upgrading-uv)
|
||||
- [Git](https://git-scm.com) installed and configured
|
||||
- Access permissions to publish or install tools in your CrewAI Enterprise organization
|
||||
- Access permissions to publish or install tools in your CrewAI AMP organization
|
||||
|
||||
## Installing Tools
|
||||
|
||||
@@ -35,6 +36,52 @@ crewai tool install <tool-name>
|
||||
|
||||
This installs the tool and adds it to `pyproject.toml`.
|
||||
|
||||
You can use the tool by importing it and adding it to your agents:
|
||||
|
||||
```python
|
||||
from your_tool.tool import YourTool
|
||||
|
||||
custom_tool = YourTool()
|
||||
|
||||
researcher = Agent(
|
||||
role='Market Research Analyst',
|
||||
goal='Provide up-to-date market analysis of the AI industry',
|
||||
backstory='An expert analyst with a keen eye for market trends.',
|
||||
tools=[custom_tool],
|
||||
verbose=True
|
||||
)
|
||||
```
|
||||
|
||||
## Adding other packages after installing a tool
|
||||
|
||||
After installing a tool from the CrewAI AMP Tool Repository, you need to use the `crewai uv` command to add other packages to your project.
|
||||
Using pure `uv` commands will fail due to authentication to tool repository being handled by the CLI. By using the `crewai uv` command, you can add other packages to your project without having to worry about authentication.
|
||||
Any `uv` command can be used with the `crewai uv` command, making it a powerful tool for managing your project's dependencies without the hassle of managing authentication through environment variables or other methods.
|
||||
|
||||
Say that you have installed a custom tool from the CrewAI AMP Tool Repository called "my-tool":
|
||||
|
||||
```bash
|
||||
crewai tool install my-tool
|
||||
```
|
||||
|
||||
And now you want to add another package to your project, you can use the following command:
|
||||
|
||||
```bash
|
||||
crewai uv add requests
|
||||
```
|
||||
|
||||
Other commands like `uv sync` or `uv remove` can also be used with the `crewai uv` command:
|
||||
|
||||
```bash
|
||||
crewai uv sync
|
||||
```
|
||||
|
||||
```bash
|
||||
crewai uv remove requests
|
||||
```
|
||||
|
||||
This will add the package to your project and update `pyproject.toml` accordingly.
|
||||
|
||||
## Creating and Publishing Tools
|
||||
|
||||
To create a new tool project:
|
||||
@@ -84,7 +131,7 @@ crewai tool publish
|
||||
|
||||
To delete a tool:
|
||||
|
||||
1. Go to [CrewAI Enterprise](https://app.crewai.com)
|
||||
1. Go to [CrewAI AMP](https://app.crewai.com)
|
||||
2. Navigate to **Tools**
|
||||
3. Select the tool
|
||||
4. Click **Delete**
|
||||
@@ -95,13 +142,14 @@ Deletion is permanent. Deleted tools cannot be restored or re-installed.
|
||||
|
||||
## Security Checks
|
||||
|
||||
Every published version undergoes automated security checks, and are only available to install after they pass.
|
||||
Every published version undergoes automated security checks, and are only available to install after they pass.
|
||||
|
||||
You can check the security check status of a tool at:
|
||||
|
||||
`CrewAI Enterprise > Tools > Your Tool > Versions`
|
||||
|
||||
`CrewAI AMP > Tools > Your Tool > Versions`
|
||||
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with API integration or troubleshooting.
|
||||
</Card>
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
---
|
||||
title: "Update Crew"
|
||||
description: "Updating a Crew on CrewAI Enterprise"
|
||||
description: "Updating a Crew on CrewAI AMP"
|
||||
icon: "pencil"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
<Note>
|
||||
After deploying your crew to CrewAI Enterprise, you may need to make updates to the code, security settings, or configuration.
|
||||
After deploying your crew to CrewAI AMP, you may need to make updates to the code, security settings, or configuration.
|
||||
This guide explains how to perform these common update operations.
|
||||
</Note>
|
||||
|
||||
@@ -22,7 +23,7 @@ There are several reasons you might want to update your crew deployment:
|
||||
|
||||
When you've pushed new commits to your GitHub repository and want to update your deployment:
|
||||
|
||||
1. Navigate to your crew in the CrewAI Enterprise platform
|
||||
1. Navigate to your crew in the CrewAI AMP platform
|
||||
2. Click on the `Re-deploy` button on your crew details page
|
||||
|
||||
<Frame>
|
||||
@@ -35,7 +36,7 @@ This will trigger an update that you can track using the progress bar. The syste
|
||||
|
||||
If you need to generate a new bearer token (for example, if you suspect the current token might have been compromised):
|
||||
|
||||
1. Navigate to your crew in the CrewAI Enterprise platform
|
||||
1. Navigate to your crew in the CrewAI AMP platform
|
||||
2. Find the `Bearer Token` section
|
||||
3. Click the `Reset` button next to your current token
|
||||
|
||||
@@ -86,4 +87,3 @@ If you encounter any issues after updating, you can view deployment logs in the
|
||||
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
||||
Contact our support team for assistance with updating your crew or troubleshooting deployment issues.
|
||||
</Card>
|
||||
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
---
|
||||
title: "Webhook Automation"
|
||||
description: "Automate CrewAI Enterprise workflows using webhooks with platforms like ActivePieces, Zapier, and Make.com"
|
||||
description: "Automate CrewAI AMP workflows using webhooks with platforms like ActivePieces, Zapier, and Make.com"
|
||||
icon: "webhook"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
CrewAI Enterprise allows you to automate your workflow using webhooks. This article will guide you through the process of setting up and using webhooks to kickoff your crew execution, with a focus on integration with ActivePieces, a workflow automation platform similar to Zapier and Make.com.
|
||||
CrewAI AMP allows you to automate your workflow using webhooks. This article will guide you through the process of setting up and using webhooks to kickoff your crew execution, with a focus on integration with ActivePieces, a workflow automation platform similar to Zapier and Make.com.
|
||||
|
||||
## Setting Up Webhooks
|
||||
|
||||
<Steps>
|
||||
<Step title="Accessing the Kickoff Interface">
|
||||
- Navigate to the CrewAI Enterprise dashboard
|
||||
- Navigate to the CrewAI AMP dashboard
|
||||
- Look for the `/kickoff` section, which is used to start the crew execution
|
||||
<Frame>
|
||||
<img src="/images/enterprise/kickoff-interface.png" alt="Kickoff Interface" />
|
||||
@@ -43,7 +44,7 @@ CrewAI Enterprise allows you to automate your workflow using webhooks. This arti
|
||||
3. Add an HTTP action step
|
||||
- Set the action to `Send HTTP request`
|
||||
- Use `POST` as the method
|
||||
- Set the URL to your CrewAI Enterprise kickoff endpoint
|
||||
- Set the URL to your CrewAI AMP kickoff endpoint
|
||||
- Add necessary headers (e.g., `Bearer Token`)
|
||||
<Frame>
|
||||
<img src="/images/enterprise/activepieces-headers.png" alt="ActivePieces Headers" />
|
||||
@@ -58,7 +59,7 @@ CrewAI Enterprise allows you to automate your workflow using webhooks. This arti
|
||||
</Step>
|
||||
|
||||
<Step title="Setting Up the Webhook">
|
||||
1. Create a new flow in ActivePieces and name it
|
||||
1. Create a new flow in ActivePieces and name it
|
||||
<Frame>
|
||||
<img src="/images/enterprise/activepieces-flow.png" alt="ActivePieces Flow" />
|
||||
</Frame>
|
||||
@@ -79,14 +80,24 @@ CrewAI Enterprise allows you to automate your workflow using webhooks. This arti
|
||||
|
||||
## Webhook Output Examples
|
||||
|
||||
**Note:** Any `meta` object provided in your kickoff request will be included in all webhook payloads, allowing you to track requests and maintain context across the entire crew execution lifecycle.
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Step Webhook">
|
||||
`stepWebhookUrl` - Callback that will be executed upon each agent inner thought
|
||||
|
||||
```json
|
||||
{
|
||||
"action": "**Preliminary Research Report on the Financial Industry for crewai Enterprise Solution**\n1. Industry Overview and Trends\nThe financial industry in ....\nConclusion:\nThe financial industry presents a fertile ground for implementing AI solutions like crewai, particularly in areas such as digital customer engagement, risk management, and regulatory compliance. Further engagement with the lead is recommended to better tailor the crewai solution to their specific needs and scale.",
|
||||
"task_id": "97eba64f-958c-40a0-b61c-625fe635a3c0"
|
||||
"prompt": "Research the financial industry for potential AI solutions",
|
||||
"thought": "I need to conduct preliminary research on the financial industry",
|
||||
"tool": "research_tool",
|
||||
"tool_input": "financial industry AI solutions",
|
||||
"result": "**Preliminary Research Report on the Financial Industry for crewai Enterprise Solution**\n1. Industry Overview and Trends\nThe financial industry in ....\nConclusion:\nThe financial industry presents a fertile ground for implementing AI solutions like crewai, particularly in areas such as digital customer engagement, risk management, and regulatory compliance. Further engagement with the lead is recommended to better tailor the crewai solution to their specific needs and scale.",
|
||||
"kickoff_id": "97eba64f-958c-40a0-b61c-625fe635a3c0",
|
||||
"meta": {
|
||||
"requestId": "travel-req-123",
|
||||
"source": "web-app"
|
||||
}
|
||||
}
|
||||
```
|
||||
</Tab>
|
||||
@@ -95,8 +106,21 @@ CrewAI Enterprise allows you to automate your workflow using webhooks. This arti
|
||||
|
||||
```json
|
||||
{
|
||||
"description": "Using the information gathered from the lead's data, conduct preliminary research on the lead's industry, company background, and potential use cases for crewai. Focus on finding relevant data that can aid in scoring the lead and planning a strategy to pitch them crewai.The financial industry presents a fertile ground for implementing AI solutions like crewai, particularly in areas such as digital customer engagement, risk management, and regulatory compliance. Further engagement with the lead is recommended to better tailor the crewai solution to their specific needs and scale.",
|
||||
"task_id": "97eba64f-958c-40a0-b61c-625fe635a3c0"
|
||||
"description": "Using the information gathered from the lead's data, conduct preliminary research on the lead's industry, company background, and potential use cases for crewai. Focus on finding relevant data that can aid in scoring the lead and planning a strategy to pitch them crewai.",
|
||||
"name": "Industry Research Task",
|
||||
"expected_output": "Detailed research report on the financial industry",
|
||||
"summary": "The financial industry presents a fertile ground for implementing AI solutions like crewai, particularly in areas such as digital customer engagement, risk management, and regulatory compliance. Further engagement with the lead is recommended to better tailor the crewai solution to their specific needs and scale.",
|
||||
"agent": "Research Agent",
|
||||
"output": "**Preliminary Research Report on the Financial Industry for crewai Enterprise Solution**\n1. Industry Overview and Trends\nThe financial industry in ....\nConclusion:\nThe financial industry presents a fertile ground for implementing AI solutions like crewai, particularly in areas such as digital customer engagement, risk management, and regulatory compliance.",
|
||||
"output_json": {
|
||||
"industry": "financial",
|
||||
"key_opportunities": ["digital customer engagement", "risk management", "regulatory compliance"]
|
||||
},
|
||||
"kickoff_id": "97eba64f-958c-40a0-b61c-625fe635a3c0",
|
||||
"meta": {
|
||||
"requestId": "travel-req-123",
|
||||
"source": "web-app"
|
||||
}
|
||||
}
|
||||
```
|
||||
</Tab>
|
||||
@@ -105,8 +129,9 @@ CrewAI Enterprise allows you to automate your workflow using webhooks. This arti
|
||||
|
||||
```json
|
||||
{
|
||||
"task_id": "97eba64f-958c-40a0-b61c-625fe635a3c0",
|
||||
"result": {
|
||||
"kickoff_id": "97eba64f-958c-40a0-b61c-625fe635a3c0",
|
||||
"result": "**Final Analysis Report**\n\nLead Score: Customer service enhancement and compliance are particularly relevant.\n\nTalking Points:\n- Highlight how crewai's AI solutions can transform customer service\n- Discuss crewai's potential for sustainability goals\n- Emphasize compliance capabilities\n- Stress adaptability for various operation scales",
|
||||
"result_json": {
|
||||
"lead_score": "Customer service enhancement, and compliance are particularly relevant.",
|
||||
"talking_points": [
|
||||
"Highlight how crewai's AI solutions can transform customer service with automated, personalized experiences and 24/7 support, improving both customer satisfaction and operational efficiency.",
|
||||
@@ -114,8 +139,17 @@ CrewAI Enterprise allows you to automate your workflow using webhooks. This arti
|
||||
"Emphasize crewai's ability to enhance compliance with evolving regulations through efficient data processing and reporting, reducing the risk of non-compliance penalties.",
|
||||
"Stress the adaptability of crewai to support both extensive multinational operations and smaller, targeted projects, ensuring the solution grows with the institution's needs."
|
||||
]
|
||||
},
|
||||
"token_usage": {
|
||||
"total_tokens": 1250,
|
||||
"prompt_tokens": 800,
|
||||
"completion_tokens": 450
|
||||
},
|
||||
"meta": {
|
||||
"requestId": "travel-req-123",
|
||||
"source": "web-app"
|
||||
}
|
||||
}
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
</Tabs>
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
title: "Zapier Trigger"
|
||||
description: "Trigger CrewAI crews from Zapier workflows to automate cross-app workflows"
|
||||
icon: "bolt"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
This guide will walk you through the process of setting up Zapier triggers for CrewAI Enterprise, allowing you to automate workflows between CrewAI Enterprise and other applications.
|
||||
This guide will walk you through the process of setting up Zapier triggers for CrewAI AMP, allowing you to automate workflows between CrewAI AMP and other applications.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- A CrewAI Enterprise account
|
||||
- A CrewAI AMP account
|
||||
- A Zapier account
|
||||
- A Slack account (for this specific example)
|
||||
|
||||
@@ -31,7 +32,7 @@ This guide will walk you through the process of setting up Zapier triggers for C
|
||||
- Connect your Slack account if you haven't already.
|
||||
</Step>
|
||||
|
||||
<Step title="Configure the CrewAI Enterprise Action">
|
||||
<Step title="Configure the CrewAI AMP Action">
|
||||
- Add a new action step to your Zap.
|
||||
- Choose CrewAI+ as your action app and Kickoff as the Action Event
|
||||
|
||||
@@ -40,8 +41,8 @@ This guide will walk you through the process of setting up Zapier triggers for C
|
||||
</Frame>
|
||||
</Step>
|
||||
|
||||
<Step title="Connect your CrewAI Enterprise account">
|
||||
- Connect your CrewAI Enterprise account.
|
||||
<Step title="Connect your CrewAI AMP account">
|
||||
- Connect your CrewAI AMP account.
|
||||
- Select the appropriate Crew for your workflow.
|
||||
|
||||
<Frame>
|
||||
@@ -50,8 +51,8 @@ This guide will walk you through the process of setting up Zapier triggers for C
|
||||
- Configure the inputs for the Crew using the data from the Slack message.
|
||||
</Step>
|
||||
|
||||
<Step title="Format the CrewAI Enterprise Output">
|
||||
- Add another action step to format the text output from CrewAI Enterprise.
|
||||
<Step title="Format the CrewAI AMP Output">
|
||||
- Add another action step to format the text output from CrewAI AMP.
|
||||
- Use Zapier's formatting tools to convert the Markdown output to HTML.
|
||||
|
||||
<Frame>
|
||||
@@ -66,7 +67,7 @@ This guide will walk you through the process of setting up Zapier triggers for C
|
||||
- Add a final action step to send the formatted output via email.
|
||||
- Choose your preferred email service (e.g., Gmail, Outlook).
|
||||
- Configure the email details, including recipient, subject, and body.
|
||||
- Insert the formatted CrewAI Enterprise output into the email body.
|
||||
- Insert the formatted CrewAI AMP output into the email body.
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/zapier-7.png" alt="Zapier 7" />
|
||||
@@ -96,8 +97,8 @@ This guide will walk you through the process of setting up Zapier triggers for C
|
||||
|
||||
## Tips for Success
|
||||
|
||||
- Ensure that your CrewAI Enterprise inputs are correctly mapped from the Slack message.
|
||||
- Ensure that your CrewAI AMP inputs are correctly mapped from the Slack message.
|
||||
- Test your Zap thoroughly before turning it on to catch any potential issues.
|
||||
- Consider adding error handling steps to manage potential failures in the workflow.
|
||||
|
||||
By following these steps, you'll have successfully set up Zapier triggers for CrewAI Enterprise, allowing for automated workflows triggered by Slack messages and resulting in email notifications with CrewAI Enterprise output.
|
||||
By following these steps, you'll have successfully set up Zapier triggers for CrewAI AMP, allowing for automated workflows triggered by Slack messages and resulting in email notifications with CrewAI AMP output.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Asana Integration
|
||||
description: "Team task and project coordination with Asana integration for CrewAI."
|
||||
icon: "circle"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -12,7 +13,7 @@ Enable your agents to manage tasks, projects, and team coordination through Asan
|
||||
|
||||
Before using the Asana integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A [CrewAI AMP](https://app.crewai.com) account with an active subscription
|
||||
- An Asana account with appropriate permissions
|
||||
- Connected your Asana account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
|
||||
@@ -20,7 +21,7 @@ Before using the Asana integration, ensure you have:
|
||||
|
||||
### 1. Connect Your Asana Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
1. Navigate to [CrewAI AMP Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **Asana** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for task and project management
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Box Integration
|
||||
description: "File storage and document management with Box integration for CrewAI."
|
||||
icon: "box"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -12,7 +13,7 @@ Enable your agents to manage files, folders, and documents through Box. Upload f
|
||||
|
||||
Before using the Box integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A [CrewAI AMP](https://app.crewai.com) account with an active subscription
|
||||
- A Box account with appropriate permissions
|
||||
- Connected your Box account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
|
||||
@@ -20,7 +21,7 @@ Before using the Box integration, ensure you have:
|
||||
|
||||
### 1. Connect Your Box Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
1. Navigate to [CrewAI AMP Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **Box** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for file and folder management
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: ClickUp Integration
|
||||
description: "Task and productivity management with ClickUp integration for CrewAI."
|
||||
icon: "list-check"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -12,7 +13,7 @@ Enable your agents to manage tasks, projects, and productivity workflows through
|
||||
|
||||
Before using the ClickUp integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A [CrewAI AMP](https://app.crewai.com) account with an active subscription
|
||||
- A ClickUp account with appropriate permissions
|
||||
- Connected your ClickUp account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
|
||||
@@ -20,7 +21,7 @@ Before using the ClickUp integration, ensure you have:
|
||||
|
||||
### 1. Connect Your ClickUp Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
1. Navigate to [CrewAI AMP Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **ClickUp** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for task and project management
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: GitHub Integration
|
||||
description: "Repository and issue management with GitHub integration for CrewAI."
|
||||
icon: "github"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -12,7 +13,7 @@ Enable your agents to manage repositories, issues, and releases through GitHub.
|
||||
|
||||
Before using the GitHub integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A [CrewAI AMP](https://app.crewai.com) account with an active subscription
|
||||
- A GitHub account with appropriate repository permissions
|
||||
- Connected your GitHub account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
|
||||
@@ -20,7 +21,7 @@ Before using the GitHub integration, ensure you have:
|
||||
|
||||
### 1. Connect Your GitHub Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
1. Navigate to [CrewAI AMP Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **GitHub** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for repository and issue management
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Gmail Integration
|
||||
description: "Email and contact management with Gmail integration for CrewAI."
|
||||
icon: "envelope"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -12,7 +13,7 @@ Enable your agents to manage emails, contacts, and drafts through Gmail. Send em
|
||||
|
||||
Before using the Gmail integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A [CrewAI AMP](https://app.crewai.com) account with an active subscription
|
||||
- A Gmail account with appropriate permissions
|
||||
- Connected your Gmail account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
|
||||
@@ -20,7 +21,7 @@ Before using the Gmail integration, ensure you have:
|
||||
|
||||
### 1. Connect Your Gmail Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
1. Navigate to [CrewAI AMP Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **Gmail** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for email and contact management
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Google Calendar Integration
|
||||
description: "Event and schedule management with Google Calendar integration for CrewAI."
|
||||
icon: "calendar"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -12,7 +13,7 @@ Enable your agents to manage calendar events, schedules, and availability throug
|
||||
|
||||
Before using the Google Calendar integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A [CrewAI AMP](https://app.crewai.com) account with an active subscription
|
||||
- A Google account with Google Calendar access
|
||||
- Connected your Google account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
|
||||
@@ -20,7 +21,7 @@ Before using the Google Calendar integration, ensure you have:
|
||||
|
||||
### 1. Connect Your Google Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
1. Navigate to [CrewAI AMP Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **Google Calendar** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for calendar and contact access
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Google Sheets Integration
|
||||
description: "Spreadsheet data synchronization with Google Sheets integration for CrewAI."
|
||||
icon: "google"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -12,7 +13,7 @@ Enable your agents to manage spreadsheet data through Google Sheets. Read rows,
|
||||
|
||||
Before using the Google Sheets integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A [CrewAI AMP](https://app.crewai.com) account with an active subscription
|
||||
- A Google account with Google Sheets access
|
||||
- Connected your Google account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
- Spreadsheets with proper column headers for data operations
|
||||
@@ -21,7 +22,7 @@ Before using the Google Sheets integration, ensure you have:
|
||||
|
||||
### 1. Connect Your Google Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
1. Navigate to [CrewAI AMP Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **Google Sheets** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for spreadsheet access
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: "HubSpot Integration"
|
||||
description: "Manage companies and contacts in HubSpot with CrewAI."
|
||||
icon: "briefcase"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -12,7 +13,7 @@ Enable your agents to manage companies and contacts within HubSpot. Create new r
|
||||
|
||||
Before using the HubSpot integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription.
|
||||
- A [CrewAI AMP](https://app.crewai.com) account with an active subscription.
|
||||
- A HubSpot account with appropriate permissions.
|
||||
- Connected your HubSpot account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors).
|
||||
|
||||
@@ -20,7 +21,7 @@ Before using the HubSpot integration, ensure you have:
|
||||
|
||||
### 1. Connect Your HubSpot Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors).
|
||||
1. Navigate to [CrewAI AMP Integrations](https://app.crewai.com/crewai_plus/connectors).
|
||||
2. Find **HubSpot** in the Authentication Integrations section.
|
||||
3. Click **Connect** and complete the OAuth flow.
|
||||
4. Grant the necessary permissions for company and contact management.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Jira Integration
|
||||
description: "Issue tracking and project management with Jira integration for CrewAI."
|
||||
icon: "bug"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -12,7 +13,7 @@ Enable your agents to manage issues, projects, and workflows through Jira. Creat
|
||||
|
||||
Before using the Jira integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A [CrewAI AMP](https://app.crewai.com) account with an active subscription
|
||||
- A Jira account with appropriate project permissions
|
||||
- Connected your Jira account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
|
||||
@@ -20,7 +21,7 @@ Before using the Jira integration, ensure you have:
|
||||
|
||||
### 1. Connect Your Jira Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
1. Navigate to [CrewAI AMP Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **Jira** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for issue and project management
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Linear Integration
|
||||
description: "Software project and bug tracking with Linear integration for CrewAI."
|
||||
icon: "list-check"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -12,7 +13,7 @@ Enable your agents to manage issues, projects, and development workflows through
|
||||
|
||||
Before using the Linear integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A [CrewAI AMP](https://app.crewai.com) account with an active subscription
|
||||
- A Linear account with appropriate workspace permissions
|
||||
- Connected your Linear account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
|
||||
@@ -20,7 +21,7 @@ Before using the Linear integration, ensure you have:
|
||||
|
||||
### 1. Connect Your Linear Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
1. Navigate to [CrewAI AMP Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **Linear** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for issue and project management
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Notion Integration
|
||||
description: "Page and database management with Notion integration for CrewAI."
|
||||
icon: "book"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -12,7 +13,7 @@ Enable your agents to manage pages, databases, and content through Notion. Creat
|
||||
|
||||
Before using the Notion integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A [CrewAI AMP](https://app.crewai.com) account with an active subscription
|
||||
- A Notion account with appropriate workspace permissions
|
||||
- Connected your Notion account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
||||
|
||||
@@ -20,7 +21,7 @@ Before using the Notion integration, ensure you have:
|
||||
|
||||
### 1. Connect Your Notion Account
|
||||
|
||||
1. Navigate to [CrewAI Enterprise Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
1. Navigate to [CrewAI AMP Integrations](https://app.crewai.com/crewai_plus/connectors)
|
||||
2. Find **Notion** in the Authentication Integrations section
|
||||
3. Click **Connect** and complete the OAuth flow
|
||||
4. Grant the necessary permissions for page and database management
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Salesforce Integration
|
||||
description: "CRM and sales automation with Salesforce integration for CrewAI."
|
||||
icon: "salesforce"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -12,7 +13,7 @@ Enable your agents to manage customer relationships, sales processes, and data t
|
||||
|
||||
Before using the Salesforce integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A [CrewAI AMP](https://app.crewai.com) account with an active subscription
|
||||
- A Salesforce account with appropriate permissions
|
||||
- Connected your Salesforce account through the [Integrations page](https://app.crewai.com/integrations)
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Shopify Integration
|
||||
description: "E-commerce and online store management with Shopify integration for CrewAI."
|
||||
icon: "shopify"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -12,7 +13,7 @@ Enable your agents to manage e-commerce operations through Shopify. Handle custo
|
||||
|
||||
Before using the Shopify integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A [CrewAI AMP](https://app.crewai.com) account with an active subscription
|
||||
- A Shopify store with appropriate admin permissions
|
||||
- Connected your Shopify store through the [Integrations page](https://app.crewai.com/integrations)
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Slack Integration
|
||||
description: "Team communication and collaboration with Slack integration for CrewAI."
|
||||
icon: "slack"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -12,7 +13,7 @@ Enable your agents to manage team communication through Slack. Send messages, se
|
||||
|
||||
Before using the Slack integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A [CrewAI AMP](https://app.crewai.com) account with an active subscription
|
||||
- A Slack workspace with appropriate permissions
|
||||
- Connected your Slack workspace through the [Integrations page](https://app.crewai.com/integrations)
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Stripe Integration
|
||||
description: "Payment processing and subscription management with Stripe integration for CrewAI."
|
||||
icon: "stripe"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -12,7 +13,7 @@ Enable your agents to manage payments, subscriptions, and customer billing throu
|
||||
|
||||
Before using the Stripe integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A [CrewAI AMP](https://app.crewai.com) account with an active subscription
|
||||
- A Stripe account with appropriate API permissions
|
||||
- Connected your Stripe account through the [Integrations page](https://app.crewai.com/integrations)
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Zendesk Integration
|
||||
description: "Customer support and helpdesk management with Zendesk integration for CrewAI."
|
||||
icon: "headset"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -12,7 +13,7 @@ Enable your agents to manage customer support operations through Zendesk. Create
|
||||
|
||||
Before using the Zendesk integration, ensure you have:
|
||||
|
||||
- A [CrewAI Enterprise](https://app.crewai.com) account with an active subscription
|
||||
- A [CrewAI AMP](https://app.crewai.com) account with an active subscription
|
||||
- A Zendesk account with appropriate API permissions
|
||||
- Connected your Zendesk account through the [Integrations page](https://app.crewai.com/integrations)
|
||||
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
---
|
||||
title: "CrewAI Enterprise"
|
||||
title: "CrewAI AMP"
|
||||
description: "Deploy, monitor, and scale your AI agent workflows"
|
||||
icon: "globe"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Introduction
|
||||
|
||||
CrewAI Enterprise provides a platform for deploying, monitoring, and scaling your crews and agents in a production environment.
|
||||
CrewAI AMP(Agent Management Platform) provides a platform for deploying, monitoring, and scaling your crews and agents in a production environment.
|
||||
|
||||
<Frame>
|
||||
<img src="/images/enterprise/crewai-enterprise-dashboard.png" alt="CrewAI Enterprise Dashboard" />
|
||||
<img src="/images/enterprise/crewai-enterprise-dashboard.png" alt="CrewAI AMP Dashboard" />
|
||||
</Frame>
|
||||
|
||||
CrewAI Enterprise extends the power of the open-source framework with features designed for production deployments, collaboration, and scalability. Deploy your crews to a managed infrastructure and monitor their execution in real-time.
|
||||
CrewAI AMP extends the power of the open-source framework with features designed for production deployments, collaboration, and scalability. Deploy your crews to a managed infrastructure and monitor their execution in real-time.
|
||||
|
||||
## Key Features
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
---
|
||||
title: FAQs
|
||||
description: "Frequently asked questions about CrewAI Enterprise"
|
||||
description: "Frequently asked questions about CrewAI AMP"
|
||||
icon: "circle-question"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
<AccordionGroup>
|
||||
@@ -128,15 +129,14 @@ icon: "circle-question"
|
||||
</Steps>
|
||||
|
||||
Here's a tutorial on how to consistently get structured outputs from your agents:
|
||||
<Frame>
|
||||
<iframe
|
||||
height="400"
|
||||
width="100%"
|
||||
src="https://www.youtube.com/embed/dNpKQk5uxHw"
|
||||
title="YouTube video player" frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowfullscreen></iframe>
|
||||
</Frame>
|
||||
<iframe
|
||||
className="w-full aspect-video rounded-xl"
|
||||
src="https://www.youtube.com/embed/dNpKQk5uxHw"
|
||||
title="Structured outputs in CrewAI"
|
||||
frameBorder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowFullScreen
|
||||
></iframe>
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="How can I create custom tools for my CrewAI agents?">
|
||||
|
||||
49
docs/en/examples/cookbooks.mdx
Normal file
49
docs/en/examples/cookbooks.mdx
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
title: CrewAI Cookbooks
|
||||
description: Feature-focused quickstarts and notebooks for learning patterns fast.
|
||||
icon: book
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Quickstarts & Demos
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Collaboration" icon="people-arrows" href="https://github.com/crewAIInc/crewAI-quickstarts/blob/main/Collaboration/crewai_collaboration.ipynb">
|
||||
Coordinate multiple agents on shared tasks. Includes notebook with end-to-end collaboration pattern.
|
||||
</Card>
|
||||
|
||||
<Card title="Planning" icon="timeline" href="https://github.com/crewAIInc/crewAI-quickstarts/blob/main/Planning/crewai_planning.ipynb">
|
||||
Teach agents to reason about multi-step plans before execution using the planning toolkit.
|
||||
</Card>
|
||||
|
||||
<Card title="Reasoning" icon="lightbulb" href="https://github.com/crewAIInc/crewAI-quickstarts/blob/main/Reasoning/crewai_reasoning.ipynb">
|
||||
Explore self-reflection loops, critique prompts, and structured thinking patterns.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Structured Guardrails" icon="shield-check" href="https://github.com/crewAIInc/crewAI-quickstarts/blob/main/Guardrails/task_guardrails.ipynb">
|
||||
Apply task-level guardrails with retries, validation functions, and safe fallbacks.
|
||||
</Card>
|
||||
|
||||
<Card title="Gemini Search & Grounding" icon="magnifying-glass" href="https://github.com/crewAIInc/crewAI-quickstarts/blob/main/Custom%20LLM/gemini_search_grounding_crewai.ipynb">
|
||||
Connect CrewAI to Gemini with search grounding for factual, citation-rich outputs.
|
||||
</Card>
|
||||
|
||||
<Card title="Gemini Video Summaries" icon="video" href="https://github.com/crewAIInc/crewAI-quickstarts/blob/main/Custom%20LLM/summarize_video_gemini_crewai.ipynb">
|
||||
Generate video recaps using Gemini multimodal LLM and CrewAI orchestration.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Browse Quickstarts" icon="bolt" href="https://github.com/crewAIInc/crewAI-quickstarts">
|
||||
View all notebooks and feature demos showcasing specific CrewAI capabilities.
|
||||
</Card>
|
||||
<Card title="Request a cookbook" icon="message-plus" href="https://community.crewai.com">
|
||||
Missing a pattern? Drop a request in the community forum and we’ll expand the library.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
<Tip>
|
||||
Use Cookbooks to learn a pattern quickly, then jump to Full Examples for production‑grade implementations.
|
||||
</Tip>
|
||||
@@ -1,62 +1,86 @@
|
||||
---
|
||||
title: CrewAI Examples
|
||||
description: A collection of examples that show how to use CrewAI framework to automate workflows.
|
||||
description: Explore curated examples organized by Crews, Flows, Integrations, and Notebooks.
|
||||
icon: rocket-launch
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Crews
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card
|
||||
title="Marketing Strategy"
|
||||
color="#F3A78B"
|
||||
href="https://github.com/crewAIInc/crewAI-examples/tree/main/marketing_strategy"
|
||||
icon="bullhorn"
|
||||
iconType="solid"
|
||||
>
|
||||
Automate marketing strategy creation with CrewAI.
|
||||
<Card title="Marketing Strategy" icon="bullhorn" href="https://github.com/crewAIInc/crewAI-examples/tree/main/crews/marketing_strategy">
|
||||
Multi‑agent marketing campaign planning.
|
||||
</Card>
|
||||
<Card title="Surprise Trip" icon="plane" href="https://github.com/crewAIInc/crewAI-examples/tree/main/crews/surprise_trip">
|
||||
Personalized surprise travel planning.
|
||||
</Card>
|
||||
<Card title="Match Profile to Positions" icon="id-card" href="https://github.com/crewAIInc/crewAI-examples/tree/main/crews/match_profile_to_positions">
|
||||
CV‑to‑job matching with vector search.
|
||||
</Card>
|
||||
<Card title="Job Posting" icon="newspaper" href="https://github.com/crewAIInc/crewAI-examples/tree/main/crews/job-posting">
|
||||
Automated job description creation.
|
||||
</Card>
|
||||
<Card title="Game Builder Crew" icon="gamepad" href="https://github.com/crewAIInc/crewAI-examples/tree/main/crews/game-builder-crew">
|
||||
Multi‑agent team that designs and builds Python games.
|
||||
</Card>
|
||||
<Card title="Recruitment" icon="user-group" href="https://github.com/crewAIInc/crewAI-examples/tree/main/crews/recruitment">
|
||||
Candidate sourcing and evaluation.
|
||||
</Card>
|
||||
<Card title="Browse all Crews" icon="users" href="https://github.com/crewAIInc/crewAI-examples/tree/main/crews">
|
||||
See the full list of crew examples.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Flows
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Content Creator Flow" icon="pen" href="https://github.com/crewAIInc/crewAI-examples/tree/main/flows/content_creator_flow">
|
||||
Multi‑crew content generation with routing.
|
||||
</Card>
|
||||
<Card title="Email Auto Responder" icon="envelope" href="https://github.com/crewAIInc/crewAI-examples/tree/main/flows/email_auto_responder_flow">
|
||||
Automated email monitoring and replies.
|
||||
</Card>
|
||||
<Card title="Lead Score Flow" icon="chart-line" href="https://github.com/crewAIInc/crewAI-examples/tree/main/flows/lead_score_flow">
|
||||
Lead qualification with human‑in‑the‑loop.
|
||||
</Card>
|
||||
<Card title="Meeting Assistant Flow" icon="calendar" href="https://github.com/crewAIInc/crewAI-examples/tree/main/flows/meeting_assistant_flow">
|
||||
Notes processing with integrations.
|
||||
</Card>
|
||||
<Card title="Self Evaluation Loop" icon="rotate" href="https://github.com/crewAIInc/crewAI-examples/tree/main/flows/self_evaluation_loop_flow">
|
||||
Iterative self‑improvement workflows.
|
||||
</Card>
|
||||
<Card title="Write a Book (Flows)" icon="book" href="https://github.com/crewAIInc/crewAI-examples/tree/main/flows/write_a_book_with_flows">
|
||||
Parallel chapter generation.
|
||||
</Card>
|
||||
<Card title="Browse all Flows" icon="diagram-project" href="https://github.com/crewAIInc/crewAI-examples/tree/main/flows">
|
||||
See the full list of flow examples.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Integrations
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="CrewAI ↔ LangGraph" icon="link" href="https://github.com/crewAIInc/crewAI-examples/tree/main/integrations/crewai-langgraph">
|
||||
Integration with LangGraph framework.
|
||||
</Card>
|
||||
<Card title="Azure OpenAI" icon="cloud" href="https://github.com/crewAIInc/crewAI-examples/tree/main/integrations/azure_model">
|
||||
Using CrewAI with Azure OpenAI.
|
||||
</Card>
|
||||
<Card title="NVIDIA Models" icon="microchip" href="https://github.com/crewAIInc/crewAI-examples/tree/main/integrations/nvidia_models">
|
||||
NVIDIA ecosystem integrations.
|
||||
</Card>
|
||||
<Card title="Browse Integrations" icon="puzzle-piece" href="https://github.com/crewAIInc/crewAI-examples/tree/main/integrations">
|
||||
See all integration examples.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Notebooks
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Simple QA Crew + Flow" icon="book" href="https://github.com/crewAIInc/crewAI-examples/tree/main/Notebooks/Simple%20QA%20Crew%20%2B%20Flow">
|
||||
Simple QA Crew + Flow.
|
||||
</Card>
|
||||
<Card title="All Notebooks" icon="book" href="https://github.com/crewAIInc/crewAI-examples/tree/main/Notebooks">
|
||||
Interactive examples for learning and experimentation.
|
||||
</Card>
|
||||
<Card
|
||||
title="Surprise Trip"
|
||||
color="#F3A78B"
|
||||
href="https://github.com/crewAIInc/crewAI-examples/tree/main/surprise_trip"
|
||||
icon="plane"
|
||||
iconType="duotone"
|
||||
>
|
||||
Create a surprise trip itinerary with CrewAI.
|
||||
</Card>
|
||||
<Card
|
||||
title="Match Profile to Positions"
|
||||
color="#F3A78B"
|
||||
href="https://github.com/crewAIInc/crewAI-examples/tree/main/match_profile_to_positions"
|
||||
icon="linkedin"
|
||||
iconType="duotone"
|
||||
>
|
||||
Match a profile to jobpositions with CrewAI.
|
||||
</Card>
|
||||
<Card
|
||||
title="Create Job Posting"
|
||||
color="#F3A78B"
|
||||
href="https://github.com/crewAIInc/crewAI-examples/tree/main/job-posting"
|
||||
icon="newspaper"
|
||||
iconType="duotone"
|
||||
>
|
||||
Create a job posting with CrewAI.
|
||||
</Card>
|
||||
<Card
|
||||
title="Game Generator"
|
||||
color="#F3A78B"
|
||||
href="https://github.com/crewAIInc/crewAI-examples/tree/main/game-builder-crew"
|
||||
icon="gamepad"
|
||||
iconType="duotone"
|
||||
>
|
||||
Create a game with CrewAI.
|
||||
</Card>
|
||||
<Card
|
||||
title="Find Job Candidates"
|
||||
color="#F3A78B"
|
||||
href="https://github.com/crewAIInc/crewAI-examples/tree/main/recruitment"
|
||||
icon="user-group"
|
||||
iconType="duotone"
|
||||
>
|
||||
Find job candidates with CrewAI.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Customizing Prompts
|
||||
description: Dive deeper into low-level prompt customization for CrewAI, enabling super custom and complex use cases for different models and languages.
|
||||
icon: message-pen
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Why Customize Prompts?
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Fingerprinting
|
||||
description: Learn how to use CrewAI's fingerprinting system to uniquely identify and track components throughout their lifecycle.
|
||||
icon: fingerprint
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Crafting Effective Agents
|
||||
description: Learn best practices for designing powerful, specialized AI agents that collaborate effectively to solve complex problems.
|
||||
icon: robot
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## The Art and Science of Agent Design
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Evaluating Use Cases for CrewAI
|
||||
description: Learn how to assess your AI application needs and choose the right approach between Crews and Flows based on complexity and precision requirements.
|
||||
icon: scale-balanced
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Understanding the Decision Framework
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Build Your First Crew
|
||||
description: Step-by-step tutorial to create a collaborative AI team that works together to solve complex problems.
|
||||
icon: users-gear
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Unleashing the Power of Collaborative AI
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Build Your First Flow
|
||||
description: Learn how to create structured, event-driven workflows with precise control over execution.
|
||||
icon: diagram-project
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Taking Control of AI Workflows with Flows
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Mastering Flow State Management
|
||||
description: A comprehensive guide to managing, persisting, and leveraging state in CrewAI Flows for building robust AI applications.
|
||||
icon: diagram-project
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Understanding the Power of State in Flows
|
||||
@@ -348,6 +349,31 @@ class SelectivePersistFlow(Flow):
|
||||
|
||||
## Advanced State Patterns
|
||||
|
||||
### Conditional starts and resumable execution
|
||||
|
||||
Flows support conditional `@start()` and resumable execution for HITL/cyclic scenarios:
|
||||
|
||||
```python
|
||||
from crewai.flow.flow import Flow, start, listen, and_, or_
|
||||
|
||||
class ResumableFlow(Flow):
|
||||
@start() # unconditional start
|
||||
def init(self):
|
||||
...
|
||||
|
||||
# Conditional start: run after "init" or external trigger name
|
||||
@start("init")
|
||||
def maybe_begin(self):
|
||||
...
|
||||
|
||||
@listen(and_(init, maybe_begin))
|
||||
def proceed(self):
|
||||
...
|
||||
```
|
||||
|
||||
- Conditional `@start()` accepts a method name, a router label, or a callable condition.
|
||||
- During resume, listeners continue from prior checkpoints; cycle/router branches honor resumption flags.
|
||||
|
||||
### State-Based Conditional Logic
|
||||
|
||||
You can use state to implement complex conditional logic in your flows:
|
||||
|
||||
105
docs/en/index.mdx
Normal file
105
docs/en/index.mdx
Normal file
@@ -0,0 +1,105 @@
|
||||
---
|
||||
title: "CrewAI Documentation"
|
||||
description: "Build collaborative AI agents, crews, and flows — production ready from day one."
|
||||
icon: "house"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
gap: 20,
|
||||
textAlign: 'center',
|
||||
padding: '48px 24px',
|
||||
borderRadius: 16,
|
||||
background: 'linear-gradient(180deg, rgba(235,102,88,0.12) 0%, rgba(201,76,60,0.08) 100%)',
|
||||
border: '1px solid rgba(235,102,88,0.18)'
|
||||
}}
|
||||
>
|
||||
<img src="/images/crew_only_logo.png" alt="CrewAI" width="250" height="100" />
|
||||
<div style={{ maxWidth: 720 }}>
|
||||
<h1 style={{ marginBottom: 12 }}>Ship multi‑agent systems with confidence</h1>
|
||||
<p style={{ color: 'var(--mint-text-2)' }}>
|
||||
Design agents, orchestrate crews, and automate flows with guardrails, memory, knowledge, and observability baked in.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 12, justifyContent: 'center' }}>
|
||||
<a className="button button-primary" href="/en/quickstart">Get started</a>
|
||||
<a className="button" href="/en/changelog">View changelog</a>
|
||||
<a className="button" href="/en/api-reference/introduction">API Reference</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div style={{ marginTop: 32 }} />
|
||||
|
||||
## Get started
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Introduction" href="/en/introduction" icon="sparkles">
|
||||
Overview of CrewAI concepts, architecture, and what you can build with agents, crews, and flows.
|
||||
</Card>
|
||||
<Card title="Installation" href="/en/installation" icon="wrench">
|
||||
Install via `uv`, configure API keys, and set up the CLI for local development.
|
||||
</Card>
|
||||
<Card title="Quickstart" href="/en/quickstart" icon="rocket">
|
||||
Spin up your first crew in minutes. Learn the core runtime, project layout, and dev loop.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Build the basics
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Agents" href="/en/concepts/agents" icon="users">
|
||||
Compose agents with tools, memory, knowledge, and structured outputs using Pydantic. Includes templates and best practices.
|
||||
</Card>
|
||||
<Card title="Flows" href="/en/concepts/flows" icon="arrow-progress">
|
||||
Orchestrate start/listen/router steps, manage state, persist execution, and resume long-running workflows.
|
||||
</Card>
|
||||
<Card title="Tasks & Processes" href="/en/concepts/tasks" icon="check">
|
||||
Define sequential, hierarchical, or hybrid processes with guardrails, callbacks, and human-in-the-loop triggers.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Enterprise journey
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Deploy automations" href="/en/enterprise/features/automations" icon="server">
|
||||
Manage environments, redeploy safely, and monitor live runs directly from the Enterprise console.
|
||||
</Card>
|
||||
<Card title="Triggers & Flows" href="/en/enterprise/guides/automation-triggers" icon="bolt">
|
||||
Connect Gmail, Slack, Salesforce, and more. Pass trigger payloads into crews and flows automatically.
|
||||
</Card>
|
||||
<Card title="Team management" href="/en/enterprise/guides/team-management" icon="users-gear">
|
||||
Invite teammates, configure RBAC, and control access to production automations.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## What’s new
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Triggers overview" href="/en/enterprise/guides/automation-triggers" icon="sparkles">
|
||||
Unified overview for Gmail, Drive, Outlook, Teams, OneDrive, HubSpot, and more — now with sample payloads and crews.
|
||||
</Card>
|
||||
<Card title="Integration tools" href="/en/tools/integration/overview" icon="plug">
|
||||
Call existing CrewAI automations or Amazon Bedrock Agents directly from your crews using the updated integration toolkit.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
<Callout title="Explore real-world patterns" icon="github">
|
||||
Browse the <a href="/en/examples/cookbooks">examples and cookbooks</a> for end-to-end reference implementations across agents, flows, and enterprise automations.
|
||||
</Callout>
|
||||
|
||||
## Stay connected
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Star us on GitHub" href="https://github.com/crewAIInc/crewAI" icon="star">
|
||||
If CrewAI helps you ship faster, give us a star and share your builds with the community.
|
||||
</Card>
|
||||
<Card title="Join the community" href="https://community.crewai.com" icon="comments">
|
||||
Ask questions, showcase workflows, and request features alongside other builders.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -2,20 +2,19 @@
|
||||
title: Installation
|
||||
description: Get started with CrewAI - Install, configure, and build your first AI crew
|
||||
icon: wrench
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Video Tutorial
|
||||
Watch this video tutorial for a step-by-step demonstration of the installation process:
|
||||
|
||||
<iframe
|
||||
width="100%"
|
||||
height="400"
|
||||
className="w-full aspect-video rounded-xl"
|
||||
src="https://www.youtube.com/embed/-kSOTtYzgEw"
|
||||
title="CrewAI Installation Guide"
|
||||
frameborder="0"
|
||||
style={{ borderRadius: '10px' }}
|
||||
frameBorder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
allowfullscreen
|
||||
allowFullScreen
|
||||
></iframe>
|
||||
|
||||
## Text Tutorial
|
||||
@@ -30,6 +29,12 @@ Watch this video tutorial for a step-by-step demonstration of the installation p
|
||||
If you need to update Python, visit [python.org/downloads](https://python.org/downloads)
|
||||
</Note>
|
||||
|
||||
<Note>
|
||||
**OpenAI SDK Requirement**
|
||||
|
||||
CrewAI 0.175.0 requires `openai >= 1.13.3`. If you manage dependencies yourself, ensure your environment satisfies this constraint to avoid import/runtime issues.
|
||||
</Note>
|
||||
|
||||
CrewAI uses the `uv` as its dependency management and package handling tool. It simplifies project setup and execution, offering a seamless experience.
|
||||
|
||||
If you haven't installed `uv` yet, follow **step 1** to quickly get it set up on your system, else you can skip to **step 2**.
|
||||
@@ -162,7 +167,7 @@ We recommend using the `YAML` template scaffolding for a structured approach to
|
||||
<Note type="info">
|
||||
For teams and organizations, CrewAI offers enterprise deployment options that eliminate setup complexity:
|
||||
|
||||
### CrewAI Enterprise (SaaS)
|
||||
### CrewAI AMP (SaaS)
|
||||
- Zero installation required - just sign up for free at [app.crewai.com](https://app.crewai.com)
|
||||
- Automatic updates and maintenance
|
||||
- Managed infrastructure and scaling
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Introduction
|
||||
description: Build AI agent teams that work together to tackle complex tasks
|
||||
icon: handshake
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
# What is CrewAI?
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: Before and After Kickoff Hooks
|
||||
description: Learn how to use before and after kickoff hooks in CrewAI
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
CrewAI provides hooks that allow you to execute code before and after a crew's kickoff. These hooks are useful for preprocessing inputs or post-processing results.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Bring your own agent
|
||||
description: Learn how to bring your own agents that work within a Crew.
|
||||
icon: robots
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
Interoperability is a core concept in CrewAI. This guide will show you how to bring your own agents that work within a Crew.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Coding Agents
|
||||
description: Learn how to enable your CrewAI Agents to write and execute code, and explore advanced features for enhanced functionality.
|
||||
icon: rectangle-code
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Introduction
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user