Memory Execution Flow

Estimated reading: 7 minutes

Memory captures conversation exchanges, processes and indexes them into vector storage, and retrieves relevant historical context using the Memory Base component in Robility Flow. The example below shows how a conversation moves from initial message capture to cross-session retrieval and response generation. The exact steps may vary depending on the Memory Base configuration, batching settings, and session filters used.

Example Use Case: Cross-Session Technical Recall

In this example, Memory retains technical discussions from an initial session and the Memory Base component retrieves those records in a later session without requiring the user to repeat prior context.

Use Case Summary

Task: Retain technical implementation details discussed in an initial conversation, store them in a vector database, and recall them when asked a follow-up question in a new session.
Input: Multi-turn chat messages submitted through the Playground across two separate sessions.
Expected output: A context-aware response in the second session generated using Memory Records retrieved from the first session.

What Memory Does

a. Captures user prompts and AI responses emitted during flow execution.
b. Holds captured exchanges in Pending status until the configured Batch Size threshold is reached.
c. Optionally summarizes each batch with the Preprocessing Model, converts the text into vector embeddings, and stores them in the Vector Database.
d. Retrieves the most semantically similar Memory Records through the Memory Base component when invoked by the Agent.

The following sections explain how these actions are carried out.

1. Provision the Memory Base and Flow Configuration

A Memory Base manages background conversation batching, summarization, embedding, and storage automatically during flow execution, removing the requirement for canvas storage components.

a. Memory Base: Set up in the Memories panel to define the embedding model, vector database, batch size, and optional preprocessing rules.
b. Embedding Model: Transforms text into vectors (e.g., Qwen3-Embedding-4B via vLLM).
c. Vector Database: Stores vectors and metadata using configured DB providers (e.g., Postgres pgVector).
d. Batch Size & Preprocessing: Controls accumulation volume before indexing and optional pre-summarization via preprocessing models.

One-time storage setup ensures automatic background ingestion for all subsequent flows

 

Figure 1. Memory Base configuration in the Create Memory dialog

2. Establish the Flow and Retrieval Context

Connect the user input, Agent, and Memory Base components on the Designer Canvas to query stored records at runtime:

a. Chat Input: Passes the user message to the Agent’s Input port.
b. Memory Base: Connects to your target Memory Base using the RETRIEVE_MEMORY action, with Tool Mode enabled to expose a Toolset output.
c. Agent: Runs on a configured Language Model and Agent Instructions, receiving the Toolset on its Tools port to search long-term memory.
d. Chat Output: Captures the Agent’s Response and returns the final reply to the user.

(Note: Only the specific Memory Base linked in the component is queried during execution.)

Figure 2. Flow configuration with Chat Input, Memory Base component in Tool Mode, Agent, and Chat Output

3. Capture Runtime Exchanges

When a user chats in the Playground or triggers an API run, Memory automatically captures each exchange:

1. The user sends a prompt in Session 1 (e.g., “how to implement this ‘Hidden Thought’ pattern using a specific framework”).
2. The Agent processes the prompt and returns a reply through Chat Output.
3. Memory captures both the User prompt and Machine (AI) response, pairs them under a shared Job ID, and places them in Pending status.

As the user asks technical follow-up questions, Memory records each turn sequentially.

Figure 3. Runtime conversation captured in the first Playground session

4. Batch and Preprocess Captured Messages

Once exchanges enter the Memory Base queue, Memory applies the batching and preprocessing settings before indexing them.

a. Batch evaluation: Each exchange (one user message and its AI response) counts toward the Batch Size.
i. If Batch Size is 1, each exchange is indexed immediately.
ii. If Batch Size is greater than 1, exchanges stay in Pending status until the Batch Size is reached, then are indexed together.
For example, with a Batch Size of 5, the first four exchanges remain Pending. When the fifth arrives, all five are indexed.

