# EP 53: Does Celery Remember Between Runs? Vilix AI Remembers What the Result Backend Forgets

- URL: https://www.agenticpod.net/episodes/ep53-celery-remember-between-runs/
- Watch on YouTube: https://www.youtube.com/watch?v=jhBPAAmylhM
- Published: 2026-11-19
- Length: 6 min
- Hosts: Stella (asks), Liam (answers). Both are AI hosts with AI-generated voices.

## Summary

Your Celery task reports SUCCESS and stores its result, then the next run starts with only its arguments and drafts the same question to a customer who already answered. Beat keeps last run times, the backend keeps one record per task ID, and the statedb keeps only revoked IDs.

## Key takeaways

- Celery keeps three kinds of record: Beat last run times in celerybeat-schedule or django-celery-beat rows, result backend records keyed by task ID with states and return values that expire, and a worker statedb that persists only revoked task IDs.
- The next task starts with only its arguments. Yesterday's result sits under yesterday's task ID, and today's task does not search for it, fetch it, or rebuild context from it on its own.
- The morning support task shows the cost: it misses the customer reply, the human rewrite and its reason, and the promised follow-up, so it drafts the same question again with fresh wording and total confidence.
- The hand built store works but becomes a second system to design, test, and keep correct, and a saved summary loses the middle of the exchange: the original request, the rejected option, and the correction a person gave.
- Vilix AI fixes the gap: get_context at task start loads the full history for that customer and workflow, and save_turn at the end saves the exchange, failures included, shared over MCP with every tool, cloud hosted with zero infrastructure.

## Chapters

- 0:00 Intro
- 0:50 What Celery actually keeps
- 2:00 What the next task starts with
- 3:07 The hand built store and its limits
- 4:20 The Vilix AI fix and the verdict

## FAQ

**Does Celery remember between runs?**

In the bookkeeping sense, yes: Beat remembers when entries last fired, the result backend remembers how identified tasks ended until results expire, and workers can persist revoked IDs. In the working sense an AI agent needs, no: the next task receives only its arguments and starts fresh unless your own code fetches and rebuilds the past for it.

**What does the result backend actually store?**

One record per task, keyed by that task's own ID, holding its state (PENDING, STARTED, SUCCESS, FAILURE, RETRY, or REVOKED) and its return value or traceback. Results expire and a cleanup task removes old ones. It is a record of how tasks ended, not a briefing the next task loads.

**Why does the morning task ask the same question again?**

Because it starts with only its arguments. It never saw yesterday's customer reply, the human rewrite of its draft, or the follow-up promised on another thread, so it drafts the same question in fresh wording with complete confidence.

**How does Vilix AI help a Celery task?**

get_context at task start loads the full history that matters, the exchange and the reasoning, not just final results. save_turn at the end saves the new exchange with a source label, failures included, newest wins, shared over MCP with every tool, so the next run in any tool starts where the last one left off.

## Resources

