Persistence
Message Persistence
To learn about how to load previous messages and agent states, check out the Loading Message History and Loading Agent State pages.
To persist CrewAI Flow messages to a database, you can use the @persist decorator. For example, you might use the default SQLiteFlowPersistence or provide your own custom persistence class.
For a concrete example of how a custom persistence class like InMemoryFlowPersistence can be implemented and used with the @persist decorator, see the sample agent implementation.
Read more about persistence in the CrewAI Flows documentation.
