Skip to content

docs(flows): document where @persist stores its SQLite database#5718

Open
Beandon13 wants to merge 1 commit intocrewAIInc:mainfrom
Beandon13:fix/crewai-5372-flow-persist-doc
Open

docs(flows): document where @persist stores its SQLite database#5718
Beandon13 wants to merge 1 commit intocrewAIInc:mainfrom
Beandon13:fix/crewai-5372-flow-persist-doc

Conversation

@Beandon13
Copy link
Copy Markdown

Summary

  • Issue [FEATURE] Enhance the document about @persisit #5372 asks where on disk @persist actually saves state. The Flow Persistence section in concepts/flows.mdx mentions SQLite but never names the file or its path.
  • Adds a new "Where Is the State Stored?" subsection that:
    • Names the default file (flow_states.db) and explains it's resolved through appdirs.user_data_dir.
    • Tabulates the per-platform defaults for macOS / Linux / Windows (matching how appdirs 1.4 ignores appauthor on POSIX but uses it on Windows — verified locally).
    • Notes that the project segment is cwd's basename by default and how to pin it with CREWAI_STORAGE_DIR.
    • Shows runtime introspection via crewai.utilities.paths.db_storage_path().
    • Documents how to override the path entirely with SQLiteFlowPersistence(db_path=...).
  • Pure docs change, no code touched.

Closes #5372

Testing

  • Verified path resolution against appdirs.user_data_dir and crewai.utilities.paths.db_storage_path():
python -c "from crewai.utilities.paths import db_storage_path; print(db_storage_path())"
# /Users/<me>/Library/Application Support/<cwd-basename>
CREWAI_STORAGE_DIR=my-flows python -c "from crewai.utilities.paths import db_storage_path; print(db_storage_path())"
# /Users/<me>/Library/Application Support/my-flows
python -c "from crewai.flow.persistence.sqlite import SQLiteFlowPersistence; p=SQLiteFlowPersistence(); print(p.db_path)"
# /Users/<me>/Library/Application Support/<cwd-basename>/flow_states.db
  • No build infra is shipped in the repo (Mintlify renders remotely), so I left rendered preview to the docs CI.

Issue crewAIInc#5372 reports that the Flow Persistence guide describes @persist
saving state to SQLite but never says *where* on disk that file lives.
This adds a "Where Is the State Stored?" subsection under Flow
Persistence that:

- Names the default file (flow_states.db) and explains it's in CrewAI's
  user-data dir resolved via appdirs.user_data_dir.
- Tabulates the per-platform default paths (macOS / Linux / Windows),
  matching how appdirs ignores appauthor on POSIX but uses it on
  Windows.
- Calls out that the project component is `cwd`'s basename by default
  and shows how to pin it with CREWAI_STORAGE_DIR.
- Shows the runtime introspection helper (`db_storage_path()`).
- Documents how to override the path entirely with
  `SQLiteFlowPersistence(db_path=...)`.

Closes crewAIInc#5372
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Enhance the document about @persisit

1 participant