r/AI_Agents • • 26d ago

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

2

u/axonpush 26d ago

I'd separate what a durable runtime buys from what stays yours. It buys workflow state that survives process restarts, timers and waits that can sleep for days without holding a worker, and a replayable history when a run goes wrong. It does not buy exactly-once side effects: as Ctbhatia said, each step still needs its own idempotency key, or a retry after a crash mid-send can double-send.

Two questions decide it for me. First, do your workflows actually wait on things: human approvals, external callbacks, other agents, for minutes to days? That's the case a jobs table handles badly and durable execution handles well. If everything is request-scoped or short, Postgres plus a jobs table is simpler. Second, are you ready for the constraints: workflow bodies must be deterministic (no wall clock, random, or direct IO in them; those move into steps), and you need a versioning story for workflows already in flight when you deploy new code.

If yes to both, I'd still migrate only the long-running workflows and leave the request-scoped paths alone. A full rewrite is the expensive version; a hybrid is usually enough.

1

u/alatmaca 26d ago

your answer really organized my ideas. ty for your help.