Caching Workflows
Simplex provides automatic caching functionality for agentic actions. This is cheaper, faster, and more reliable than always running agentic actions.
You can enable caching by setting the workflow_name
parameter when creating a session.
On a first run of a session with caching enabled, Simplex will run agentic functions as normal.
First run of a session. Click to expand.
Subsequent runs of the same session will use the cached actions.
Subsequent runs of the same session -- no agent actions are displayed in the logs because we're using cached actions. Click to expand.
If the cached element is not found in the cache, Simplex falls back to running the agentic action. This then adds the element to the cache as a potential option when the workflow is run again.
Here’s the code for using caching in the above examples.