Memory Base Component

Estimated reading: 7 minutes

The Memory Base component gives Robility Flow workflows long-term conversational memory. Instead of treating each user message as a new, isolated interaction, it allows a flow to recall past conversations and user preferences, bringing relevant context into the current step.

The component runs a semantic search against a designated Memory Base, a flow-specific vector store of past interactions. The most relevant past messages are returned as a DataFrame, which can be connected to an LLM or Agent component so its responses reflect earlier exchanges.

Why Use This Component?

Large Language Models (LLMs) are stateless. They keep no memory between requests, so once a response is returned, everything from that exchange is gone. The common workaround is pasting the entire chat history into every new prompt, which creates two major problems:

1. Token bloat and high costs: Sending thousands of lines of old chat logs on every turn slows responses and significantly increases API costs.
2. Context window limits and noise: Feeding an LLM too much irrelevant history reduces accuracy and can exceed the model’s maximum token limit.

The Memory Base component solves this through targeted recall:

a. Fetch only what matters: Searches past conversations and retrieves only the messages relevant to the user’s current question.
b. Cross-session continuity: Allows users to close a chat, return days later, and continue where they left off without repeating themselves.
c. Personalization: Remembers a user’s name, role, past issues, or preferences across sessions.
d. Lower latency and token usage: Lean prompts containing only relevant context make flows faster, cheaper, and more accurate.

What Is a Memory Base?

A Memory Base is a flow-level memory store created with the Create Memory option. It stores conversation data in a configured vector database, using an embedding model to convert messages into searchable vectors.

Each Memory Base is scoped to a specific flow and can only be accessed within that flow. For details on setup, refer to the Create Memory documentation.

Prerequisites

Before using the Memory Base component, ensure that:

a. A Memory Base has been created and attached to the current flow.
b. A DB Provider is configured and active for the project.
c. An embedding model is configured and available.
d. A valid session ID is provided when Filter by Session is enabled.

How It Works

1. Search Query: Receives the search text provided directly in the component or supplied dynamically by an Agent in Tool Mode.
2. Embedding Generation: Converts the query into a vector embedding using the configured embedding model.
3. Similarity Search: Compares the query embedding against stored embeddings in the selected Memory Base.
4. Session Filtering: Applies session or user-level filtering based on your Filter by Session setting.
5. Top K Retrieval: Selects the highest-scoring matching records up to the Top K Results limit.
6. DataFrame Output: Outputs the retrieved records as a structured DataFrame.

Parameters

Parameter Default Description
Memory Base* — Selects the Memory Base to search. Displays Memory Bases attached to the current flow and available to the flow owner.
Search Query* — The text used to search stored conversations. Cannot be empty during standard execution. In Tool Mode, the Agent supplies this value dynamically.
Top K Results 5 The maximum number of relevant records to retrieve. See Choosing Top K Results for guidance.
Include Metadata Enabled Controls whether extra context details are attached to the output:
Enabled: Includes extra details (session_id, sender, and timestamp) alongside each message.
Disabled: Excludes extra metadata and returns only the message text and similarity score.
Filter by Session Enabled Controls which conversations are searched:
Enabled: Searches only the current chat session (requires a valid session_id).
Disabled: Searches across all past chat sessions belonging to the same user within the selected Memory Base.
See Current Chat vs. All Past Chats below.

Current Chat vs. All Past Chats (Session Filtering & Serving Mode)

The Filter by Session toggle controls how far back the flow looks for memories. Its exact behavior depends on whether you are running the flow internally or publishing it as a live app (Serving Mode):

Filter by Session Standard & API Execution Serving Mode
Enabled (Current chat only) Searches only the current chat session. If you trigger the flow via an API call or schedule, you must include a session_id in your request (see example below), or the component will show an error. Searches only the current chat that the end user is having right now.
Disabled (All past chats) Searches across all past chats belonging to the same user inside this flow's Memory Base. Searches across all past chats belonging to that specific end user.

Example API Request with a Session ID:
When running via the Flow API or a schedule with Filter by Session enabled, pass the session ID like this:

{
  "session_id": "session_12345"
}

Note: Regardless of your session settings, the component only ever searches the selected Memory Base for the current flow. It never pulls data from other users or other flows.

Choosing Top K Results

Use the following guidelines to configure Top K Results based on how much historical context your flow needs:

Use Case Suggested Top K
Retrieving specific facts or single answers 1–3
Customer support conversations 3–5
General conversation recall 5
Project or task history 5–10
Detailed historical analysis 10

Output

Output Name Description
Output Returns the retrieved conversation records along with a _score field indicating semantic similarity. If Include Metadata is enabled, session_id, sender, and timestamp columns are also included.

Using Memory Base in Tool Mode

Tool Mode allows an Agent to invoke the Memory Base component autonomously whenever it decides past context is needed, rather than running it at a fixed step in the flow.

Steps

1. Add the Memory Base component to your flow and select the target Memory Base.
2. Enable Tool Mode in the component configuration.
3. Open the Actions section and define a clear Tool Name and Tool Description (the Agent uses this description to decide when to search memory).
4. Connect the component to the Agent’s available tools port.

Example Agent Flow: User Input → Deep Agent ⇄ Memory Base (Tool Mode) → Agent Response

Common Use Cases

a. Customer Support: Recall past troubleshooting steps and ticket details to provide consistent support without asking the user to repeat information.
b. User Preferences: Disable Filter by Session to remember user preferences, roles, or formatting choices across separate sessions.
c. Project Context: Retrieve previously agreed-upon requirements and decisions during ongoing project workflows.
d. Task History: Track completed and pending tasks across multi-turn interactions.

Best Practices

a. Write descriptive Tool Descriptions: When using Tool Mode, explicitly state what is stored in the Memory Base (e.g., “Search past user preferences and project requirements”) so the Agent knows when to trigger it.
b. Balance Top K with prompt size: Avoid setting Top K unnecessarily high; retrieving 10+ records for simple Q&A reintroduces token bloat and noise.
c. Disable Include Metadata when unused: If downstream prompts only need the message text, disabling metadata keeps the DataFrame payload cleaner.

Limitations

a. Read-only retrieval: The Memory Base component only retrieves stored records; it does not write or save new messages to the Memory Base.
b. Single-flow scope: It cannot query Memory Bases belonging to other flows or other users.
c. Semantic dependency: Retrieval quality depends on semantic similarity between the search query and stored text; exact keyword matches are not guaranteed.

Share this Doc

Memory Base Component

Or copy link

CONTENTS
Robility Chatbot
Robility Assistant
Online