You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/concepts/crews.mdx
+74-1Lines changed: 74 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,14 @@ A crew in crewAI represents a collaborative group of agents working together to
33
33
|**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. |
34
34
|**Planning LLM***(optional)*|`planning_llm`| The language model used by the AgentPlanner in a planning process. |
35
35
|**Knowledge Sources**_(optional)_|`knowledge_sources`| Knowledge sources available at the crew level, accessible to all the agents. |
36
-
|**Stream**_(optional)_|`stream`| Enable streaming output to receive real-time updates during crew execution. Returns a `CrewStreamingOutput` object that can be iterated for chunks. Defaults to `False`. |
36
+
|**Stream**_(optional)_|`stream`| Enable streaming output to receive real-time updates during crew execution. Returns a `CrewStreamingOutput` object that can be iterated for chunks. Defaults to `False`. |
37
+
|**Chat LLM**_(optional)_|`chat_llm`| The language model used to orchestrate `crewai chat` CLI interactions with the crew. Accepts a model name string or `LLM` instance. Defaults to `None`. |
38
+
|**Before Kickoff Callbacks**_(optional)_|`before_kickoff_callbacks`| A list of callable functions executed **before** the crew starts. Each callback receives and can modify the inputs dict. Distinct from the `@before_kickoff` decorator. Defaults to `[]`. |
39
+
|**After Kickoff Callbacks**_(optional)_|`after_kickoff_callbacks`| A list of callable functions executed **after** the crew finishes. Each callback receives and can modify the `CrewOutput`. Distinct from the `@after_kickoff` decorator. Defaults to `[]`. |
40
+
|**Tracing**_(optional)_|`tracing`| Controls OpenTelemetry tracing for the crew. `True` = always enable, `False` = always disable, `None` = inherit from environment / user settings. Defaults to `None`. |
41
+
|**Skills**_(optional)_|`skills`| A list of `Path` objects (skill search directories) or pre-loaded `Skill` objects applied to all agents in the crew. Defaults to `None`. |
42
+
|**Security Config**_(optional)_|`security_config`| A `SecurityConfig` instance managing crew fingerprinting and identity. Defaults to `SecurityConfig()`. |
43
+
|**Checkpoint**_(optional)_|`checkpoint`| Enables automatic checkpointing. Pass `True` for sensible defaults, a `CheckpointConfig` for full control, `False` to opt out, or `None` to inherit. See the [Checkpointing](#checkpointing) section below. Defaults to `None`. |
37
44
38
45
<Tip>
39
46
**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.
@@ -271,6 +278,72 @@ crew = Crew(output_log_file = file_name.json) # Logs will be saved as file_name
271
278
272
279
273
280
281
+
## Checkpointing
282
+
283
+
Checkpointing lets a crew automatically save its state after key events (e.g. task completion) so that long-running or interrupted runs can be resumed exactly where they left off without re-executing completed tasks.
284
+
285
+
### Quick Start
286
+
287
+
Pass `checkpoint=True` to enable checkpointing with sensible defaults (saves to `.checkpoints/` after every task):
288
+
289
+
```python Code
290
+
from crewai import Crew, Process
291
+
292
+
crew = Crew(
293
+
agents=[researcher, writer],
294
+
tasks=[research_task, write_task],
295
+
process=Process.sequential,
296
+
checkpoint=True, # saves to .checkpoints/ after every task
297
+
)
298
+
299
+
crew.kickoff(inputs={"topic": "AI trends"})
300
+
```
301
+
302
+
### Full Control with `CheckpointConfig`
303
+
304
+
Use `CheckpointConfig` for fine-grained control over location, trigger events, storage backend, and retention:
305
+
306
+
```python Code
307
+
from crewai import Crew, Process
308
+
from crewai.state.checkpoint_config import CheckpointConfig
309
+
310
+
crew = Crew(
311
+
agents=[researcher, writer],
312
+
tasks=[research_task, write_task],
313
+
process=Process.sequential,
314
+
checkpoint=CheckpointConfig(
315
+
location="./.checkpoints", # directory for JSON files (default)
316
+
on_events=["task_completed"], # trigger after each task (default)
317
+
max_checkpoints=5, # keep only the 5 most recent checkpoints
318
+
),
319
+
)
320
+
321
+
crew.kickoff(inputs={"topic": "AI trends"})
322
+
```
323
+
324
+
### Resuming from a Checkpoint
325
+
326
+
Use `Crew.from_checkpoint()` to restore a crew from a saved checkpoint file, then call `kickoff()` to resume:
When restoring from a checkpoint, `checkpoint_inputs`, `checkpoint_train`, and `checkpoint_kickoff_event_id` are automatically reconstructed — you do not need to set these manually.
|`max_checkpoints`|`int \| None`|`None`| Maximum checkpoints to keep. Oldest are pruned after each write. `None` keeps all. |
346
+
274
347
## Memory Utilization
275
348
276
349
Crews can utilize memory (short-term, long-term, and entity memory) to enhance their execution and learning over time. This feature allows crews to store and recall execution memories, aiding in decision-making and task execution strategies.
0 commit comments