Skip to content

feat: combine chat history and chat store into a CRUD component#8323

Merged
Yukiyukiyeah merged 60 commits into
mainfrom
combine-message-store-and-history
Jun 5, 2025
Merged

feat: combine chat history and chat store into a CRUD component#8323
Yukiyukiyeah merged 60 commits into
mainfrom
combine-message-store-and-history

Conversation

@Yukiyukiyeah
Copy link
Copy Markdown
Contributor

@Yukiyukiyeah Yukiyukiyeah commented Jun 2, 2025

Summary by CodeRabbit

  • New Features

    • Enhanced the Memory component and related agents to support both storing and retrieving chat messages with a mode selector ("Store" or "Retrieve").
    • Added a new input for chat messages and dynamic input/output visibility based on the selected mode.
    • Introduced a Type Converter component to convert between Message, Data, and DataFrame formats dynamically.
  • Improvements

    • Updated component and agent descriptions to reflect dual-mode functionality.
    • Made the "order" input required across multiple agents and starter projects for improved validation.
    • Streamlined outputs in the Memory component to a single dynamic output based on mode.
  • Bug Fixes

    • Adjusted context handling in prompt components to use converted message dataframes for consistency.
  • Tests

    • Updated tests to incorporate the Type Converter component and reflect new input/output flows.
    • Removed outdated UI test assertions related to message history visibility.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2025

Walkthrough

This update introduces a dual-mode ("Store" and "Retrieve") operation to the Memory component and related agent components across backend and starter project configurations. Inputs and outputs are dynamically adjusted based on the selected mode, enabling both storing and retrieval of chat messages. Associated test code and starter project templates are updated to reflect these changes, including conversion of retrieved messages to DataFrame and message formats.

Changes

File(s) Change Summary
src/backend/base/langflow/components/helpers/memory.py Refactored MemoryComponent to support "Store" and "Retrieve" modes with dynamic inputs/outputs, added message storing logic, renamed and added methods, and updated build config.
src/backend/base/langflow/components/helpers/store_message.py Added legacy = True attribute to MessageStoreComponent.
src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json
src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json
src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json
Updated "Memory" component: supports storing/retrieving messages, dynamic mode-based inputs/outputs, new methods for storing and retrieving messages as DataFrames.
src/backend/base/langflow/initial_setup/starter_projects/Financial Agent.json
src/backend/base/langflow/initial_setup/starter_projects/Gmail Agent.json
src/backend/base/langflow/initial_setup/starter_projects/Instagram Copywriter.json
src/backend/base/langflow/initial_setup/starter_projects/Invoice Summarizer.json
src/backend/base/langflow/initial_setup/starter_projects/Market Research.json
src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json
src/backend/base/langflow/initial_setup/starter_projects/Pokédex Agent.json
src/backend/base/langflow/initial_setup/starter_projects/Price Deal Finder.json
src/backend/base/langflow/initial_setup/starter_projects/Research Agent.json
src/backend/base/langflow/initial_setup/starter_projects/SaaS Pricing.json
src/backend/base/langflow/initial_setup/starter_projects/Search agent.json
src/backend/base/langflow/initial_setup/starter_projects/Sequential Tasks Agents.json
src/backend/base/langflow/initial_setup/starter_projects/Simple Agent.json
src/backend/base/langflow/initial_setup/starter_projects/Social Media Agent.json
src/backend/base/langflow/initial_setup/starter_projects/Travel Planning Agents.json
src/backend/base/langflow/initial_setup/starter_projects/Youtube Analysis.json
Added "message" and "mode" inputs to Agent components; made "order" input required in all affected starter projects.
src/backend/base/langflow/initial_setup/starter_projects/memory_chatbot.py Changed context for PromptComponent.set from text retrieval to message conversion from DataFrame retrieval.
src/backend/tests/unit/graph/graph/test_graph_state_model.py
src/backend/tests/unit/initial_setup/starter_projects/test_memory_chatbot.py
Updated tests to use message conversion from DataFrame for prompt context instead of direct text retrieval.
src/frontend/tests/core/features/filterSidebar.spec.ts Removed assertions related to visibility of "helpersMessage History" element.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant MemoryComponent
    participant Storage

    User->>MemoryComponent: Select mode ("Store" or "Retrieve") and provide inputs

    alt mode == "Store"
        User->>MemoryComponent: Provide message input
        MemoryComponent->>Storage: Store message
        Storage-->>MemoryComponent: Confirmation / stored message
        MemoryComponent-->>User: Return stored message info
    else mode == "Retrieve"
        User->>MemoryComponent: Provide retrieval parameters
        MemoryComponent->>Storage: Retrieve messages
        Storage-->>MemoryComponent: Messages DataFrame
        MemoryComponent-->>User: Return messages as DataFrame
    end
Loading

Suggested labels

size:L

Suggested reviewers

  • edwinjosechittilappilly
  • ogabrielluiz
  • mendonk

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 324cb95 and 707d815.

⛔ Files ignored due to path filters (1)
  • src/frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • src/frontend/tests/core/integrations/Custom Component Generator.spec.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: Ruff Style Check (3.13)
  • GitHub Check: Lint Backend / Run Mypy (3.10)
  • GitHub Check: Lint Backend / Run Mypy (3.11)
  • GitHub Check: Lint Backend / Run Mypy (3.12)
  • GitHub Check: Lint Backend / Run Mypy (3.13)
  • GitHub Check: Test Docs Build / Test Docs Build
  • GitHub Check: build-and-deploy
  • GitHub Check: Optimize new Python code in this PR
  • GitHub Check: Run Ruff Check and Format
  • GitHub Check: Ruff Style Check (3.13)
  • GitHub Check: Update Starter Projects
🔇 Additional comments (1)
src/frontend/tests/core/integrations/Custom Component Generator.spec.ts (1)

47-47: Good improvement to test element targeting specificity.

Adding .locator("input") enhances the precision of element selection by ensuring the fill action targets the actual input element within the container rather than the container itself. This follows Playwright best practices and makes the test more robust against UI structure changes.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Yukiyukiyeah Yukiyukiyeah changed the title combine history and store feat: combine chat history and chat store into a CRUD component Jun 2, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jun 2, 2025
@Yukiyukiyeah Yukiyukiyeah marked this pull request as ready for review June 2, 2025 19:35
@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Jun 2, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jun 2, 2025
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 18

🔭 Outside diff range comments (4)
src/backend/base/langflow/initial_setup/starter_projects/Research Agent.json (1)

990-995: 🛠️ Refactor suggestion

⚠️ Potential issue

Missing message in field_order.
The newly introduced message input isn’t listed in the Agent node’s field_order array, so it won’t appear in the intended UI sequence. Please insert "message" (for example, right after "memory"):

   "field_order": [
     ...,
     "memory",
+    "message",
     "sender",
     "sender_name",
     ...
   ],
src/backend/base/langflow/initial_setup/starter_projects/Search agent.json (1)

1024-1049: 🛠️ Refactor suggestion

Missing "message" in field_order causes the new input to be invisible.

The newly added "message" template entry won’t show up in the UI unless it’s also listed in the parent field_order. Please insert "message" at the appropriate position (e.g., right after "memory") so it renders correctly.