- [Vilix AI, one shared memory for ChatGPT, Claude, Claude Code, Codex, Cursor, OpenClaw, Hermes and every MCP tool](https://vilix.ai)
- [Connect Vilix AI in under two minutes per tool](https://vilix.ai/get-started)
- [Read the full post](https://vilix.ai/blog/does-celery-remember-between-runs/)
- [Technical guide with commands and prompts](https://github.com/asly-97/ai-automation-workflows/tree/main/celery-agent-memory)

## Transcript

### Intro

Liam: Hey hey hey, welcome to Agentic Pod! I'm Liam.

Stella: And I'm Stella! Your Celery task ran perfectly yesterday. It succeeded, right?

Liam: SUCCESS, in big green letters. Result stored. Beat fired it right on time.

Stella: So this morning the same task should know what happened yesterday?

Liam: It should. It does not. This morning it drafted the exact same question to the same customer.

Stella: The customer who already answered?

Liam: Word for word. Fresh wording, total confidence, zero memory of the reply. Vilix AI is how that task starts where yesterday actually left off.

### What Celery actually keeps

Stella: Start fair. Celery keeps records. What are they, exactly?

Liam: Three kinds. First, Beat. Beat reads the schedule and sends due tasks to the broker.

Stella: Beat does not run the tasks itself?

Liam: No. Workers run them. Beat's PersistentScheduler stores last run times in a local file, celerybeat-schedule.

Stella: And django-celery-beat?

Liam: Same idea in database rows. Last run at, total run count. Bookkeeping, not working memory.

Stella: Second record?

Liam: The result backend. Redis or a database. Each result is keyed by that task's own ID.

Stella: With states?

Liam: PENDING, STARTED, SUCCESS, FAILURE, RETRY, REVOKED. And a return value, until it expires.

Stella: Results expire?

Liam: They do. A cleanup task removes old ones. Third record is the narrowest. A worker statedb keeps only revoked task IDs.

Stella: So Celery remembers when, how one task ended, and what was revoked. What does tomorrow's task actually get?

### What the next task starts with

Liam: Only its arguments. That is the whole briefing.

Stella: Same arguments every morning, same starting point every morning?

Liam: Exactly. Yesterday's result sits under yesterday's task ID. Today's task does not search for it.

Stella: Unless my code fetches it first?

Liam: Your code has to know which IDs matter, fetch them before they expire, and rebuild context by hand.

Stella: And Beat's timestamp helps how?

Liam: It proves the schedule ran at 7 AM. It says nothing about what the task found.

Stella: Now give me the morning task from the blog. The support one.

Liam: Every morning it checks open support threads and drafts replies with an AI model.

Stella: Yesterday a customer answered its question. A human rewrote one draft and explained why.

Liam: And another thread was promised a follow-up today. This morning's task knows none of that.

Stella: So it asks again, politely, like nothing happened.

Liam: Like nothing happened, because for that task, nothing did. Vilix AI fixes that gap, and we will get to how.

Stella: Hold on. Why do builders not just store the summary themselves?

### The hand built store and its limits

Liam: They do. That is the usual fix. A table holds the last summary per customer.

Stella: A Redis key holds open items. A prompt builder queries recent rows.

Liam: Trims them to fit, pastes them into today's task. It works, honestly.

Stella: Then what breaks?

Liam: Now you own a second system. Schema, tests, failure modes, kept correct as the schedule and the model change.

Stella: Every Celery team becomes a memory team.

Liam: Every single one. And the summary captures less than the agent needs.

Stella: Less how?

Liam: A summary is the end of a run, compressed. The next decision needs the middle.

Stella: The original request. The option that was rejected.

Liam: The correction a person gave, and why the decision went one way. Save only the output, you lose the exchange.

Stella: And scope? That table lives in one app.

Liam: One Celery app. Your n8n scenario, your chat tools, they each keep their own partial record.

Stella: A decision in Claude never reaches the morning task unless someone copies it.

Liam: Which raises the real question. What if the memory lives outside the task entirely?

### The Vilix AI fix and the verdict

Liam: Step one. At task start, the AI step calls get_context in Vilix AI.

Stella: What loads?

Liam: The relevant history for that customer and workflow. Full conversation history in Vilix AI, not just final results.

Stella: The reply, the rewrite, the reason why?

Liam: All of it. Step two, before the task ends, it calls save_turn in Vilix AI.

Stella: So tomorrow starts with today's full exchange in view.

Liam: Exactly. No repeat question. No follow-up sent twice. Failures save in Vilix AI too, so the next run skips the broken path.

Stella: And my other tools see the same memory?

Liam: Same Vilix AI memory over MCP. The Celery worker, another automation platform, and the AI tools you open directly.

Stella: Do I run a new store for that?

Liam: No. Vilix AI is cloud hosted, zero infrastructure. Nothing extra to provision or keep alive between schedules.

Stella: Control over the data?

Liam: Export or delete everything in Vilix AI anytime. Vilix AI is free forever, with a 7 day Pro trial, no credit card.

Stella: My verdict: let Celery schedule and run. Let Vilix AI remember.

Liam: Same. Beat keeps time, the backend keeps results, Vilix AI keeps the story. Blog and guide are linked below. Does your Celery task remember yesterday? Tell us below. See you next time!
