Memory Chatbot
A chatbot that remembers. Conversation history flows back into the prompt on every turn, so the model answers in context instead of treating each message as the first one it has ever seen.
What's in the pipeline.
Hold a real conversation by feeding past messages back into the prompt.
- Chat Input
- Chat Memory
- Prompt
- Language Model
- Chat Output
- Engine
- Workflow EngineSHIPPED
- Category
- Prompting
- Level
- Starter
- Components
- 5
A language model is stateless — it forgets the previous turn the moment it answers. Memory Chatbot fixes that the way every production assistant does: it reads the recent conversation back into the prompt before each call, so "what about the second one?" resolves against what was actually said.
How it works
It's Basic Prompting with one component added — but that component changes the behavior entirely:
- Chat Input receives the new message.
- Chat Memory retrieves recent turns for the session. It's scoped to a session id, so two users never see each other's history, and it's bounded (a rolling window of recent messages) so the context stays affordable as a conversation grows.
- Prompt frames the retrieved history as context — the history fills a
{memory}field so the model's instructions carry the thread so far. - Language Model answers the new message with that framed history in view.
- Chat Output returns the reply, and the exchange is stored for the next turn.
When to reach for it
Use Memory Chatbot for anything multi-turn where earlier context matters: support assistants, guided intake, an interface a person returns to across a session. If you can imagine a user saying "no, the other one," you need this.
When to reach for something else
Memory is recency, not knowledge. The window holds the conversation, not your documents — so the bot still can't answer from a contract or a knowledge base. For that, ground it with retrieval: Document Q&A for a single file, Vector Store RAG for a corpus. The two compose cleanly — memory for the thread, retrieval for the facts.
Try it
Run the workflow and send three messages in sequence:
1. "I'm comparing the Pro and Enterprise plans."
2. "Which one includes audit logging?"
3. "And how much is that one per seat?"The third message never names a plan, but the model answers about Enterprise — because the memory window carried the thread forward. Drop the Chat Memory component and the same sequence falls apart by message two.
Bounded by design
The memory window is capped on purpose — unbounded history inflates every prompt and its cost. Tune the window to the longest exchange you actually need to remember, not the longest one imaginable.
Related templates.
Basic Prompting
SHIPPEDSend input through a prompt to a model and get a response back.
Blog Writer
SHIPPEDTurn reference URLs plus your instructions into a drafted article.
Document Q&A
SHIPPEDLoad one document and answer questions grounded in its contents.
Make this template yours.
MachineCraft is free during private beta. Join the waitlist and we’ll bring you in to start from this flow and adapt it to your work.
