crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

[docs] Add a runnable conversational Flow persistence and restart example

Open lorenzejay opened this issue 1 month ago • 5 comments

Problem

The conversational Flow guide explains session identity and persistence, but does not provide a complete runnable example showing a fresh Flow instance restoring both sides of a conversation. This makes it harder to distinguish reusing an in-memory instance from resuming persisted history.

Priority: Low — documentation and onboarding improvement. Difficulty: Easy, with Python, Flow state, and a focused smoke check.

Goal

Add one deterministic SQLite-backed example that runs without provider credentials or paid model calls and demonstrates session resume across fresh Flow instances.

Bounded scope

Extend the existing conversational Flow guide and use existing ConversationConfig, handle_turn(), @persist, and SQLiteFlowPersistence APIs. Use a custom deterministic route/handler so the example requires no LLM. This is an example of existing behavior, not a request for a new persistence backend or session API.

Acceptance criteria

  • [ ] Provide complete imports, setup, the command to run, and expected output.
  • [ ] Use an explicit SQLite path and a stable session ID.
  • [ ] Process a first turn, then construct a fresh Flow instance with the same persistence configuration and process a second turn under the same session ID.
  • [ ] Show that the restored history contains both the first user message and its assistant reply, followed by the second turn, in order without duplicate messages.
  • [ ] Demonstrate that a fresh instance with a different session ID starts a separate conversation.
  • [ ] Explain that the instance restart demonstration models persisted state recovery; it does not restore running background work or execution resources.
  • [ ] Finalize deferred session traces appropriately.
  • [ ] Add one focused smoke check for the complete example using a temporary SQLite database. Reuse existing test conventions; do not introduce an example-runner framework.
  • [ ] Edit English MDX under docs/edge/en/ and sync the corresponding ar, ko, and pt-BR guides per DOCS_TRANSLATIONS.md. Leave frozen docs/v*/ snapshots unchanged.

Starting points

Submit one focused documentation/example PR linked to this issue. Open to all contributors; state intent before starting to avoid duplicate work. Issue prepared with AI assistance.

lorenzejay avatar Oct 12 '26 03:10 lorenzejay

Taking this up — will open a PR shortly.

SpinachDigital avatar Oct 12 '26 04:10 SpinachDigital

Hi, I would like to work on this. Plan: add the deterministic SQLite-backed example to the conversational Flow guide — a first turn, then a fresh Flow instance with the same persistence config and session ID restoring both sides of the conversation in order, plus a different session ID starting a separate conversation — with the focused smoke check on a temporary database, and the ar/ko/pt-BR guide syncs per DOCS_TRANSLATIONS.md. No LLM calls, per the bounded scope.

jaisogani-ai avatar Oct 22 '26 16:10 jaisogani-ai

I'd like to work on this. Plan: add a SQLite-backed persistence + fresh-instance restore example to the English conversational Flow guide, sync ar/ko/pt-BR, and add one focused smoke test using a temporary SQLite DB (no LLM, deterministic handler).

fxia0018 avatar Oct 30 '26 14:10 fxia0018

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Nov 30 '26 12:11 github-actions[bot]

Still relevant — PR #8427 adds the runnable example and is open awaiting maintainer review.

jaisogani-ai avatar Nov 30 '26 18:11 jaisogani-ai