r/AI_Agents • • Oct 17 '26

Discussion Is migrating my existing Python agent architecture to Pi-Durable a good idea?

I’m building a B2B SaaS with a Python-based architecture. The system uses separate LLM calls within Python components, with business logic, workflow orchestration, and application state managed by the existing application. I’m currently using SQLite.

As the system grows, I’m thinking about potential challenges around concurrent users, long-running workflows, retries, failure recovery, and agents handing tasks back and forth.

I’ve been advised to consider migrating the orchestration layer to Pi-Durable, but I’m not sure whether this is the right move for my current architecture.

Does migrating to Pi-Durable make sense in this situation, or would I be better off keeping my current architecture and improving it as needed? What trade-offs should I consider before making this decision?

3 Upvotes

16 comments sorted by

View all comments

Show parent comment

1

u/Significant_Tune9219 Oct 18 '26

I would make the business write idempotent before I move the loop. A durable log and a Postgres commit are two commits, so a crash between them reruns the step and the second run has to find the first row instead of inserting another. Store the workflow's step id on the business row before you commit, and have the retry look that id up. The minimum check is killing the worker after the commit and before the workflow marks the step done: the second run must not create a second row. Human waits can wait until that test passes.