Swapping the AI behind a workflow without losing anything
Change the AI model, shorten the workflow, then roll back, with every past run still on record.
A working sample we built to show how we would solve a problem like this. It is not a delivered project.
In plain terms
Businesses worry that changing the AI they use will break their setup or erase their records. This demo changes the model with a one-line setting, shortens the workflow from two steps to one, then returns to the original, checking the output matches. Every run stays in the record.
- Switching models is a setting, not a rewrite.
- Shortening the workflow is a new data file, not new code.
- Compares results, cost and speed from the real record of what ran.
- Rolling back is checked against the original output.
What this does not claim: The two models in this demo are simple stand-ins, not real AI services, so the cost and speed figures only show the method. Real model connections are not part of this demo.
Technical details
Prompts (prompts/*.txt) and workflows (workflows/*.json) are data; providers.py is the only model-specific module, with two deterministic zero-cost stand-in adapters behind one interface. history_store.py writes an append-only SQLite log of every run (model, workflow version, output, cost, latency). demo_script.py runs a 2-step draft+refine workflow on provider A, swaps to B by config, simplifies to 1 step via a new workflow file, compares outputs/cost/latency from the log, rolls back and checks the output matches the original run, and exports run_history_export.csv showing nothing was overwritten.
- Python
- SQLite
- JSON workflow definitions
- plain-text prompts
Need something like this?
Tell us the problem in your own words. We reply with a plain, practical plan.
Discuss a project like this