[docs] Add a runnable conversational Flow persistence and restart example
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 perDOCS_TRANSLATIONS.md. Leave frozendocs/v*/snapshots unchanged.
Starting points
- Conversational Flow guide
- Existing fresh-instance persistence tests —
TestPersistCustomListenReplies - SQLite persistence implementation
- Translation instructions
- Contribution guide
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.
Taking this up — will open a PR shortly.
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.
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).
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.
Still relevant — PR #8427 adds the runnable example and is open awaiting maintainer review.