Episodic Memory in Agentic Frameworks: Suggesting Next Tasks
Sandro Rama Fiorini, Leonardo G. Azevedo, Raphael M. Thiago, Valesca M. de Sousa, Anton B. Labate, Viviane Torres da Silva · 2025
Read Episodic Memory in Agentic Frameworks: Suggesting Next Tasks by Sandro Rama Fiorini, Leonardo G. Azevedo, Raphael M. Thiago, Valesca M. de Sousa, Anton B. Labate, Viviane Torres da Silva (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2511-17775.txt.
Introduction
Sandro Rama Fiorini, Leonardo G Azevedo, Raphael M Thiago, Valesca M de Sousa, Anton B Labate, and Viviane Torres da Silva propose giving scientific workflow agents a memory of past work. Agents built on large language models can help researchers build workflows, but asking the model alone what to do next risks invented steps and costly retraining on private data. Their design stores past workflows as episodes that can be searched.
When a user builds a new workflow, the system matches the partial draft against stored sequences and suggests next tasks that followed similar steps before. Suggestions thus rest on recorded practice rather than the model's guesswork. The authors frame episodic memory as a light, auditable way to guide co-creation between scientists and AI assistants.
Catalog record
| CREATOR | Sandro Rama Fiorini, Leonardo G. Azevedo, Raphael M. Thiago, Valesca M. de Sousa, Anton B. Labate, Viviane Torres da Silva |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 13 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2511-17775
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Episodic Memory in Agentic Frameworks: Suggesting Next Tasks Sandro Rama Fiorini, Leonardo G. Azevedo, Raphael M. Thiago, Valesca M. de Sousa, Anton B. Labate, Viviane Torres da Silva Abstract Agentic frameworks powered by Large Language Models (LLMs) can be useful tools in scientific workflows by enabling human-AI co-creation. A key challenge is recommending the next steps during workflow creation without relying solely on LLMs, which risk hallucination and require fine-tuning with scarce proprietary data. We propose an episodic memory architecture that stores and retrieves past workflows to guide agents in suggesting plausible next tasks. By matching current workflows with historical sequences, agents can recommend steps based on prior patterns. 1 Introduction Recent advances in generative models and autonomous agents have opened new avenues for automating complex scientific workflows. Agentic frameworks help leveraging the reasoning and planning capabilities of Large Language Models (LLMs) to explore design spaces, optimize experimental protocols, and accelerate discovery. Those frameworks provide human-AI co-creation capabilities in which humans and AI agents interact to each other to construct and run scientific workflows. One of the main research areas in workflows construction is the task recommendation. Although it has been addressed before in multiple works (i.e., 3 ; 8 ), it has not been applied yet in the context of agentic frameworks. While LLMs can be asked what users can do next in a given context, those suggestions are often based on pre-trained memories that are unspecific to a given domain. In order to ameliorate this problem and minimize the likelihood of hallucination 5 , it would be necessary to fine-tune the LLM with up-to-date dataset of scientific, proprietary workflows, which is not easy to achieve due to limited availability and cost. One promising direction is to endow the agents themselves with the capacity to store, recall and communicate past users’ interactions compiled as formalized workflows. In this paper we propose the use of episodic memory to implement this. Inspired by Cognitive Science, it enables agents to store and retrieve experiences contextualized by the user’s intentions, facilitating decision-making 7 ; 10 . We use episodic memory to store instances of executed scientific workflows, i.e., a sequence of executed tasks. Agents can then analyze these workflow memories in contrast with the workflow being constructed by an user in order to suggest the next tasks he or she could try next. We introduce an episodic memory architecture designed to support workflow completion within agentic frameworks for Materials Science. Our proposal endows existing agentic architectures with the capability of storing and remembering executed workflows. The architecture features a dedicated agent that leverages specialized tools to compile, record and retrieve workflows using a provenance database. Retrieval is based on a workflow similarity algorithm that uses text embeddings and tool comparison. To recommend subsequent steps, we employ a large language model (LLM) that analyzes the retrieved workflows in relation to the current one. Finally, we demonstrate the utility of our architecture through a collection of illustrative examples in material classification 2 Architecture and methodology Our task suggestion system is based on the assumption that a user interacts with a crew (i.e., group of agents) of domain agents supervised by a coordinator via a chat interface during a chat session. Instructions and tool calls reflect an intended workflow, even if that is hidden in reasoning steps, reactions and other trajectory information. We also assume that the domain crew is mostly transparent; i.e., we have access to the log of interactions among its sub-agents and tools. Based on these assumptions, we devised the architecture depicted in Figure 1 a. Figure 1: Overview of the approach: (a) general architecture of the solution; (b) flow of the solution, starting on the UI with the user instruction. The general gist of the method is that we interpose our Episodic Memory (EM) Agent between the chat UI and the domain crew which adds episodic memory capabilities to the system. User instructions are sent to the domain crew, which executes one or more tasks in sequence to fulfill each of the user’s instructions. The EM agent compiles a workflow from the trajectory information coming from the crew (i.e., reasoning steps and tool calls). Based on that information, we retrieve memories of past workflows and infer what could be the next possible steps. In more detail, the EM Agent runs a strict task suggestion algorithm (Figure 1 b). As the user inputs a new instruction in the UI, the EM Agent intercepts and sends it verbatim to the domain agent crew, which provides two outputs: the task result itself, which it keeps unchanged, and the execution trajectory . From the trajectory information, the agent uses a workflow compiler to create a partial workflow description of the current session (the current workflow ). In this context, we define a workflow to be a recursive structure composed of ordered steps (i.e., reasoning steps and tool calls), each with input, output and possible nested sub-steps. We distinguish between two types of steps: (a) function calls , which are usually tool calls without explicit sub-steps, such as calls to data repositories or simulation functions; and (b) user-instructions , which are user-provided instructions that may or may not have tool calls as sub-steps. The process of compiling trajectory into a workflow generates a formalized description of the tasks in the trajectory, ignoring information that is not essential to reproduce the workflow, such as agent reasoning steps and failed tool calls in the domain crew. After that, the EM Agent runs the Episodic Memory Retrieval Tool with the current workflow, which fetches the most relevant workflow memories from a workflow database. The workflow database includes a provenance database with memory workflows compiled from interactions with other users, systems or manually curated. We store workflows following the ProvLake provenance schema 9 which is based on W3C PROV 4 . The workflow matching algorithm retrieves memory workflows having sub-workflows that are similar to the current one. The agent ignores memory workflows that are exact the same as the current workflow, as they do not provide much information on which steps the user might do next. In our current implementation, we use a simple tree matching algorithm with embedding similarity for instruction steps. More specifically, consider an ordered sequence S_{i} of the leaf steps of a workflow W_{i} in the episodic memory. Analogously, let S_{c} bet the ordered sequence of the leaf steps in the current workflow W_{c} . Considering a similarity threshold T , we retrieve W_{i} if sim(S_{c},S^{\prime}_{i})>T for a subsequence S^{\prime}_{i} of S_{i} , such that sim(S_{c},S^{\prime}_{i}) is the mean of the similarities of each step in both sequences. Similarity of user instruction steps is done by cosine similarity of their embeddings; and function call steps are matched if they have the same function name. This scheme gives higher weight to similar sequences of tools, but allows similarity comparison if workflow steps done by agents using no tools. With the most similar workflows in hand, the agent builds a prompt with textual representations of the selected and current workflows and ask an LLM to produce the most likely next steps for the current one. If no similar workflow can be found, the agent provides the LLM with an