Example diff:

   "field_order": [
     "agent_llm",
     ...,
     "memory",
+    "message",
     "sender",
     ...
     "template",
     "add_current_date_tool"
   ],
src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json (1)

96-100: 💡 Verification agent

❓ Verification inconclusive

Edge mappings for Memory output need updating
The edges connecting the old messages_text output handle of the Memory node have empty output_types and still reference "messages_text". Since the Memory component outputs have been replaced by dataframe and stored_messages, these edges will no longer work. Please update or remove these edges to use the correct output handles (e.g., "dataframe" or "stored_messages") so that downstream nodes receive the expected data.

Also applies to: 114-115


Update Memory node edge mappings in Meeting Summary.json
The edge definitions at lines 96–100 and 114–115 still reference the old "messages_text" handle with empty output_types. Since the Memory component now exposes "dataframe" and "stored_messages" outputs, these mappings must be updated so downstream nodes receive the correct data.

• File: src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json
– Lines 96–100
– Lines 114–115

Suggested diff for each occurrence:

-   "sourceHandle": {
-     "dataType": "Memory",
-     "id": "Memory-9SYWU",
-     "name": "messages_text",
-     "output_types": []
+   "sourceHandle": {
+     "dataType": "Memory",
+     "id": "Memory-9SYWU",
+     "name": "stored_messages",    // or "dataframe" depending on the downstream node
+     "output_types": ["list"]      // adjust to the correct output type(s)

Please update both occurrences to use the proper handle ("stored_messages" or "dataframe") and populate output_types accordingly.

src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (1)

7-12: 🛠️ Refactor suggestion

Mismatch between Memory output handle and updated component outputs

The edge’s sourceHandle still uses "name": "messages_text" with an empty output_types. It should reference the new dataframe output and include DataFrame in output_types, otherwise the graph connection will break.

Proposed diff:

 "sourceHandle": {
-  "dataType": "Memory",
-  "id": "Memory-gWJrq",
-  "name": "messages_text",
-  "output_types": []
+  "dataType": "Memory",
+  "id": "Memory-gWJrq",
+  "name": "dataframe",
+  "output_types": ["DataFrame"]
 }
♻️ Duplicate comments (2)
src/backend/base/langflow/initial_setup/starter_projects/Travel Planning Agents.json (2)

2713-2735: Duplicate of previous comment: 'message' missing from field_order.

This Agent node also adds "message" to its template without updating its field_order. Please apply the same field_order adjustment here to ensure the input is displayed correctly.


3435-3457: Duplicate of previous comment: 'message' missing from field_order.

This Agent node likewise needs "message" included in its field_order. Please update as outlined above.

🧹 Nitpick comments (4)
src/backend/base/langflow/components/helpers/store_message.py (1)

15-15: Add legacy = True to mark this component as deprecated
The legacy = True flag correctly categorizes this component as part of the legacy message store. To improve developer awareness, consider emitting a deprecation warning at instantiation and updating documentation or migration guides so users adopt the new CRUD-based component instead.

src/backend/base/langflow/initial_setup/starter_projects/Gmail Agent.json (1)

411-433: Verify message input placement and connectivity
The new "message" field aligns with the MemoryComponent’s signature and is configured correctly (MessageTextInput, tool_mode, trace_as_input, trace_as_metadata, etc.).

Please ensure:

  1. The "message" key is included in the field_order array so it renders in the UI.
  2. (Optional) If you want incoming chat entries to auto-populate this field, add an edge mapping from ChatInputAgent on message.
src/backend/base/langflow/components/helpers/memory.py (1)

130-137: Tiny nit – drop async call overhead when not needed

retrieve_messages_dataframe calls the entire retrieval stack even when n_messages == 0. You could short-circuit and return an empty DataFrame to save one DB/memory round-trip:

if self.n_messages == 0:
    return DataFrame([])
src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json (1)

305-327: New message input lacks dynamic=True & metadata flags

For parity with other message inputs (e.g., ChatInput, Prompt.tool_placeholder) you may want:

- "dynamic": false,
+ "dynamic": true,

and possibly "trace_as_input": true so the playground correctly records user-provided chat content.

Minor, but helps tooling consistency.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 21af370 and 73dfda6.

📒 Files selected for processing (21)
  • src/backend/base/langflow/components/helpers/memory.py (3 hunks)
  • src/backend/base/langflow/components/helpers/store_message.py (1 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json (6 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Financial Agent.json (2 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Gmail Agent.json (1 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Instagram Copywriter.json (1 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Invoice Summarizer.json (1 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Market Research.json (1 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json (6 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (6 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json (1 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Pokédex Agent.json (1 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Price Deal Finder.json (1 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Research Agent.json (1 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/SaaS Pricing.json (1 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Search agent.json (1 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Sequential Tasks Agents.json (3 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Simple Agent.json (1 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Social Media Agent.json (1 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Travel Planning Agents.json (3 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Youtube Analysis.json (1 hunks)
🧰 Additional context used
🪛 Pylint (3.3.7)
src/backend/base/langflow/components/helpers/memory.py

[convention] 16-16: Line too long (104/100)

(C0301)


[convention] 22-22: Line too long (119/100)

(C0301)


[convention] 14-14: Missing class docstring

(C0115)


[convention] 77-77: Line too long (110/100)

(C0301)


[convention] 79-79: Line too long (117/100)

(C0301)


[convention] 155-155: Line too long (110/100)

(C0301)


[convention] 163-163: Line too long (105/100)

(C0301)


[convention] 169-169: Line too long (107/100)

(C0301)


[convention] 139-139: Missing function or method docstring

(C0116)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Update Starter Projects
  • GitHub Check: Optimize new Python code in this PR
🔇 Additional comments (15)
src/backend/base/langflow/initial_setup/starter_projects/Research Agent.json (1)

1257-1279: New message input block looks correct and consistent.
The addition mirrors other MessageTextInput inputs in this template:

  • _input_type, display_name, and input_types are aligned with existing fields (e.g., sender_name).
  • Flags like advanced, tool_mode, trace_as_input, and trace_as_metadata follow the established pattern.
  • The default "value": "" and type "str" are appropriate.
src/backend/base/langflow/initial_setup/starter_projects/Simple Agent.json (1)

1536-1558: New message input aligns with MemoryComponent schema.

The MessageTextInput definition (with input_types: ["Message"], tool_mode: true, and tracing flags) correctly mirrors the corresponding input in MemoryComponent.inputs. This will enable agents to accept and store chat messages as intended.

src/backend/base/langflow/initial_setup/starter_projects/Invoice Summarizer.json (1)

1505-1527: Add message input for storing chat messages
The new message field is correctly introduced as a MessageTextInput with tool_mode enabled and proper tracing flags (trace_as_input, trace_as_metadata). This aligns the Agent component’s input schema with the MemoryComponent enhancements applied across other starter project templates.

src/backend/base/langflow/initial_setup/starter_projects/Instagram Copywriter.json (1)

1627-1649: Add message input for chat storage
The new "message" field aligns with other MessageTextInput definitions and enables agents to accept a chat message for persistence. Its properties (advanced, tool_mode, trace flags) mirror existing inputs. Please verify that the AgentComponent’s Python side consumes this message input (e.g., passes it into MemoryComponent.set(message=...)) so that storing messages works end-to-end.

src/backend/base/langflow/initial_setup/starter_projects/Financial Agent.json (2)

2603-2625: Add message input to Agent-cGZsD for chat storage

This block correctly introduces a MessageTextInput named message to the Agent-cGZsD component, aligning with the updated MemoryComponent API. The input’s settings (advanced, tool_mode, trace_as_input/metadata) mirror other components and support chat message persistence.


3330-3352: Add message input to Agent-wqbpC for chat storage

Likewise, the second agent instance (Agent-wqbpC) receives the same message input configuration, ensuring both agent nodes can accept and store chat messages consistently.

src/backend/base/langflow/components/helpers/memory.py (1)

148-156: Missing capability check for external memory

store_message uses aadd_messages and aget_messages without verifying they exist on the injected memory object (only aget_messages is checked in retrieve_messages).

Add a defensive guard similar to:

if self.memory and not all(hasattr(self.memory, m) for m in ("aadd_messages", "aget_messages")):
    raise AttributeError("External Memory object must implement 'aadd_messages' and 'aget_messages'.")
🧰 Tools
🪛 Pylint (3.3.7)

[convention] 155-155: Line too long (110/100)

(C0301)

src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json (1)

12-13: output_types list cleared – may break type-checking in front-end

"output_types": [] was previously ["Message"].
Several downstream edges (e.g., edge to Prompt expecting "Message" or "Text") still treat this handle as producing a Message. An empty list can cause validation errors in the UI and at runtime.

Please restore the "Message" type or confirm that the consumer nodes tolerate an un-typed handle.

src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json (3)

2460-2460: Memory component description updated to reflect storing + retrieving
The new description clearly communicates the dual functionality of the Memory component. This aligns with the updated inputs and outputs.


2483-2491: Approve DataFrame output configuration
The retrieve_messages_dataframe method is correctly exposed as a dynamic DataFrame output named "dataframe" with display name "Messages". This replaces the previous text‐only output and aligns with the component enhancements.


2497-2500: Approve hidden stored‐messages output
The hidden output "stored_messages" invoking store_message is properly configured and marked hidden to separate store and retrieve flows.

src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (4)

800-800: Updated description correctly reflects storing and retrieving capabilities

The component’s description now clearly mentions both storage and retrieval of chat messages, improving clarity.


823-830: Approve new dynamic “Messages” output

The “Messages” output is correctly configured to call retrieve_messages_dataframe and return a DataFrame.


834-840: Approve new hidden “Stored Messages” output

The hidden Stored Messages output is properly set to invoke store_message and return a Message.


851-868: Skipping in-depth review of serialized code block

The code string holds the Python implementation of the component—detailed review should be done in the corresponding helper module (src/backend/base/langflow/components/helpers/memory.py).

Comment on lines +1442 to +1464
"message": {
"_input_type": "MessageTextInput",
"advanced": true,
"display_name": "Message",
"dynamic": false,
"info": "The chat message to be stored.",
"input_types": [
"Message"
],
"list": false,
"list_add_label": "Add More",
"load_from_db": false,
"name": "message",
"placeholder": "",
"required": false,
"show": true,
"title_case": false,
"tool_mode": true,
"trace_as_input": true,
"trace_as_metadata": true,
"type": "str",
"value": ""
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Missing ‘message’ in field_order
The newly added advanced message input is not included in the component’s field_order, so it may not surface correctly in the UI or be ordered as expected.

Add "message" right after "memory" in the "field_order" array:

--- a/src/backend/base/langflow/initial_setup/starter_projects/Youtube Analysis.json
+++ b/src/backend/base/langflow/initial_setup/starter_projects/Youtube Analysis.json
@@ "field_order": [
-            "memory",
+            "memory",
+            "message",
             "sender",
🤖 Prompt for AI Agents
In src/backend/base/langflow/initial_setup/starter_projects/Youtube
Analysis.json around lines 1442 to 1464, the newly added "message" input field
is missing from the component's "field_order" array. To fix this, locate the
"field_order" array in the same component and insert the string "message"
immediately after "memory" to ensure the field appears correctly and in the
expected order in the UI.

Comment on lines +1919 to +1941
"message": {
"_input_type": "MessageTextInput",
"advanced": true,
"display_name": "Message",
"dynamic": false,
"info": "The chat message to be stored.",
"input_types": [
"Message"
],
"list": false,
"list_add_label": "Add More",
"load_from_db": false,
"name": "message",
"placeholder": "",
"required": false,
"show": true,
"title_case": false,
"tool_mode": true,
"trace_as_input": true,
"trace_as_metadata": true,
"type": "str",
"value": ""
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Ensure the new message input is included in the UI order

You’ve added the "message" field to the Agent’s template, but the node’s "field_order" list (earlier under "node") doesn’t include "message". Without updating "field_order", this input won’t appear in the UI or flow correctly. Please insert "message" in the "field_order" array at the desired position (for example, immediately after "memory").

🤖 Prompt for AI Agents
In src/backend/base/langflow/initial_setup/starter_projects/Price Deal
Finder.json between lines 1919 and 1941, the newly added "message" input field
is missing from the node's "field_order" array. To fix this, locate the
"field_order" list earlier in the file under the "node" section and insert
"message" at the appropriate position, such as immediately after "memory", to
ensure it appears in the UI and is processed correctly in the flow.

Comment on lines +1237 to +1259
"message": {
"_input_type": "MessageTextInput",
"advanced": true,
"display_name": "Message",
"dynamic": false,
"info": "The chat message to be stored.",
"input_types": [
"Message"
],
"list": false,
"list_add_label": "Add More",
"load_from_db": false,
"name": "message",
"placeholder": "",
"required": false,
"show": true,
"title_case": false,
"tool_mode": true,
"trace_as_input": true,
"trace_as_metadata": true,
"type": "str",
"value": ""
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Missing addition to field_order for the new input.

The new "message" field is defined under the Agent template, but it isn't included in the Agent node’s field_order array. Without adding "message" to field_order, the UI won’t render this input. Please update the field_order list in the Agent node metadata to include "message" (e.g., right after "memory").

Proposed diff:

@@ "field_order": [
-        "memory",
+        "memory",
+        "message",
         "sender",

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json
around lines 1237 to 1259, the new "message" input field is defined but not
included in the Agent node's "field_order" array. To fix this, locate the
"field_order" array in the Agent node metadata and add "message" to it,
preferably right after "memory", so the UI will render the new input field
correctly.

Comment on lines 1612 to 1634
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

⚠️ Potential issue

Missing message in field ordering and wiring

The new message input is defined in the Agent’s template but:

  1. It’s not listed in the node’s "field_order", so it won’t appear in the UI.
  2. There’s no edge mapping a ChatInput message to this new port.

Please apply these essential fixes:

--- a/src/backend/base/langflow/initial_setup/starter_projects/Pokédex Agent.json
@@ "field_order": [
-    "memory",
+    "memory",
+    "message",
     "sender",
     "sender_name",
--- a/src/backend/base/langflow/initial_setup/starter_projects/Pokédex Agent.json
@@ "edges": [
   {
     "data": {
       "sourceHandle": {
         "dataType": "ChatInput",
         "id": "ChatInput-ZNO2E",
         "name": "message",
         "output_types": ["Message"]
       },
       "targetHandle": {
-        "fieldName": "input_value",
+        "fieldName": "message",
         "id": "Agent-iU8sJ",
         "inputTypes": ["Message"],
         "type": "str"
       }
     },

These changes will surface the new port in the UI and wire it correctly.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"message": {
"_input_type": "MessageTextInput",
"advanced": true,
"display_name": "Message",
"dynamic": false,
"info": "The chat message to be stored.",
"input_types": [
"Message"
],
"list": false,
"list_add_label": "Add More",
"load_from_db": false,
"name": "message",
"placeholder": "",
"required": false,
"show": true,
"title_case": false,
"tool_mode": true,
"trace_as_input": true,
"trace_as_metadata": true,
"type": "str",
"value": ""
},
--- a/src/backend/base/langflow/initial_setup/starter_projects/Pokédex Agent.json
@@ "field_order": [
- "memory",
+ "memory",
+ "message",
"sender",
"sender_name",
@@ "edges": [
{
"data": {
"sourceHandle": {
"dataType": "ChatInput",
"id": "ChatInput-ZNO2E",
"name": "message",
"output_types": ["Message"]
},
"targetHandle": {
- "fieldName": "input_value",
+ "fieldName": "message",
"id": "Agent-iU8sJ",
"inputTypes": ["Message"],
"type": "str"
}
},
🤖 Prompt for AI Agents
In src/backend/base/langflow/initial_setup/starter_projects/Pokédex Agent.json
around lines 1612 to 1634, the new "message" input is missing from the node's
"field_order" array and lacks an edge mapping from the ChatInput message to this
port. To fix this, add "message" to the "field_order" list to ensure it appears
in the UI, and create an edge that connects the ChatInput message output to the
"message" input port to properly wire the data flow.

Comment on lines +157 to +159
if message.sender:
stored_messages = [m for m in stored_messages if m.sender == message.sender]
else:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Filtering inconsistency (sender vs type)

retrieve_messages later filters on m.type, but here the post-store filter uses m.sender, yielding mismatched behaviour for LangChain messages converted with Message.from_lc_message, where sender and type are synonyms but only one side is updated.

Consider standardising on a single field (type is the one already used in retrieval) to avoid silent mismatches.

🤖 Prompt for AI Agents
In src/backend/base/langflow/components/helpers/memory.py around lines 157 to
159, the filtering uses m.sender while later retrieval filters on m.type,
causing inconsistent behavior for LangChain messages where sender and type are
synonyms but not always both set. To fix this, standardize the filtering to use
m.type consistently instead of m.sender to avoid silent mismatches.

Comment on lines +21 to 24
MessageTextInput(
name="message", display_name="Message", info="The chat message to be stored.", tool_mode=True, dynamic=True
),
HandleInput(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

message input should be marked as required or validated at runtime

store_message unconditionally dereferences self.message.
If the user leaves the field empty (it is currently not required=True), the method will either:

  1. create an empty Message(text=""); or
  2. fail with TypeError when the value is None.

Either case yields an unexpected UX and may break downstream flows.

Diff suggestion – either make the field required or add a runtime guard:

 MessageTextInput(
     name="message", display_name="Message", info="The chat message to be stored.", tool_mode=True, dynamic=True
+    , required=True
 )

or

if not self.message:
    raise ValueError("`message` input cannot be empty when `store_message` is invoked.")
🧰 Tools
🪛 Pylint (3.3.7)

[convention] 22-22: Line too long (119/100)

(C0301)

🤖 Prompt for AI Agents
In src/backend/base/langflow/components/helpers/memory.py around lines 21 to 24,
the "message" input is not marked as required, which can lead to empty or None
values causing errors or unexpected behavior in store_message. Fix this by
either setting required=True on the MessageTextInput definition to enforce input
presence or add a runtime check in store_message that raises a ValueError if
self.message is empty or None before proceeding.

Comment on lines +139 to +146
async def store_message(self) -> Message:
message = Message(text=self.message) if isinstance(self.message, str) else self.message

message.session_id = self.session_id or message.session_id
message.sender = self.sender or message.sender or MESSAGE_SENDER_AI
message.sender_name = self.sender_name or message.sender_name or MESSAGE_SENDER_NAME_AI

stored_messages: list[Message] = []
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Sender normalisation bug – "Machine and User" is written back to the DB

self.sender defaults to "Machine and User" (a retrieval-only meta option).
With the current assignment:

message.sender = self.sender or message.sender or MESSAGE_SENDER_AI

the literal string "Machine and User" is stored, producing an invalid sender value and breaking later filters that expect only "Machine" / "User".

Suggested fix:

-message.sender = self.sender or message.sender or MESSAGE_SENDER_AI
+normalised_sender = None if self.sender == "Machine and User" else self.sender
+message.sender = normalised_sender or message.sender or MESSAGE_SENDER_AI
🧰 Tools
🪛 Pylint (3.3.7)

[convention] 139-139: Missing function or method docstring

(C0116)

🤖 Prompt for AI Agents
In src/backend/base/langflow/components/helpers/memory.py around lines 139 to
146, the assignment to message.sender incorrectly allows the meta value "Machine
and User" to be stored in the database, which is invalid. To fix this, add a
check to exclude "Machine and User" from being assigned to message.sender;
instead, fallback to message.sender or MESSAGE_SENDER_AI when self.sender is
"Machine and User" or falsy. This ensures only valid sender values like
"Machine" or "User" are stored.

Comment thread src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json Outdated
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jun 2, 2025
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🔭 Outside diff range comments (1)
src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json (1)

100-115: ⚠️ Potential issue

Outdated edge mapping for memory output
The edge connecting Memory-9SYWU to Prompt-7sDZ1 still uses the old output "messages_text", which no longer exists after consolidating outputs. This will break the flow. Please update or remove this edge to point to the new "dataframe" output.

Suggested diff:

-      {
-        "sourceHandle": { "dataType": "Memory", "id": "Memory-9SYWU", "name": "messages_text", "output_types": [] },
+      {
+        "sourceHandle": { "dataType": "Memory", "id": "Memory-9SYWU", "name": "dataframe", "output_types": ["DataFrame"] },
         "targetHandle": { ... }
       }
♻️ Duplicate comments (2)
src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json (1)

2552-2574: ⚠️ Potential issue

Enable dynamic for the new message input
The message input is marked as dynamic: false, but it must be dynamic to accept runtime messages. Please adjust to dynamic: true.

Apply this diff:

-        "message": {
-          "_input_type": "MessageTextInput",
-          "advanced": false,
-          "display_name": "Message",
-          "dynamic": false,
+        "message": {
+          "_input_type": "MessageTextInput",
+          "advanced": false,
+          "display_name": "Message",
+          "dynamic": true,
           "info": "The chat message to be stored.",
           ...
src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (1)

890-912: Enable Dynamic Flag for message Input
The new message input is currently:

"dynamic": false,

It should be dynamic to accept runtime message values, and you must add "message" to the field_order array so it appears in the UI.

Proposed diff:

--- a/src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json
+++ b/src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json
@@ "field_order": [
-  "memory",
+  "message",
+  "memory",
   "sender",
   "sender_name",
   // ...
@@ "message": {
-                "dynamic": false,
+                "dynamic": true,
🧹 Nitpick comments (1)
src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (1)

800-800: Minor Grammar Suggestion in Node Description

The updated description reads:

"Stores or retrieves stored chat messages from Langflow tables or an external memory."

For clarity and consistency, consider changing “or” to “and”:

"Stores and retrieves chat messages from Langflow tables or an external memory."

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 73dfda6 and c575d6c.

📒 Files selected for processing (3)
  • src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json (6 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json (6 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Ruff Style Check (3.13)
  • GitHub Check: Optimize new Python code in this PR
  • GitHub Check: Run Ruff Check and Format
  • GitHub Check: Update Starter Projects
🔇 Additional comments (10)
src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json (4)

2457-2461: Update component description to reflect storing capability
The description now correctly mentions both storing and retrieving chat messages, aligning with the new feature set.


2484-2492: Rename retrieval output to retrieve_messages_dataframe
The retrieval output has been updated to use retrieve_messages_dataframe and returns a DataFrame. This is consistent with the helper implementation.


2498-2503: Add hidden stored_messages output
Introducing a hidden stored_messages output via store_message properly surfaces stored messages for downstream components while keeping it hidden by default.


2530-2536: Template code updated for MemoryComponent
The JSON template now imports and uses aget_messages and astore_message, and the methods retrieve_messages_dataframe and store_message align with the updated component API.

src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (3)

11-12: Verify Dynamic Edge Types for Memory Output

The messages_text source handle has had its output_types cleared (set to an empty array) to support dynamic typing. However, edge definitions rely on output_types for type inference. Please verify in the Playground that the Memory Chatbot’s messages_text output still connects correctly to the Prompt’s memory input without type mismatches.

Also applies to: 26-27


823-831: DataFrame Output Configuration Looks Good

The retrieve_messages_dataframe output is correctly defined as a dynamic DataFrame:

  • display_name: "Messages"
  • method: retrieve_messages_dataframe
  • types: ["DataFrame"]

This aligns with the new DataFrame-based output requirement.


837-846: Stored Messages Output Configuration Approved

The hidden, dynamic Stored Messages output for store_message is correctly declared:

  • hidden: true
  • method: store_message
  • types: ["Message"]

This matches the intended CRUD flow for storing chat messages.

src/backend/base/langflow/initial_setup/starter_projects/Custom Component Maker.json (3)

217-217: Description update is accurate
The node description now correctly reflects that the component can store and retrieve messages.


240-247: First output updated correctly to return a DataFrame of messages
The display name, method, name, and types now align with retrieve_messages_dataframe, producing a DataFrame output.


254-258: Second output correctly configured for store_message
The hidden “Stored Messages” output is properly set to use the store_message method and returns a Message.

Comment on lines 11 to 13
"name": "messages_text",
"output_types": [
"Message"
]
"output_types": []
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Mismatch in output_types for Memory sourceHandle – likely breaking type compatibility

The data.sourceHandle.output_types is set to an empty list, but the edge id string and the Memory component output actually produce Message types. This inconsistency can prevent the flow from correctly recognizing the output type of the Memory node.
Suggested fix: update output_types to ["Message"] in both the data.sourceHandle object and the encoded sourceHandle string.

-            "output_types": []
+            "output_types": ["Message"]

And ensure the sourceHandle string at line 27 is updated accordingly.

Also applies to: 27-27

🤖 Prompt for AI Agents
In src/backend/base/langflow/initial_setup/starter_projects/Custom Component
Maker.json at lines 11 to 13 and line 27, the output_types for data.sourceHandle
is incorrectly set to an empty list, causing a type mismatch with the Memory
component's actual Message output. Update the output_types array to ["Message"]
in the data.sourceHandle object at lines 11-13 and also modify the encoded
sourceHandle string at line 27 to reflect this change, ensuring consistent type
compatibility across the flow.

@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jun 2, 2025
Copy link
Copy Markdown
Collaborator

@edwinjosechittilappilly edwinjosechittilappilly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would need to add modes like Local DB

@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jun 2, 2025
@github-actions github-actions Bot removed the enhancement New feature or request label Jun 2, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2025

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2025

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (2)
src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json (1)

2756-2776: Set default mode to Retrieve
The mode TabInput now defaults to "Retrieve", ensuring retrieval behavior is the primary view per design.

src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (1)

853-853: Empty name property in Prompt node configuration
The Prompt node’s "name" is set to an empty string, which will break instantiation and binding. It should match the component’s name "Prompt".

Proposed fix:

- "name": "",
+ "name": "Prompt",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d4281be and 9143861.

⛔ Files ignored due to path filters (1)
  • src/frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json (48 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (13 hunks)
  • src/backend/tests/unit/graph/test_graph.py (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/backend/tests/unit/graph/test_graph.py
🔇 Additional comments (22)
src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json (7)

265-291: Add Memory-to-TypeConverterComponent edge
The new edge correctly maps the Memory component's dynamic dataframe output (DataFrame) to the TypeConverterComponent's input_data accepting Message, Data, and DataFrame.


292-317: Add TypeConverterComponent-to-Prompt edge
This edge properly connects the converter's message_output (Message) to the Prompt component's history input. The inputTypes include Message and Text, matching the Prompt definition.


2656-2658: Rename and clarify Memory component
The component display_name is now "Message History" and its description reflects both storing and retrieving chat messages, improving clarity.


2679-2684: Consolidate output to DataFrame
The Memory component now exposes a single dynamic output dataframe via retrieve_messages_dataframe, returning messages as a DataFrame. This aligns with the dual-mode design.


2733-2755: Enable dynamic message input
The message input is correctly marked dynamic: true and hidden (show: false) by default, appearing only in "Store" mode as intended.


3875-3892: Add TypeConverterComponent node
The new TypeConverterComponent enables converting between Message, Data, and DataFrame types within flows, supporting the combined chat history CRUD functionality.


3937-3981: Validate TypeConverterComponent inputs/outputs
The input_data HandleInput and output_type TabInput correctly define accepted types, and the update_outputs logic toggles outputs via .to_dict() as expected.

src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (15)

5-31: Edges mapping from ChatInput to OpenAIModel look correct
The new edge correctly propagates a Message output from the ChatInput node into the input_value of the OpenAIModel. All metadata fields (dataType, id, name, output_types, inputTypes, etc.) are consistent.


25-25: Verify JSON escaping in edge id property
The id field embeds œ characters rather than conventional escaped quotes, e.g.:

"reactflow__edge-ChatInput-Mqzss{œdataTypeœ:œChatInputœ,...}"

Confirm if this serialization is intentional; otherwise, switch to valid JSON-escaped quotes (e.g., \").


33-59: Edges mapping from Prompt to OpenAIModel look correct
The Prompt output is now correctly typed as Message and wired into the system_message input of the OpenAIModel. Metadata is consistent.


61-89: Edges mapping from OpenAIModel to ChatOutput look correct
The LLM’s text_output (Message) is being passed into ChatOutput with the full set of acceptable input types (Data, DataFrame, Message). Good consolidation.


91-118: Edges mapping from TypeConverterComponent to Prompt look correct
The new type-conversion step (message_output) feeding into the memory field of Prompt is properly registered with Message and Text types.


119-145: Edges mapping from Memory to TypeConverterComponent look correct
The DataFrame produced by Memory is routed into the converter’s input_data port that accepts Message, Data, or DataFrame. All types align.


434-434: ID update for ChatInput-Mqzss is a trivial serialization change; no action needed.


455-455: ID update for ChatOutput-Er0pP is a trivial serialization change; no action needed.


757-759: Note node metadata change only affects measured dimensions; no functional impact.


805-809: Note node metadata change only affects measured dimensions; no functional impact.


823-831: Prompt node’s custom_fields and description updates reflect new template logic; looks good.


979-984: OpenAIModel node metadata updates (base_classes, category, etc.) align with component API changes; no concerns.


1373-1378: TypeConverterComponent ID and basic metadata update only; behavior is governed by component code.


1497-1501: Memory component ID change is a serialization artifact; no issues detected.


1511-1520: Memory node’s field_order rearrangement aligns with new dual-mode logic; looks correct.

Comment on lines 841 to 844
"field_order": [
"memory",
"sender",
"sender_name",
"n_messages",
"session_id",
"order",
"template"
],
"frozen": false,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Include tool_placeholder in field_order of Prompt node
The Prompt component defines two inputs (template and tool_placeholder), but the field_order array only lists "template". Add "tool_placeholder" to ensure it’s surfaced in the UI.

Proposed diff:

 "field_order": [
-  "template"
+  "template",
+  "tool_placeholder"
 ],
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"field_order": [
"memory",
"sender",
"sender_name",
"n_messages",
"session_id",
"order",
"template"
],
"frozen": false,
"field_order": [
"template",
"tool_placeholder"
],
"frozen": false,
🤖 Prompt for AI Agents
In src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json
around lines 841 to 844, the field_order array for the Prompt node only includes
"template" but should also include "tool_placeholder" since the Prompt component
defines both inputs. Add "tool_placeholder" to the field_order array to ensure
it appears in the UI alongside "template".

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (1)

853-853: ⚠️ Potential issue

Critical: Empty name in Prompt Node Configuration
The Prompt node’s "name" property is set to an empty string, which likely breaks component instantiation or UI binding. It should match the component name ("Prompt").

Apply this fix:

-  "name": "",
+  "name": "Prompt",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d4281be and 9143861.

⛔ Files ignored due to path filters (1)
  • src/frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json (48 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (13 hunks)
  • src/backend/tests/unit/graph/test_graph.py (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/backend/tests/unit/graph/test_graph.py
🔇 Additional comments (38)
src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json (14)

8-31: Edge mapping from Prompt to OpenAIModel is correct
The newly added edge connecting Prompt-Vzk5z to OpenAIModel-adSHw has consistent output_types and inputTypes, and the serialized sourceHandle/targetHandle strings align with the actual component definitions.


32-61: Edge mapping from OpenAIModel to ChatOutput is valid
The edge linking OpenAIModel-adSHw to ChatOutput-NbY9b correctly propagates a Message output to acceptable input types (Data, DataFrame, Message).


62-91: Second LLM edge correctly configured
The duplicate connection from another OpenAIModel-A8LqG node to ChatOutput-paHng mirrors the first and maintains type alignment.


93-120: ChatInput→Prompt edge looks good
The new ChatInput-xfgsq to Prompt-iKEvN edge properly routes the message output type to the prompt’s input field.


121-148: Prompt→OpenAIModel link validated
The edge from Prompt-iKEvN to OpenAIModel-A8LqG accurately conveys Message payloads to the model’s input_value.


149-176: AssemblyAI start→poll edge is correct
The AssemblyAITranscriptionJobCreator-hXp0S to AssemblyAITranscriptionJobPoller-VCkre edge maintains Data typing for the transcript ID.


177-205: Poller→Parser edge is consistent
The transcription poller’s transcription_result (Data) is fed to the parser’s input_data which accepts Data/DataFrame.


206-234: Parser→Prompt edge correct
The parser’s parsed_text (Message) now flows into the summary prompt’s transcript field.


235-264: Parser→ChatOutput edge validated
Parsed messages are routed appropriately to ChatOutput-5pvPL for display.


265-291: Memory→TypeConverter edge configured properly
The new dynamic output dataframe from Memory-YN8aN is correctly passed to the TypeConverterComponent’s input_data.


292-317: TypeConverter→Prompt edge is accurate
Converted message_output flows into the summary prompt’s history input, closing the loop for retrieval mode.


2733-2755: Dynamic visibility of message input in MemoryComponent
Marking dynamic: true and defaulting show: false on the message input aligns with the mode-config strategy to reveal it only in Store mode.


2756-2776: Correct default for mode TabInput
The default value “Retrieve” matches the PR objective to expose retrieval behavior initially.


2795-2817: order input marked required in Retrieve mode
Enforcing required: true for the order dropdown is appropriate given that retrieval must specify ascending/descending.

src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (24)

5-31: Approve edge addition from ChatInput to OpenAIModel
The new edge mapping the ChatInput message output to the OpenAIModel input_value is correctly defined, with consistent dataType, output_types, inputTypes, and handle metadata.


33-58: Approve edge update from Prompt to OpenAIModel system_message
The Prompt prompt output is properly connected to the OpenAIModel system_message input, with matching output_types and inputTypes metadata.


61-89: Approve edge mapping from OpenAIModel to ChatOutput
The OpenAIModel text_output is accurately routed to ChatOutput input_value, supporting Data, DataFrame, and Message types, with consistent metadata.


91-118: Approve edge for type conversion from DataFrame to Message for Prompt memory
The TypeConverterComponent message_output is correctly routed to the Prompt memory input, with aligned metadata.


119-145: Approve edge wiring from Memory dataframe to TypeConverterComponent input_data
The Memory dataframe output is properly connected to the TypeConverterComponent input_data, covering Message, Data, and DataFrame types, with handles aligned.


434-434: Approve adding top-level id for ChatInput node
The id field at the node level is now explicitly defined for ChatInput, ensuring consistent node identification in the flow.


455-455: Approve adding top-level id for ChatOutput node
The explicit node-level id ensures unique identification for ChatOutput in the flow graph.


757-771: Approve note-bo9zi node updates
The note node now defines id, height, and width for consistency in layout rendering.


792-808: Approve note-yHt6k node updates
The note node now includes explicit id, height, and width for proper layout rendering.


824-824: Approve adding top-level id for Prompt node
Defining the node-level id Prompt-mtnlM ensures consistent identification in the flow.


831-835: Approve custom_fields addition for Prompt template
Adding "template": ["memory"] under custom_fields correctly ensures the memory field is recognized as a template variable in the UI.


836-840: Approve description and error metadata for Prompt node
The updated description provides clearer context, and the inclusion of error: null supports future error reporting.


859-863: Approve Prompt output mapping
The output configuration (display_name: "Prompt", name: "prompt", method: "build_prompt") aligns with the updated component logic.


894-914: Verify dynamic flag for memory input
The memory input for Prompt is currently set to "dynamic": false. Confirm that this input should not accept runtime values, or consider setting it to true if dynamic memory injection is required.


961-965: Approve measured dimensions for Prompt node
Explicit measured heights and widths maintain consistent layout in the UI.


980-980: Approve adding top-level id for OpenAIModel node
The id field OpenAIModel-gXjiP is now explicit, improving node identifiability.


983-985: Approve updated base_classes for OpenAIModel
Adding "LanguageModel" alongside "Message" reflects the dual behavior of this component.


987-987: Approve category field addition for OpenAIModel
Categorizing the component under "models" aids in UI filtering.


1068-1074: Approve removal of default OpenAI API key placeholder
Clearing the default api_key field to an empty string prevents unintentional use or exposure of credentials.


1361-1361: Approve measured dimensions update for OpenAIModel node
Height and width metrics are now included for consistent rendering.


1373-1373: Approve adding top-level id for TypeConverterComponent node
Explicit id TypeConverterComponent-6PlBG supports proper node referencing.


1497-1497: Approve adding top-level id for Memory node
Having id Memory-OBr5W at the node root ensures unique identification for the Memory component.


1777-1778: Approve measured dimensions for Memory node
Including measured height and width ensures the Memory node lays out correctly.


1789-1790: Approve viewport position update
Adjusted x and y coordinates improve initial centering of the Memory Chatbot starter flow.

Comment on lines +3993 to 3998
"position": {
"x": 977.2392682107122,
"y": 1192.6380449385947
},
"selected": true,
"type": "genericNode"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Unexpected selected state on TypeConverterComponent
The TypeConverterComponent node is set to selected: true, while all other nodes default to false. To avoid highlighting it by default in the UI, please set "selected": false.

🤖 Prompt for AI Agents
In src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json
around lines 3993 to 3998, the TypeConverterComponent node has its "selected"
property set to true, unlike other nodes which default to false. Change the
"selected" value from true to false to prevent it from being highlighted by
default in the UI.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (1)

1586-1601: Dynamic flag set on message input in Memory node
The message input is now dynamic: true, addressing the previous missing flag and enabling runtime message storage.

🧹 Nitpick comments (2)
src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json (2)

265-290: Standardize custom edge ID prefixes
The new edges between MemoryTypeConverterComponent and TypeConverterComponentPrompt use the "xy-edge__..." prefix, whereas existing edges use "reactflow__edge-...". For consistency and to avoid potential parsing or tooling mismatches, consider renaming these IDs to follow the established "reactflow__edge-..." convention.

Also applies to: 292-317


2653-2657: Refine component description wording
The description "Stores or retrieves stored chat messages..." repeats "store/stored". For clarity, consider rephrasing, for example:

Manages chat messages by storing new entries or retrieving existing ones from Langflow tables or external memory.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d4281be and 9143861.

⛔ Files ignored due to path filters (1)
  • src/frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json (48 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (13 hunks)
  • src/backend/tests/unit/graph/test_graph.py (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/backend/tests/unit/graph/test_graph.py
🔇 Additional comments (18)
src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json (4)

2677-2683: Verify the consolidated output for Message History
The outputs array on the Memory node has been consolidated to a single dynamic dataframe output via retrieve_messages_dataframe. Ensure downstream components and the UI have been updated to consume this new output name, replacing any references to the old "Messages" or "messages_text" outputs.


2713-2776: Validate dynamic input visibility for mode and message
The message input is now dynamic: true and hidden by default, and the order input is marked required: true. Confirm that the update_build_config implementation properly toggles visibility and requirements of message, n_messages, order, and template based on the selected "Store" vs "Retrieve" mode, so the form behaves as intended.


3875-3899: Review TypeConverterComponent integration
The new TypeConverterComponent handles dynamic conversion between Message, Data, and DataFrame types. Verify that the output_type TabInput correctly updates the outputs array at runtime and that the conversion methods (convert_to_message, convert_to_data, convert_to_dataframe) handle all expected input variations without data loss or errors.

Also applies to: 3938-3987


4000-4006: LGTM
The starter project graph has been updated accurately to support dual-mode memory operations and seamless type conversion.

src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (14)

5-28: Correctly configured edge from ChatInput to OpenAIModel
The new edge defines dataType: "ChatInput" with matching output_types and consistent stringified sourceHandle. The target handle also correctly expects Message on the model input.


33-58: Correctly configured edge from Prompt to OpenAIModel
The Prompt → OpenAIModel connection is consistent: dataType, output_types, and inputTypes align in both structured and serialized handles.


61-89: Correctly configured edge from OpenAIModel to ChatOutput
The edge mapping the model’s text_output to ChatOutput’s input_value properly lists Message as the output type and accepts Data, DataFrame, and Message.


91-117: Correctly configured edge from TypeConverterComponent to Prompt
The TypeConverter’s message_output edge to the Prompt’s memory input uses a consistent Message type in both handles.


831-835: Added custom_fields for Prompt node to include memory
The inclusion of "custom_fields": {"template": ["memory"]} enables dynamic binding of the memory variable into the prompt template.


1511-1521: Updated field order in Memory node
The field_order now lists mode, message, memory, etc., reflecting the dual-mode logic. This aligns with the new mode_config in the component.


1531-1545: Consolidated Memory outputs to DataFrame
The Memory node now only exposes a single Messages output via retrieve_messages_dataframe, matching the component’s dynamic output behavior.


1609-1629: Configured mode TabInput for Memory node
The mode input correctly uses TabInput with real-time refresh, defaulting to Retrieve. This drives dynamic input/output updates.


1630-1647: Configured n_messages input for Retrieve mode
The Number of Messages field is properly defined and will be shown only when mode == Retrieve.


1648-1671: Configured order input for Retrieve mode
The Order dropdown is required and hidden by default, reflecting its inclusion only under Retrieve.


1672-1696: Configured sender input for Store/Retrieve filtering
The Sender Type dropdown is advanced and hidden by default; it aligns with the component filtering logic.


1697-1719: Configured sender_name input visibility
The Sender Name field is correctly marked show: false by default and will be toggled based on the selected mode.


1720-1742: Configured session_id input visibility
The Session ID input remains advanced and hidden until needed, matching the component’s mode_config.


1743-1767: Configured template input for Retrieve mode
The template field is a multiline input, hidden by default and surfaced under Retrieve to format messages.

"legacy": false,
"lf_version": "1.0.19.post2",
"metadata": {},
"name": "",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Empty name property in Prompt node
The Prompt node’s "name" is blank, which can prevent proper component instantiation or UI binding. It should be set to "Prompt".

🤖 Prompt for AI Agents
In src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json
at line 853, the "name" property of the Prompt node is currently empty. Update
this property to "Prompt" to ensure proper component instantiation and UI
binding.

Comment on lines +122 to +144
"dataType": "Memory",
"id": "Memory-OBr5W",
"name": "dataframe",
"output_types": [
"DataFrame"
]
},
"targetHandle": {
"fieldName": "input_data",
"id": "TypeConverterComponent-6PlBG",
"inputTypes": [
"Message",
"Data",
"DataFrame"
],
"type": "other"
}
},
"id": "xy-edge__Memory-OBr5W{œdataTypeœ:œMemoryœ,œidœ:œMemory-OBr5Wœ,œnameœ:œdataframeœ,œoutput_typesœ:[œDataFrameœ]}-TypeConverterComponent-6PlBG{œfieldNameœ:œinput_dataœ,œidœ:œTypeConverterComponent-6PlBGœ,œinputTypesœ:[œMessageœ,œDataœ,œDataFrameœ],œtypeœ:œotherœ}",
"source": "Memory-OBr5W",
"sourceHandle": "{œdataTypeœ: œMemoryœ, œidœ: œMemory-OBr5Wœ, œnameœ: œdataframeœ, œoutput_typesœ: [œDataFrameœ]}",
"target": "TypeConverterComponent-6PlBG",
"targetHandle": "{œfieldNameœ: œinput_dataœ, œidœ: œTypeConverterComponent-6PlBGœ, œinputTypesœ: [œMessageœ, œDataœ, œDataFrameœ], œtypeœ: œotherœ}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Inconsistent edge ID prefix for Memory → TypeConverterComponent
All other edges use the reactflow__edge- prefix, but this one uses xy-edge__. This discrepancy can break the graph renderer.

Please rename the id to start with reactflow__edge- to match the rest of the edges.

🤖 Prompt for AI Agents
In src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json
around lines 122 to 144, the edge ID prefix for the edge connecting Memory to
TypeConverterComponent is incorrectly set to "xy-edge__" instead of the
consistent "reactflow__edge-". Rename the "id" field of this edge to start with
"reactflow__edge-" to ensure consistency with other edges and prevent issues
with the graph renderer.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2025

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2025

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2025

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eb6c56d and 57dfb3d.

📒 Files selected for processing (1)
  • src/backend/tests/unit/build_utils.py (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: build-and-deploy
  • GitHub Check: Optimize new Python code in this PR
  • GitHub Check: Ruff Style Check (3.13)
  • GitHub Check: Run Ruff Check and Format
  • GitHub Check: Update Starter Projects
🔇 Additional comments (1)
src/backend/tests/unit/build_utils.py (1)

81-88:

Details

✅ Verification successful

The set comparison change is appropriate but verify component dependencies.

The change from list equality to set equality removes the execution order requirement, which is likely correct since the to_run list represents components that can be executed, not necessarily their execution order. The addition of TypeConverterComponent-koSIz aligns with the dual-mode Memory component functionality described in the PR objectives.


🏁 Script executed:

#!/bin/bash
# Description: Verify the TypeConverterComponent integration and dependencies
# Expected: Find component definitions and their relationships

# Look for TypeConverterComponent definition
ast-grep --pattern $'class TypeConverterComponent {
  $$$
}'

# Search for component registration or usage
rg -A 5 -B 5 "TypeConverterComponent" --type py

# Check if the component IDs match actual component definitions
rg -A 3 -B 3 "Memory-8X8Cq|Prompt-VSSGR|ChatOutput-NAw0P" --type py

Length of output: 14108


Confirm set comparison and TypeConverterComponent integration

All component IDs in the expected_to_run set match existing definitions, and TypeConverterComponent is properly defined and imported:

  • TypeConverterComponent is declared in src/backend/base/langflow/components/processing/converter.py and exposed via its __init__.py.
  • All tests and starter-project files import and use TypeConverterComponent correctly.
  • Switching from list to set comparison in src/backend/tests/unit/build_utils.py no longer enforces ordering, which aligns with the intended behavior.

No further changes required.

Comment on lines +76 to 78
assert ids == ["ChatInput-vsgM1"], "Invalid ids in first event. Full event stream:\n" + "\n".join(
lines
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify the hardcoded component ID is stable.

The test uses a hardcoded component ID "ChatInput-vsgM1" which could make the test brittle if ID generation changes. Consider if this ID is deterministic or if the test should be more flexible.


🏁 Script executed:

#!/bin/bash
# Description: Check if component IDs are deterministic across the codebase
# Expected: Find patterns of ID generation or usage that indicate whether IDs are stable

# Search for ID generation patterns
rg -A 3 -B 3 "ChatInput-.*" --type py

# Look for ID generation logic
rg -A 5 "generate.*id|create.*id" --type py

# Check for other hardcoded IDs in tests
rg -A 2 -B 2 '"[A-Za-z]+-[A-Za-z0-9]{5}"' src/backend/tests/

Length of output: 66192


🏁 Script executed:

#!/bin/bash
# Display the beginning of the build_utils test to understand ID sourcing
sed -n '1,200p' src/backend/tests/unit/build_utils.py

echo
echo "---- Checking for seed or mocking of UUID generation ----"
rg -n "seed" src/backend/tests/unit/build_utils.py || echo "No seed usage found"
rg -n "uuid4" src/backend/tests/unit/build_utils.py || echo "No uuid4 usage found"
rg -n "patch" src/backend/tests/unit/build_utils.py || echo "No patch/mock usage found"

Length of output: 6168


Ensure deterministic component IDs in tests

The assertion

assert ids == ["ChatInput-vsgM1"], "Invalid ids in first event…"

is brittle because suffixes are generated via uuid.uuid4() with no seeding or mocking. IDs will vary across runs.

Locations to address:

  • File: src/backend/tests/unit/build_utils.py
  • Function: consume_and_assert_stream
  • Lines around the first-event ID assertion (ids == [...])

Suggested fix:
Replace exact-match on a random ID with either a prefix/regex check or mock UUID generation. For example:

-   assert ids == ["ChatInput-vsgM1"], "Invalid ids in first event. Full event stream:\n" + "\n".join(lines)
+   # Ensure ChatInput component ID has the correct prefix
+   assert ids and ids[0].startswith("ChatInput-"), (
+       f"Unexpected first component ID '{ids[0]}'. Expected prefix 'ChatInput-'.\nFull event stream:\n"
+       + "\n".join(lines)
+   )

Alternative approaches:

  • Mock uuid.uuid4() (or the internal ID generator) to return a fixed value in tests.
  • Use a regex match: re.match(r"^ChatInput-[A-Za-z0-9]{5}$", ids[0]).
🤖 Prompt for AI Agents
In src/backend/tests/unit/build_utils.py around lines 76 to 78, the test asserts
an exact match on a component ID that includes a random UUID suffix, making the
test brittle. To fix this, modify the assertion to either mock the UUID
generation function to return a fixed value during the test or replace the exact
string comparison with a regex pattern check that verifies the ID prefix and
format without relying on a fixed suffix. This ensures the test remains stable
despite random ID generation.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2025

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2025

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2025

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2025

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2025

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request fast-track Skip tests and sends PR into the merge queue lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants