docs: rewrite checkpoint explanation, drop classmethod resume how-to

This commit is contained in:
Greyson LaLonde
2026-05-22 22:44:13 +08:00
parent b8680efe2a
commit af65bdf58a
4 changed files with 8 additions and 56 deletions

View File

@@ -26,9 +26,9 @@ mode: "wide"
### ما هي نقطة الحفظ
نقطة الحفظ هي لقطة متسلسلة من `RuntimeState` تكتب في نقطة معينة من التنفيذ. تسجل أي المهام اكتملت ومخرجاتها والمدخلات الحالية ومعرف نسب يحدد التشغيل.
تلتقط نقطة الحفظ كل ما يحتاجه CrewAI لإعادة إنشاء تشغيل أثناء سيره: الحالة الكاملة للطاقم أو التدفق أو الوكيل — التكوين، وذاكرة الوكلاء ومصادر المعرفة، وتقدم المهام، والمخرجات الوسيطة — إلى جانب مدخلات الـ kickoff، وسجل الأحداث حتى تلك النقطة، ومعرف نسب يربط نقطة الحفظ بالتشغيل الذي جاءت منه.
عند الاستعادة من نقطة حفظ، يعيد CrewAI بناء تلك الحالة ويتخطى العمل المكتمل ويستمر. عند التفرع، يستعيد CrewAI الحالة تحت نسب جديد بحيث لا يتداخل الفرع الجديد مع التشغيل الأصلي.
الاستعادة تعيد بناء تلك الحالة وتستمر. تتخطى المهام المكتملة، وتعاد ترطيب الذاكرة والمعرفة، ويعمل العمل التابع على نفس المخرجات التي أنتجها التشغيل الأصلي. التفرع يجري نفس الاستعادة تحت نسب جديد، بحيث يكتب الفرع الجديد والتشغيل الأصلي نقاط الحفظ جنبا إلى جنب دون أن يطمس أحدهما الآخر.
### متى تكتب نقاط الحفظ
@@ -172,14 +172,6 @@ mode: "wide"
```
</Accordion>
<Accordion title="الاستئناف عبر classmethod" icon="rotate-left">
```python
config = CheckpointConfig(restore_from="./my_checkpoints/<file>.json")
crew = Crew.from_checkpoint(config)
result = crew.kickoff()
```
</Accordion>
<Accordion title="التفرع إلى فرع جديد" icon="code-branch">
`fork()` يستعيد نقطة حفظ تحت نسب جديد بحيث لا يتصادم التشغيل الجديد مع الأصلي.
@@ -226,10 +218,6 @@ mode: "wide"
),
)
result = flow.kickoff()
config = CheckpointConfig(restore_from="./flow_cp/<file>.json")
flow = MyFlow.from_checkpoint(config)
result = flow.kickoff()
```
</Tab>
<Tab title="Agent">

View File

@@ -26,9 +26,9 @@ Checkpointing saves a snapshot of execution state during a run so a crew, flow,
### What a checkpoint is
A checkpoint is a serialized snapshot of `RuntimeState` written at a point in execution. It records which tasks have completed, their outputs, the current inputs, and a lineage ID that identifies the run.
A checkpoint captures everything CrewAI needs to recreate a run mid-flight: the full state of the crew, flow, or agent — configuration, agent memory and knowledge sources, task progress, intermediate outputs — alongside the kickoff inputs, the event history up to that point, and a lineage ID that ties the checkpoint to the run it came from.
When you restore from a checkpoint, CrewAI rebuilds that state, skips already-completed work, and continues. When you fork from one, CrewAI restores the state under a new lineage so the new branch and the original run do not overwrite each other.
Restoring rebuilds that state and continues. Completed tasks are skipped, memory and knowledge are rehydrated, and downstream work runs against the same outputs the original run produced. Forking does the same restore under a new lineage, so the new branch and the original run can write checkpoints side by side without overwriting each other.
### When checkpoints are written
@@ -172,14 +172,6 @@ This walkthrough takes ~5 minutes. You will run a two-task crew, kill it midway,
```
</Accordion>
<Accordion title="Resume via the classmethod" icon="rotate-left">
```python
config = CheckpointConfig(restore_from="./my_checkpoints/<file>.json")
crew = Crew.from_checkpoint(config)
result = crew.kickoff()
```
</Accordion>
<Accordion title="Fork into a new branch" icon="code-branch">
`fork()` restores a checkpoint under a fresh lineage so the new run does not collide with the original.
@@ -226,10 +218,6 @@ This walkthrough takes ~5 minutes. You will run a two-task crew, kill it midway,
),
)
result = flow.kickoff()
config = CheckpointConfig(restore_from="./flow_cp/<file>.json")
flow = MyFlow.from_checkpoint(config)
result = flow.kickoff()
```
</Tab>
<Tab title="Agent">

View File

@@ -26,9 +26,9 @@ mode: "wide"
### 체크포인트란
체크포인트는 실행의 특정 시점에 기록된 `RuntimeState`의 직렬화된 스냅샷입니다. 어떤 태스크가 완료되었는지, 그 출력값, 현재 입력값, 그리고 실행을 식별하는 lineage ID를 기록합니다.
체크포인트는 실행 중인 작업을 재현하기 위해 CrewAI가 필요한 모든 것을 캡처합니다: 크루, 플로우 또는 에이전트의 전체 상태 — 구성, 에이전트의 메모리 및 지식 소스, 태스크 진행 상황, 중간 출력값 — 그리고 kickoff 입력, 해당 시점까지의 이벤트 기록, 그리고 체크포인트를 원본 실행에 연결하는 lineage ID를 포함합니다.
체크포인트에서 복원하면 CrewAI는 해당 상태를 재구성하고 이미 완료된 작업을 건너뛰고 계속 진행합니다. 포크하면 CrewAI는 새 lineage 아래에 상태를 복원하여 새 브랜치와 원본 실행이 서로 덮어쓰지 않도록 합니다.
복원하면 해당 상태를 재구성하고 계속 진행합니다. 완료된 태스크는 건너뛰고, 메모리와 지식은 재수화되며, 다운스트림 작업은 원본 실행이 생성한 동일한 출력을 기반으로 실행됩니다. 포크하면 새 lineage 아래에서 동일한 복원을 수행하여 새 브랜치와 원본 실행이 서로 덮어쓰지 않고 나란히 체크포인트를 기록할 수 있습니다.
### 체크포인트가 기록되는 시점
@@ -172,14 +172,6 @@ CrewAI에는 두 가지 프로바이더가 포함되어 있습니다:
```
</Accordion>
<Accordion title="classmethod로 재개" icon="rotate-left">
```python
config = CheckpointConfig(restore_from="./my_checkpoints/<file>.json")
crew = Crew.from_checkpoint(config)
result = crew.kickoff()
```
</Accordion>
<Accordion title="새 브랜치로 포크" icon="code-branch">
`fork()`는 새 lineage 아래에 체크포인트를 복원하여 새 실행이 원본과 충돌하지 않도록 합니다.
@@ -226,10 +218,6 @@ CrewAI에는 두 가지 프로바이더가 포함되어 있습니다:
),
)
result = flow.kickoff()
config = CheckpointConfig(restore_from="./flow_cp/<file>.json")
flow = MyFlow.from_checkpoint(config)
result = flow.kickoff()
```
</Tab>
<Tab title="Agent">

View File

@@ -26,9 +26,9 @@ O checkpointing salva um snapshot do estado de execucao durante uma execucao par
### O que e um checkpoint
Um checkpoint e um snapshot serializado do `RuntimeState` gravado em um ponto da execucao. Ele registra quais tarefas foram concluidas, suas saidas, os inputs atuais e um ID de linhagem que identifica a execucao.
Um checkpoint captura tudo o que o CrewAI precisa para recriar uma execucao em andamento: o estado completo da crew, flow ou agente — configuracao, memoria e fontes de conhecimento dos agentes, progresso das tarefas, saidas intermediarias — junto com os inputs do kickoff, o historico de eventos ate aquele ponto e um ID de linhagem que liga o checkpoint a execucao de origem.
Ao restaurar a partir de um checkpoint, o CrewAI reconstroi esse estado, pula o trabalho ja concluido e continua. Ao fazer fork, o CrewAI restaura o estado sob uma nova linhagem para que a nova branch e a execucao original nao se sobreponham.
Restaurar reconstroi esse estado e continua. Tarefas concluidas sao puladas, memoria e conhecimento sao reidratados, e o trabalho downstream roda contra as mesmas saidas que a execucao original produziu. Fazer fork executa a mesma restauracao sob uma nova linhagem, para que a nova branch e a execucao original gravem checkpoints lado a lado sem sobrescrever uma a outra.
### Quando os checkpoints sao gravados
@@ -172,14 +172,6 @@ Este passo a passo leva cerca de 5 minutos. Voce executara uma crew de duas tare
```
</Accordion>
<Accordion title="Retomar via classmethod" icon="rotate-left">
```python
config = CheckpointConfig(restore_from="./my_checkpoints/<file>.json")
crew = Crew.from_checkpoint(config)
result = crew.kickoff()
```
</Accordion>
<Accordion title="Fazer fork em uma nova branch" icon="code-branch">
`fork()` restaura um checkpoint sob uma nova linhagem para que a nova execucao nao colida com a original.
@@ -226,10 +218,6 @@ Este passo a passo leva cerca de 5 minutos. Voce executara uma crew de duas tare
),
)
result = flow.kickoff()
config = CheckpointConfig(restore_from="./flow_cp/<file>.json")
flow = MyFlow.from_checkpoint(config)
result = flow.kickoff()
```
</Tab>
<Tab title="Agent">