agenthub · ai.llm_memory
A conversational LLM that remembers. It fetches the session's prior turns, answers with them in context, and writes the new turn back — three nodes fused into one.
Why the node earns its place
The chatbot-that-remembers pattern used to be a four-part wiring job: Memory Fetch, then the LLM, then Memory Write triggered off the LLM's flow port. Easy to get subtly wrong, and the trigger edge in particular is the kind of thing people forget until they notice the agent has amnesia.
This node composes those three handlers verbatim — the same memory calls, the same model call, the same billing event — so its behaviour can never drift from the standalone nodes. The pieces remain available separately for graphs that want them.
How it works at run time
limit prior messages for this session from the memory service.prepend inserts them as real user and assistant turns, so the model reads an actual conversation; system collapses them into one summary system message.persist_memory is off.What you wire
Configuration
| Key | Type | Default & options | What it does |
|---|---|---|---|
| provider * | string | choices from model-library:providers | — |
| model * | string | choices from model-library:models | — |
| system_prompt | string | — | Agent persona / instructions, injected as the system message. |
| temperature | number | default 0.7 | — |
| max_tokens | number | — | — |
| limit | number | default 10 | Max prior messages to fetch from memory. |
| inject_as | string | default "prepend" prepend · system | prepend (default): insert prior turns as raw user/assistant messages before the incoming ones — the model reads them as a real conversation. system: collapse history into one summary system message (can read as background the model may ignore). |
| persist_memory | boolean | default true | Persist this user + assistant turn back to memory after the response. Turn off for read-only (recall without remembering). |
What usually goes wrong
Watch for this
Prefer prepend over system. History collapsed into a system message reads to the model as background it may ignore; as real turns it reads as the conversation it is continuing.
Memory here is best-effort by design. A missing session id or a memory service error is logged and swallowed, so the reply still goes out — the agent simply will not remember it. An agent that has quietly stopped remembering is not broken wiring; check that the run carries a session id.
Behaviour & provenance