b. LLM preprocessing (optional): When enabled, the Preprocessing Model processes each batch using the Preprocessing Instructions before indexing. This can summarize conversations, retain key topics, decisions, and preferences, and remove greetings, acknowledgments, and other low-value content.

c. Activation gating: Exchanges are processed only while the Memory Base is Active. While it is Inactive, incoming exchanges stay in Pending status and are not indexed. On reactivation, all pending exchanges are indexed immediately.

5. Embed and Persist Memory Records

After batching and optional preprocessing, Memory converts the text into vectors and stores them in the Vector Database:

1. The Embedding Model generates vector embeddings for each chunk.
2. The vectors and metadata (Sender, Job ID, Content, Session ID, and Ingestion Timestamp) are saved to the Vector Database.
3. Records move from Pending to Processed, updating the summary counters on the Memories page.

Opening a Memory Base in the Memories view shows its active status, summary metrics, total chunks (e.g., 33 chunks), and a table of stored records paired by Job ID.

Figure 4. Stored Memory Records and summary metrics on the Memories page

6. Evaluate Retrieval Need on a New Prompt

When a user starts a new session or asks a follow-up question that depends on earlier context, execution shifts from background storage to active retrieval:

a. The user opens a new Playground session and asks a follow-up question (e.g., “What did we discuss earlier about the Hidden Thought pattern?”).
b. Chat Input sends the prompt to the Agent.
c. The Agent recognizes that past context is required and invokes RETRIEVE_MEMORY on the connected Memory Base component.

7. Query the Vector Database and Apply Session Scope

When the Agent invokes RETRIEVE_MEMORY, the Memory Base component searches the attached Memory Base for relevant records:

a. Query embedding: Converts the search query into a vector using the Memory Base’s Embedding Model.
b. Session scope filtering (Filter by Session): Sets the search boundary:
Off: Searches across all sessions, allowing a new session to recall earlier conversations.
On: Limits retrieval to the active Session ID to keep each user’s memories isolated.
c. Similarity matching: Returns the closest matching Memory Records from the Vector Database to the Agent

8. Apply Lifecycle Controls and Data Governance

Manage ingestion and stored data directly from the Memories page:

a. Activate toggle: Pauses or resumes indexing. While inactive, new exchanges stay in Pending status without being embedded.
b. Session filter and refresh: Filters records by Session ID (defaults to All Sessions) and refreshes metrics on demand.
c. Permanent deletion: Clicking Delete permanently removes the Memory Base and all its vectors. Since individual records cannot be edited or deleted, avoid sending sensitive data like PII or credentials through Memory-enabled flows

9. Generate the Context-Aware Response

Once the Memory Base component returns matching records, the Agent creates the final reply:

a. Context integration: Combines the retrieved Memory Records with the current prompt and Agent Instructions.
b. Response delivery: Sends the reply through Chat Output, referencing earlier details without the user needing to repeat them.
c. Continuous capture: Automatically saves the new prompt and response to Memory for future turns.

Figure 5. Context-aware response generated in a new session using retrieved Memory Records

Execution Flow at a Glance

End-to-End Memory Lifecycle

1. Automatic Ingestion (Memory)
Provision Memory Base  ➞  Capture exchange  ➞  Evaluate Batch Size  ➞  Preprocess (optional)  ➞  Embed & store vectors
2. Runtime Retrieval (Memory Base Component)
Receive prompt  ➞  Evaluate retrieval need  ➞  Invoke RETRIEVE_MEMORY  ➞  Apply session scope  ➞  Return matching records  ➞  Generate context-aware response
This outlines the general workflow rather than a fixed sequence for every request. Depending on your Batch Size, LLM Preprocessing, and Filter by Session settings, exchanges may be indexed immediately or in batches, and retrieval can span all sessions or stay isolated to a single session.
Share this Doc

Memory Execution Flow

Or copy link

CONTENTS
Robility Chatbot
Robility Assistant
Online