Does NSQ Remember Between Runs? The Next Message Starts Blank
NSQ can hold 10,000 messages in memory for one topic and channel, and it still remembers no results at all.
AI Stella and Liam are AI hosts with AI-generated voices. About our AI hosts
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.
Show notes
NSQ can hold 10,000 messages in memory for one topic and channel, and it still remembers no results at all. In this episode of Agentic Pod, Liam and Stella explain how NSQ moves a message (a publisher sends to a topic, every channel gets a copy, and consumers take messages from a channel), why FIN, REQ and a timeout never create a result record the next message can read, and the Monday to Tuesday feedback example where an AI consumer redoes its grouping from scratch and can flag a known request as new again. Vilix AI is the memory layer that fixes that missing half: get_context before the run loads the saved themes, known requests and drafted replies, and save_turn after the run saves the full history back for the next message.
What we cover:
- How NSQ works: topics, channels created on first use, and one copy per channel
- Inside a channel: each message goes to one connected consumer, and channels buffer independently
- mem-queue-size defaults to 10,000 in memory, overflow goes to a disk backed queue, and ephemeral channels discard overflow
- At least once delivery: FIN finishes, REQ requeues, and a timeout requeues the same unchanged body
- Why no result record exists for the next run, with the Monday and Tuesday feedback example
- How Vilix AI fixes each pain: get_context, save_turn with source labels, failures saved, newest wins, projects, project rules, user rules, skills and the agent inbox
Chapters
Questions answered in this episode
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.
Links & resources
Full transcript
Intro
Hey hey hey, welcome to Agentic Pod! I'm Liam.
And I'm Stella! Liam, quick fact check. NSQ can hold ten thousand messages in memory for one channel. So my agent remembers, right?
That number is real. The default mem-queue-size is ten thousand per topic and channel. But holding messages is not remembering results.
Wait. That sounds like the whole trick.
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
Okay, start simple. What does NSQ actually do?
NSQ is a realtime distributed messaging platform. A publisher sends a message to a topic. Every channel on that topic gets its own copy.
And consumers just grab from a channel?
Exactly. Topics and channels are created on first use. Inside a channel, each message goes to one connected consumer, chosen from the group.
So channels are like separate lines at the same counter.
Nice one. And each channel buffers on its own. If memory fills past ten thousand, the overflow goes to a disk backed queue.
Disk sounds permanent. Is that memory then?
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.
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
A consumer finishes a message by replying FIN. Or it replies REQ to requeue it for another try.
And if it just goes quiet?
Timeout. NSQ auto requeues the same message, with the same unchanged body. Delivery is at least once, so duplicates are possible too.
Same body. So no notes in the margin?
None. FIN, REQ and timeout never create a result record. Nothing writes back what the consumer found, decided or drafted.
So my agent can do brilliant work, send FIN, and that work just evaporates?
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.
A real week sounds dangerous. Whose inbox are we raiding?
Monday, Tuesday, and the repeat flag
Picture a scheduled AI consumer on a feedback channel. On Monday it groups a batch of feedback by theme.
Okay, useful already.
It flags two repeats of a known request. It drafts replies. Then it sends FIN, clean and tidy.
And Tuesday?
Tuesday brings a new batch. The consumer starts from the new messages only. It groups everything from scratch again.
Let me guess. The known request looks brand new.
Exactly. It can flag that known request as new again. Same work, done twice, with a confident smile.
That is a goldfish with a job title.
And here is the fresh problem. If Monday's run failed halfway, that failure leaves no trace either. Tuesday cannot learn from it.
So what would Vilix AI change on Monday, before any of this repeats?
The Vilix AI fix and the verdict
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.
And after Tuesday's run?
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.
What if Monday and Tuesday disagree?
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.
And I do not run another database next to nsqd for this?
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.
Agencies, I know that look. One memory for every client?
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.
My verdict: NSQ is great at moving messages. It was never built to remember results.
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!