mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 15:48:29 +00:00
* docs: Fix major memory system documentation issues - Remove misleading deprecation warnings, fix confusing comments, clearly separate three memory approaches, provide accurate examples that match implementation * fix: Correct broken image paths in README - Update crewai_logo.png and asset.png paths to point to docs/images/ directory instead of docs/ directly * docs: Add system prompt transparency and customization guide - Add 'Understanding Default System Instructions' section to address black-box concerns - Document what CrewAI automatically injects into prompts - Provide code examples to inspect complete system prompts - Show 3 methods to override default instructions - Include observability integration examples with Langfuse - Add best practices for production prompt management * docs: Fix implementation accuracy issues in memory documentation - Fix Ollama embedding URL parameter and remove unsupported Cohere input_type parameter * docs: Reference observability docs instead of showing specific tool examples * docs: Reorganize knowledge documentation for better developer experience - Move quickstart examples right after overview for immediate hands-on experience - Create logical learning progression: basics → configuration → advanced → troubleshooting - Add comprehensive agent vs crew knowledge guide with working examples - Consolidate debugging and troubleshooting in dedicated section - Organize best practices by topic in accordion format - Improve content flow from simple concepts to advanced features - Ensure all examples are grounded in actual codebase implementation * docs: enhance custom LLM documentation with comprehensive examples and accurate imports * docs: reorganize observability tools into dedicated section with comprehensive overview and improved navigation * docs: rename how-to section to learn and add comprehensive overview page * docs: finalize documentation reorganization and update navigation labels * docs: enhance README with comprehensive badges, navigation links, and getting started video
78 lines
2.8 KiB
Plaintext
78 lines
2.8 KiB
Plaintext
---
|
|
title: Replay Tasks from Latest Crew Kickoff
|
|
description: Replay tasks from the latest crew.kickoff(...)
|
|
icon: arrow-right
|
|
---
|
|
|
|
## Introduction
|
|
|
|
CrewAI provides the ability to replay from a task specified from the latest crew kickoff. This feature is particularly useful when you've finished a kickoff and may want to retry certain tasks or don't need to refetch data over and your agents already have the context saved from the kickoff execution so you just need to replay the tasks you want to.
|
|
|
|
<Note>
|
|
You must run `crew.kickoff()` before you can replay a task.
|
|
Currently, only the latest kickoff is supported, so if you use `kickoff_for_each`, it will only allow you to replay from the most recent crew run.
|
|
</Note>
|
|
|
|
Here's an example of how to replay from a task:
|
|
|
|
### Replaying from Specific Task Using the CLI
|
|
|
|
To use the replay feature, follow these steps:
|
|
|
|
<Steps>
|
|
<Step title="Open your terminal or command prompt."></Step>
|
|
<Step title="Navigate to the directory where your CrewAI project is located."></Step>
|
|
<Step title="Run the following commands:">
|
|
To view the latest kickoff task_ids use:
|
|
|
|
```shell
|
|
crewai log-tasks-outputs
|
|
```
|
|
|
|
Once you have your `task_id` to replay, use:
|
|
|
|
```shell
|
|
crewai replay -t <task_id>
|
|
```
|
|
</Step>
|
|
</Steps>
|
|
|
|
<Note>
|
|
Ensure `crewai` is installed and configured correctly in your development environment.
|
|
</Note>
|
|
|
|
### Replaying from a Task Programmatically
|
|
|
|
To replay from a task programmatically, use the following steps:
|
|
|
|
<Steps>
|
|
<Step title="Specify the `task_id` and input parameters for the replay process.">
|
|
Specify the `task_id` and input parameters for the replay process.
|
|
</Step>
|
|
<Step title="Execute the replay command within a try-except block to handle potential errors.">
|
|
Execute the replay command within a try-except block to handle potential errors.
|
|
<CodeGroup>
|
|
```python Code
|
|
def replay():
|
|
"""
|
|
Replay the crew execution from a specific task.
|
|
"""
|
|
task_id = '<task_id>'
|
|
inputs = {"topic": "CrewAI Training"} # This is optional; you can pass in the inputs you want to replay; otherwise, it uses the previous kickoff's inputs.
|
|
try:
|
|
YourCrewName_Crew().crew().replay(task_id=task_id, inputs=inputs)
|
|
|
|
except subprocess.CalledProcessError as e:
|
|
raise Exception(f"An error occurred while replaying the crew: {e}")
|
|
|
|
except Exception as e:
|
|
raise Exception(f"An unexpected error occurred: {e}")
|
|
```
|
|
</CodeGroup>
|
|
</Step>
|
|
</Steps>
|
|
|
|
## Conclusion
|
|
|
|
With the above enhancements and detailed functionality, replaying specific tasks in CrewAI has been made more efficient and robust.
|
|
Ensure you follow the commands and steps precisely to make the most of these features. |