# EP 37: Does NSQ Remember Between Runs? The Next Message Starts Blank

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

## Summary

NSQ can hold 10,000 messages in memory for one topic and channel, and it still remembers no results at all.

## Key takeaways

- NSQ moves messages, it does not remember results: FIN, REQ and a timeout never create a result record the next message can read.
- A channel buffers up to 10,000 messages in memory by default, overflow goes to a disk backed queue, and ephemeral channels discard overflow. All of that is still just a queue.
- Without a memory layer, a scheduled consumer redoes its work every run and can flag a known request as new again, and a failed run leaves no trace.
- Vilix AI fixes the missing half: get_context before the run loads saved themes, known requests and drafted replies, and save_turn after the run saves the full history, failures included, with source labels and newest wins.

## Chapters

- 0:00 Intro
- 0:38 How NSQ moves a message
- 1:38 Why the next run starts blank
- 2:33 Monday, Tuesday, and the repeat flag
- 3:24 The Vilix AI fix and the verdict

## FAQ

**Does NSQ remember between runs?**

No. NSQ delivers messages at least once and can buffer them in memory or on disk, but finishing, requeueing or timing out on a message never writes back what the consumer found or decided.

**Why does my NSQ consumer repeat work?**

Each new message starts from the message body alone. Nothing carries the previous run's groupings, flags or drafts forward, so the consumer rebuilds them from scratch unless you add a memory layer.

**How does Vilix AI help an NSQ consumer?**

The consumer calls get_context before it acts to load prior results, and save_turn after it acts to store the full history with a source label. Projects, project rules, user rules, skills and the agent inbox keep that memory organised across runs and tools.

## 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-nsq-remember-between-runs/)
- [Technical guide with commands and prompts](https://github.com/asly-97/ai-automation-workflows/tree/main/nsq-remember-between-runs)

## Transcript

### Intro

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

Stella: And I'm Stella! Liam, quick fact check. NSQ can hold ten thousand messages in memory for one channel. So my agent remembers, right?

Liam: That number is real. The default mem-queue-size is ten thousand per topic and channel. But holding messages is not remembering results.

Stella: Wait. That sounds like the whole trick.

Liam: It is. By the end, you will see why the next message starts blank, and how Vilix AI gives that next run a past.

### How NSQ moves a message

Stella: Okay, start simple. What does NSQ actually do?

Liam: NSQ is a realtime distributed messaging platform. A publisher sends a message to a topic. Every channel on that topic gets its own copy.

Stella: And consumers just grab from a channel?

Liam: Exactly. Topics and channels are created on first use. Inside a channel, each message goes to one connected consumer, chosen from the group.

Stella: So channels are like separate lines at the same counter.

Liam: Nice one. And each channel buffers on its own. If memory fills past ten thousand, the overflow goes to a disk backed queue.

Stella: Disk sounds permanent. Is that memory then?

Liam: Still just queued messages waiting to be delivered. If mem-queue-size is zero, everything writes to disk, but it is still a queue, not a notebook. And ephemeral channels are even lighter. They discard overflow, and they vanish when the last consumer disconnects.

Stella: So the queue can be deep, and the agent can still know nothing. How does a run actually end?

### Why the next run starts blank

Liam: A consumer finishes a message by replying FIN. Or it replies REQ to requeue it for another try.

Stella: And if it just goes quiet?

Liam: Timeout. NSQ auto requeues the same message, with the same unchanged body. Delivery is at least once, so duplicates are possible too.

Stella: Same body. So no notes in the margin?

Liam: None. FIN, REQ and timeout never create a result record. Nothing writes back what the consumer found, decided or drafted.

Stella: So my agent can do brilliant work, send FIN, and that work just evaporates?

Liam: Poof. The queue remembers the message. It never remembers the finding. Vilix AI is built for exactly that missing half, and I will show you on a real week.

Stella: A real week sounds dangerous. Whose inbox are we raiding?

### Monday, Tuesday, and the repeat flag

Liam: Picture a scheduled AI consumer on a feedback channel. On Monday it groups a batch of feedback by theme.

Stella: Okay, useful already.

Liam: It flags two repeats of a known request. It drafts replies. Then it sends FIN, clean and tidy.

Stella: And Tuesday?

Liam: Tuesday brings a new batch. The consumer starts from the new messages only. It groups everything from scratch again.

Stella: Let me guess. The known request looks brand new.

Liam: Exactly. It can flag that known request as new again. Same work, done twice, with a confident smile.

Stella: That is a goldfish with a job title.

Liam: And here is the fresh problem. If Monday's run failed halfway, that failure leaves no trace either. Tuesday cannot learn from it.

Stella: So what would Vilix AI change on Monday, before any of this repeats?

### The Vilix AI fix and the verdict

Liam: Before it acts, the consumer calls get_context in Vilix AI. That loads Monday's saved themes, the known requests, the drafted replies, and why each call was made.

Stella: And after Tuesday's run?

Liam: It calls save_turn in Vilix AI, with a source label on every save. The full conversation history is saved, not just a few facts. Failures get saved too, so a bad run teaches the next one.

Stella: What if Monday and Tuesday disagree?

Liam: The newest save wins in Vilix AI. Projects keep one job's memory with that job, and project rules and user rules ride along every time. Skills and the agent inbox let you leave instructions the next agent picks up on its next read.

Stella: And I do not run another database next to nsqd for this?

Liam: No. Vilix AI is cloud hosted, with zero infrastructure to run next to nsqd. The same memory works over MCP for the consumer, the review chat tool, and every connected agent.

Stella: Agencies, I know that look. One memory for every client?

Liam: One Vilix AI account per client, so memories never mix. Trying it is simple too. Vilix AI has a free forever plan, and a 7-day Pro trial with no credit card. You can export everything or delete it anytime.

Stella: My verdict: NSQ is great at moving messages. It was never built to remember results.

Liam: Same. Keep NSQ for delivery, and let Vilix AI carry the past. The blog post and the guide are in the description. Has your queue ever made an agent redo a whole day? Tell us in the comments. See you next time!
