Does Taskiq Remember Between Runs? A Result Backend Can Keep a Return Value, but the Next Task Still Starts With Only Its Arguments.
Does Taskiq Remember Between Runs? A Result Backend Can Keep a Return Value, but the Next Task Still Starts With Only Its Arguments. Taskiq is a modern async task queue for Python. A task is defined once, sent to a broker with .kiq(), and executed by a worker, possibly in another process or on another machine. Because brokers can be durable, the message itself can survive a restart. That raises a fair question: can the next run look back at the last run? No. Taskiq will deliver the arguments it
Does Taskiq Remember Between Runs? A Result Backend Can Keep a Return Value, but the Next Task Still Starts With Only Its Arguments.
Taskiq is a modern async task queue for Python. A task is defined once, sent to a broker with .kiq(), and executed by a worker, possibly in another process or on another machine. Because brokers can be durable, the message itself can survive a restart. That raises a fair question: can the next run look back at the last run? No. Taskiq will deliver the arguments it was given. It will not hand a task the reasoning or corrections from the run before it, unless that history was passed in as new arguments.
What a Taskiq message actually contains
When a task is kicked, the broker receives a serialized message: the task name, the arguments, and labels for scheduling or retries. A worker receives it and calls the matching function.
Every field in that message answers a delivery question. Which function should run. With which arguments. With which labels. Nothing in the message answers a work question: what the previous run found, which records it already handled, or what it decided and why. Two messages for the same task, sent a week apart, have no built-in link between them. There is no thread and no pointer from the newer message to the older one. The broker is transport, and transport is not memory.
The result backend is optional, narrow, and caller-driven
Taskiq does have a place where an outcome can land: a result backend. It has to be configured separately, with .with_result_backend(), using a backend such as a Redis, PostgreSQL, or MongoDB result backend. When a backend is configured, the worker stores a result object keyed by the task ID: whether the task errored, its return value, its execution time, and its labels.
Read that shape closely. A result backend stores the return value of one task ID so a caller who kept that ID can later ask for it with get_result() or wait for it with wait_result(). Results can also expire, depending on the backend settings, for example a Redis backend configured with a result expiry time. Keeping results after a read is itself a setting, keep_results, on several backends.
None of that turns a result into memory for the next run. The next scheduled task does not automatically load the previous result. It does not receive the previous return value as an argument. It does not search past results by task name. Someone has to keep the old task ID, fetch the old result, extract whatever matters, and pass it into the next call by hand. If that chain is not built, the result sits in a backend that the next run never consults.
TaskiqState is worker state, not run memory
Taskiq also offers state, through TaskiqState and startup events, plus dependency injection with values such as a shared HTTP client or a database pool. That state is useful, and its purpose is specific: resources a worker sets up once and shares while it processes tasks.
State is not a record of completed work. A database pool in state lets a task run a query. It does not tell the task what last night's query returned. When the worker restarts, startup builds the state again. The history of prior runs is not rebuilt with it, because Taskiq never stored that history as state.
A scheduled task is a fresh task, every time
Scheduling follows the same pattern. With Taskiq Scheduler, a schedule source produces a task at the due time, for example a cron label such as a task scheduled to run every hour or every day. The scheduler sends the task to the broker, and the worker executes it.
The schedule remembers when to fire. It does not remember what happened when it fired last time. The Monday and Tuesday instances share a task function and an argument shape. They do not share findings. If Monday's run discovered that a lead had already replied or a summary had already been sent, Tuesday's run starts with no automatic knowledge of that discovery, because the schedule carried timing forward and nothing else.
What an AI task actually needs to remember
Add an AI step inside a Taskiq task and the gap stops being abstract. The task checks a source, reasons over new items, drafts or classifies something, and acts. On the next run, good work depends on context the current run created: which items were already processed, what the last summary concluded, which decisions were already approved, and what a person corrected after the last output.
A return value alone does not cover that need. A run can return a short status while its real value lives in a longer exchange: the material it read, the reasoning it followed, and the correction it received. If no one wires that value into the next call, the next run still wakes up with only its arguments and has to rebuild or guess the missing context.
The common workaround is a hand-built store beside the queue: a table or a Redis key that the task reads at the start and updates at the end. That can work for one task in one codebase, but it needs retention, cleanup, and retrieval rules, and it stays private to that task. Another tool cannot read it without more custom wiring.
One memory the next run can actually read
Vilix AI is built for exactly that missing layer. Instead of each Taskiq task keeping private notes in a side table, every run reads from and writes to one shared memory, so the context a run produces is still there, in full, when the next run starts.
Vilix AI is cloud-hosted with zero infrastructure to run: no result store to provision for memory, no side table to design, and nothing extra to maintain. The same memory is available everywhere over MCP, so a scheduled Taskiq task, a chat assistant, and a coding tool all work from the same context instead of separate copies. It stores full conversation history, not just extracted facts or a single return value, so the reasoning and corrections behind a decision survive alongside the decision itself. And the terms keep adoption low-risk: a free plan forever, a 7-day Pro trial with no credit card, and the ability to export or delete everything at any time.
The pattern fits a Taskiq setup without replacing it. At the start, the task pulls the relevant memory for that workflow. At the end, it saves what it learned. Taskiq keeps doing reliable delivery. The remembering happens in a layer designed for it.
Keep the queue, fix the forgetting
Taskiq remembers a task long enough to deliver and execute it, and, if a result backend is configured, long enough for a caller holding the task ID to fetch one return value. That is correct behavior for a task queue. It is not a memory for a recurring agent. Give the recurring Taskiq task one memory it can read on every run, and each run stops starting over.
Get Started for Free — Free forever, no credit card.