Skip to content

Conversation

@ogabrielluiz
Copy link
Contributor

@ogabrielluiz ogabrielluiz commented Jul 22, 2025

This pull request introduces the integration of the lfx package into the project, replacing several components previously implemented in langflow. It also includes updates to workflows, dependency management, and various modules to accommodate this integration, alongside maintaining backward compatibility for existing code. Below are the most important changes grouped by theme.

Integration of lfx Package:

  • Updated imports across multiple files to replace langflow components with their lfx equivalents, such as Graph, log_vertex_build, and RunOutputs ([[1]](https://github.com/langflow-ai/langflow/pull/9133/files#diff-01e70d8b6885408064d22e2eca9632b8440dbc94706d2ad53032bc6381a41921R9-R10), [[2]](https://github.com/langflow-ai/langflow/pull/9133/files#diff-01e70d8b6885408064d22e2eca9632b8440dbc94706d2ad53032bc6381a41921L31-L32), [[3]](https://github.com/langflow-ai/langflow/pull/9133/files#diff-44baaabf1ab87d4713c828053d97a7f9f5dc8d1ab9c2f8d05c1a0bcdc43e999cR19-R20), [[4]](https://github.com/langflow-ai/langflow/pull/9133/files#diff-44baaabf1ab87d4713c828053d97a7f9f5dc8d1ab9c2f8d05c1a0bcdc43e999cL49-L50), [[5]](https://github.com/langflow-ai/langflow/pull/9133/files#diff-16a3f52cd365cf007fb82edef25293ecadbeef0cdfdd6fa5c9251be013faf96eR15-L22), [[6]](https://github.com/langflow-ai/langflow/pull/9133/files#diff-0af520cbcf89ace99473e6b372b9c67eed878fb92d82985a0b9bbea52842dcfcR7)).
  • Added lfx as a dependency in pyproject.toml and included it in the development workspace ([[1]](https://github.com/langflow-ai/langflow/pull/9133/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R21), [[2]](https://github.com/langflow-ai/langflow/pull/9133/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R185-R192)).

Workflow and Testing Enhancements:

  • Introduced a new lfx-tests job in the GitHub Actions workflow to run tests specifically for the lfx package ([.github/workflows/python_test.ymlR127-R150](https://github.com/langflow-ai/langflow/pull/9133/files#diff-057cc96278abef7805c36e31271c952e066432c7be2c98b1b13e368ba3c557a8R127-R150)).
  • Added a lfx_tests target in the Makefile to enable running unit tests for the lfx package ([MakefileR141-R146](https://github.com/langflow-ai/langflow/pull/9133/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R141-R146)).

Backward Compatibility:

  • Created backward compatibility modules for langflow.base and langflow.base.agents to ensure existing code continues to function seamlessly ([[1]](https://github.com/langflow-ai/langflow/pull/9133/files#diff-761c89fcc2444d403f0cd60ffd5b3a62c83b273a4e3902ea813af9c6b69fc617R1-R8), [[2]](https://github.com/langflow-ai/langflow/pull/9133/files#diff-dcb48872192d83ee3afbf77574a855a3240c868a78f77bba2459e8c19d9e1aeeR1-R3)).

Updates to Starter Projects and API Schemas:

  • Enhanced the starter-projects API endpoint to use Pydantic models for schema compatibility and updated the logic to work with lfx components ([src/backend/base/langflow/api/v1/starter_projects.pyR1-R75](https://github.com/langflow-ai/langflow/pull/9133/files#diff-ac6048e97498be0bee26b0cfe5b07d989493d10bfd412fd011de7153ac4acf2aR1-R75)).
  • Added new Pydantic models (GraphData, GraphDumpResponse, etc.) for better API schema structure ([src/backend/base/langflow/api/v1/starter_projects.pyR1-R75](https://github.com/langflow-ai/langflow/pull/9133/files#diff-ac6048e97498be0bee26b0cfe5b07d989493d10bfd412fd011de7153ac4acf2aR1-R75)).

Miscellaneous:

  • Updated .vscode/launch.json to include the src/lfx directory for hot reloading during development ([.vscode/launch.jsonL22-R24](https://github.com/langflow-ai/langflow/pull/9133/files#diff-bd5430ee7c51dc892a67b3f2829d1f5b6d223f0fd48b82322cfd45baf9f5e945L22-R24)).
  • Added a new linting ignore rule (D10) to pyproject.toml ([pyproject.tomlR308](https://github.com/langflow-ai/langflow/pull/9133/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R308)).

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 22, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update refactors the backend by replacing many internal implementations with re-exports from the lfx package, updating import paths from langflow to lfx, and removing or consolidating local logic in favor of upstream modules. Several modules, schemas, and utilities are deleted or replaced with compatibility shims. New enhanced schema and service manager classes are introduced, and code snippets in starter projects are updated accordingly.

Changes

Files/Groups Change Summary
pyproject.toml Added lfx dependency, updated workspace and source configs, ignored new lint rule.
src/backend/base/langflow/api/..., helpers/flow.py, initial_setup/setup.py, etc. Updated import paths from langflow to lfx for various classes, functions, and constants.
src/backend/base/langflow/custom/custom_component/..., custom/utils.py, custom/validate.py Deleted local implementations; now re-export all symbols from lfx.custom modules.
src/backend/base/langflow/custom/__init__.py Expanded imports and __all__ to include additional symbols from lfx.custom.
src/backend/base/langflow/graph/__init__.py, graph/utils.py Deleted files; removed all local graph utilities and public exports.
src/backend/base/langflow/interface/... Deleted local implementations; now re-export all symbols from lfx.interface modules.
src/backend/base/langflow/io/__init__.py Updated import paths from langflow.inputs/template to lfx.io/template.
src/backend/base/langflow/load/load.py, processing/process.py, services/flow/flow_runner.py Updated import paths for core classes (e.g., Graph, Vertex) to lfx.
src/backend/base/langflow/schema/data.py, message.py Replaced local implementations with compatibility shims importing enhanced versions.
src/backend/base/langflow/schema/data_enhanced.py, schema/message_enhanced.py, ... Added new enhanced Data and Message classes with langflow-specific conversion and content logic.
src/backend/base/langflow/schema/data_original.py, schema/message_original.py Added original versions of Data and Message classes for compatibility.
src/backend/base/langflow/services/manager.py Removed local ServiceManager; now imports enhanced version and re-exports instance.
src/backend/base/langflow/services/enhanced_manager.py Added enhanced ServiceManager class with factory discovery and registration.
src/backend/base/langflow/services/utils.py Added register_all_service_factories() and updated initialize_services() to register all factories.
src/backend/base/langflow/api/v1/starter_projects.py Refactored endpoint to return Pydantic models with explicit schemas.
src/backend/base/langflow/initial_setup/starter_projects/*.json Updated embedded code snippets: changed imports from langflow.custom to lfx.custom, renamed toolkit helper.
src/backend/base/langflow/initial_setup/starter_projects/*.py Updated import of Graph from langflow.graph to lfx.graph.
src/backend/base/langflow/services/deps.py Removed get_socket_service function.
src/backend/base/langflow/services/schema.py Removed commented-out enum member.
src/backend/base/langflow/utils/lazy_load.py Removed local LazyLoadDictBase, re-exported from lfx.utils.lazy_load.
src/backend/base/langflow/utils/schemas.py, utils/util.py Updated import paths for constants from langflow.base to lfx.base.
src/backend/tests/... Updated all imports from langflow to lfx for tested components.
src/backend/base/langflow/template/__init__.py, template/field/prompt.py, ... Deleted module initializers and compatibility shims.
src/backend/base/langflow/base/** Added multiple backwards compatibility modules re-exporting from lfx.base submodules.
src/backend/base/langflow/custom/custom_component/component.py Removed local Component implementation; re-export from lfx.custom.custom_component.component.
src/backend/base/langflow/custom/custom_component/custom_component.py Removed local CustomComponent implementation; re-export from lfx.custom.custom_component.custom_component.
src/backend/base/langflow/custom/custom_component/component_with_cache.py Removed local ComponentWithCache; re-export from lfx.custom.custom_component.component_with_cache.
src/backend/base/langflow/custom/utils.py Removed local implementations; re-export from lfx.custom.utils.
src/backend/base/langflow/custom/validate.py New module re-exporting all from lfx.custom.validate.
src/backend/base/langflow/base/io/__init__.py Changed to re-export all from lfx.base.io.
src/backend/base/langflow/base/io/chat.py Removed local ChatComponent; re-export from lfx.base.io.chat.
src/backend/base/langflow/base/io/text.py Removed local TextComponent; re-export from lfx.base.io.text.
src/backend/base/langflow/base/data/__init__.py Changed to re-export all from lfx.base.data.
src/backend/base/langflow/base/data/utils.py Removed local utilities; re-export from lfx.base.data.utils.
src/backend/base/langflow/base/models/__init__.py Changed to re-export all from lfx.base.models.
src/backend/base/langflow/base/prompts/__init__.py New backwards compatibility module re-exporting from lfx.base.prompts.
src/backend/base/langflow/base/prompts/api_utils.py Removed local implementations; re-export from lfx.base.prompts.api_utils.
src/backend/base/langflow/base/memory/__init__.py New backwards compatibility module re-exporting from lfx.base.memory.
src/backend/base/langflow/base/textsplitters/__init__.py New backwards compatibility module re-exporting from lfx.base.textsplitters.
src/backend/base/langflow/base/tools/__init__.py New backwards compatibility module re-exporting from lfx.base.tools.
src/backend/base/langflow/base/vectorstores/__init__.py New backwards compatibility module re-exporting from lfx.base.vectorstores.
src/backend/base/langflow/components/__init__.py New module importing and exposing components from lfx.
src/backend/base/langflow/events/event_manager.py Removed local EventManager and related protocols; re-export from lfx.events.event_manager.
src/backend/base/langflow/interface/components.py Removed local component loading/caching logic; re-export from lfx.interface.components.
src/backend/base/langflow/interface/listing.py Removed local AllTypesDict; re-export from lfx.interface.listing.
src/backend/base/langflow/interface/utils.py Removed local utilities; re-export from lfx.interface.utils.
src/backend/base/langflow/services/enhanced_manager.py Added enhanced ServiceManager with factory discovery and concurrency control.
src/backend/base/langflow/services/manager.py Removed old ServiceManager; import and re-export enhanced version, instantiate global service_manager.
src/backend/base/langflow/services/utils.py Added centralized factory registration function; updated service initialization to register all factories.
src/backend/base/langflow/schema/data.py Removed local Data class; replaced with compatibility shim importing enhanced Data and serialization funcs.
src/backend/base/langflow/schema/data_enhanced.py Added enhanced Data class with langflow-specific conversions and utilities.
src/backend/base/langflow/schema/data_original.py Added original Data class for compatibility.
src/backend/base/langflow/schema/message.py Removed local Message, MessageResponse, ErrorMessage; replaced with compatibility shim importing enhanced and original versions.
src/backend/base/langflow/schema/message_enhanced.py Added enhanced Message and ErrorMessage classes with rich content, serialization, and conversion logic.
src/backend/base/langflow/schema/message_original.py Added original Message, MessageResponse, ErrorMessage classes for compatibility.
.vscode/launch.json Updated debug reload include paths to add ./src/lfx/* alongside ./src/backend/*.

Sequence Diagram(s)

sequenceDiagram
    participant API as API Endpoint
    participant Models as Pydantic Models
    participant lfx as lfx Package

    API->>lfx: Import core classes/functions (Graph, Component, etc.)
    API->>Models: Construct response using enhanced schemas (Data, Message, etc.)
    API->>lfx: Delegate logic to lfx modules (custom, interface, utils, etc.)
    Models->>lfx: Use enhanced Data/Message for conversions and validation
    API-->>Client: Return validated response
Loading

Estimated code review effort

5 (~150 minutes)

Possibly related PRs

Suggested labels

size:L, lgtm

Suggested reviewers

  • jordanrfrazier
  • edwinjosechittilappilly
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch create-lfx

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit 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.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 22, 2025
Copy link
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: 7

🔭 Outside diff range comments (11)
src/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.json (1)

920-939: Unify PromptComponent imports to the lfx namespace (modules verified)

All referenced symbols are present under lfx.*, so you can safely update the imports as shown below:

-from langflow.base.prompts.api_utils import process_prompt_template
-from langflow.inputs.inputs import DefaultPromptField
-from langflow.io import MessageTextInput, Output, PromptInput
-from langflow.schema.message import Message
-from langflow.template.utils import update_template_values
+from lfx.base.prompts.api_utils import process_prompt_template
+from lfx.inputs.inputs import DefaultPromptField
+from lfx.io import MessageTextInput, Output, PromptInput
+from lfx.schema.message import Message
+from lfx.template.utils import update_template_values
src/backend/base/langflow/initial_setup/starter_projects/Basic Prompt Chaining.json (1)

260-266: Residual langflow.* imports break the namespace migration

The embedded PromptComponent code snippets still import from the deprecated langflow namespace while every other component in this PR has already migrated to lfx.*.
If langflow modules are eventually removed (or already removed in the images used by end-users), these components will fail to build and the starter project will not load.

-from langflow.base.prompts.api_utils import process_prompt_template
-from langflow.inputs.inputs import DefaultPromptField
-from langflow.io import MessageTextInput, Output, PromptInput
-from langflow.schema.message import Message
-from langflow.template.utils import update_template_values
+from lfx.base.prompts.api_utils import process_prompt_template
+from lfx.inputs.inputs import DefaultPromptField
+from lfx.io import MessageTextInput, Output, PromptInput
+from lfx.schema.message import Message
+from lfx.template.utils import update_template_values

Apply the same replacement to all three PromptComponent code blocks in this JSON (lines indicated above) to keep the starter project consistent with the global refactor.
Also bump the code_hash field afterwards so tooling recognises the update.

Also applies to: 1000-1006, 1130-1133

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

915-932: URLComponent still imports from langflow.* – update to lfx.*

All three embedded URLComponent definitions (lines shown above) reference langflow.custom, langflow.helpers, langflow.io, etc.
This is inconsistent with the rest of the migration and will explode with ModuleNotFoundError.

Apply the same namespace change you performed for MemoryComponent, e.g.:

-from langflow.custom import Component
-from langflow.field_typing.range_spec import RangeSpec
-from langflow.helpers.data import safe_convert
-from langflow.io import BoolInput, DropdownInput, IntInput, MessageTextInput, Output, SliderInput, TableInput
-from langflow.schema import DataFrame, Message
-from langflow.services.deps import get_settings_service
+from lfx.custom import Component
+from lfx.field_typing.range_spec import RangeSpec
+from lfx.helpers.data import safe_convert
+from lfx.io import BoolInput, DropdownInput, IntInput, MessageTextInput, Output, SliderInput, TableInput
+from lfx.schema import DataFrame, Message
+from lfx.services.deps import get_settings_service

Do the same for every other langflow. occurrence in the block.

Also applies to: 1272-1288, 1634-1650

src/backend/base/langflow/custom/utils.py (1)

1-4: Circular dependency detected between langflow and lfx – refactor required

Our shim in src/backend/base/langflow/custom/utils.py (lines 1–4) re-exports everything from lfx.custom.utils, while several lfx modules import back from langflow (e.g., lfx/utils/component_utils.py, lfx/utils/util.py, lfx/schema/dotdict.py). This creates a runtime cycle that may lead to import errors or unexpected behavior.

Please address this before merging:

• Break the cycle by extracting shared helpers (e.g., dotdict, utility functions, type-extraction code, CustomComponent) into a neutral “common” package.
• Have both langflow and lfx depend on that common package, rather than on each other.
• Update src/backend/base/langflow/custom/utils.py to import only what’s needed (or remove the shim once downstream code is migrated).

Files to update:

  • src/backend/base/langflow/custom/utils.py (shim)
  • src/lfx/src/lfx/utils/component_utils.py
  • src/lfx/src/lfx/utils/util.py
  • src/lfx/src/lfx/schema/dotdict.py
  • (and any other lfx files importing from langflow)
src/backend/base/langflow/initial_setup/starter_projects/Invoice Summarizer.json (1)

174-176: Keep metadata paths consistent with the new lfx namespace

"module": "langflow.components.prompts.prompt.PromptComponent" still points to the former langflow package while the rest of the starter project migrated to lfx.
Leave-behind references will break dynamic loading once langflow.components.* is removed.

-    "module": "langflow.components.prompts.prompt.PromptComponent"
+    "module": "lfx.components.prompts.prompt.PromptComponent"
src/backend/base/langflow/initial_setup/starter_projects/Document Q&A.json (2)

600-640: isinstance with PEP 604 unions will crash

_validate_input passes Message | Data | ... (a types.UnionType) to isinstance.
isinstance only accepts a type or a tuple of types – passing a union raises TypeError at runtime.

-            isinstance(item, Message | Data | DataFrame | str) for item in self.input_value
+            isinstance(item, (Message, Data, DataFrame, str)) for item in self.input_value
...
-        if not isinstance(
-            self.input_value,
-            Message | Data | DataFrame | str | list | Generator | type(None),
+        if not isinstance(
+            self.input_value,
+            (Message, Data, DataFrame, str, list, Generator, type(None)),

Please update both occurrences (the list-comprehension and the later guard).
Without this change any call path into _validate_input will raise immediately.


840-860: Namespace migration is incomplete – mixed langflow / lfx imports

PromptComponent still imports from langflow.* while the rest of the PR moves everything to lfx.*.
This creates a split dependency graph and defeats the purpose of the migration.

-from langflow.base.prompts.api_utils import process_prompt_template
-from langflow.inputs.inputs import DefaultPromptField
-from langflow.io import MessageTextInput, Output, PromptInput
-from langflow.schema.message import Message
-from langflow.template.utils import update_template_values
+from lfx.base.prompts.api_utils import process_prompt_template
+from lfx.inputs.inputs import DefaultPromptField
+from lfx.io import MessageTextInput, Output, PromptInput
+from lfx.schema.message import Message
+from lfx.template.utils import update_template_values

Also update the metadata block ("module": ...) so the UI can resolve the component correctly.
Failing to align these paths will surface as ModuleNotFoundError once the local langflow stubs are removed.

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

561-580: isinstance() with union types will crash at runtime

Inside ChatOutput.code, the following checks are invalid in Python ≥3.10:

isinstance(item, Message | Data | DataFrame | str)
...
isinstance(self.input_value, Message | Data | DataFrame | str | list | Generator | type(None))

isinstance expects a type or a tuple of types, not a PEP-604 union expression.
This will raise TypeError: isinstance() arg 2 must be a type or tuple of types.

-            isinstance(item, Message | Data | DataFrame | str) for item in self.input_value
+            isinstance(item, (Message, Data, DataFrame, str)) for item in self.input_value

-        if not isinstance(
-            self.input_value,
-            Message | Data | DataFrame | str | list | Generator | type(None),
-        ):
+        if not isinstance(
+            self.input_value,
+            (Message, Data, DataFrame, str, list, Generator, type(None)),
+        ):
src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json (1)

640-652: Prefer lfx.io over the non-public lfx.inputs.inputs import

BoolInput is fetched from the private-ish path lfx.inputs.inputs, while all other I/O objects come from lfx.io.
Keeping a single, public import path avoids future breakage when the internal package structure moves.

-from lfx.inputs.inputs import BoolInput
-from lfx.io import (
-    DropdownInput,
-    FileInput,
-    MessageTextInput,
-    MultilineInput,
-    Output,
-)
+from lfx.io import (
+    BoolInput,
+    DropdownInput,
+    FileInput,
+    MessageTextInput,
+    MultilineInput,
+    Output,
+)
src/backend/base/langflow/initial_setup/starter_projects/Market Research.json (2)

640-675: Invalid use of isinstance with union (|) expressions

Inside the ChatOutput component’s _validate_input method the following patterns are used:

isinstance(item, Message | Data | DataFrame | str)
...
isinstance(
    self.input_value,
    Message | Data | DataFrame | str | list | Generator | type(None),
)

Passing a union expression to isinstance raises TypeError at runtime because the second argument must be a type or a tuple of types.

Proposed fix:

- isinstance(item, Message | Data | DataFrame | str)
+ isinstance(item, (Message, Data, DataFrame, str))

- isinstance(
-     self.input_value,
-     Message | Data | DataFrame | str | list | Generator | type(None),
- )
+ isinstance(
+     self.input_value,
+     (Message, Data, DataFrame, str, list, Generator, type(None)),
+ )

Ensure that every other isinstance / issubclass call in the file follows this rule.


1608-1625: Parser component still references deprecated langflow.* modules

While most components have been migrated to lfx, ParserComponent keeps:

from langflow.custom import Component
from langflow.io import (...)
from langflow.schema import Data, DataFrame

Unless a backwards-compatibility shim is guaranteed, this will break once langflow is no longer installed.

Refactor to the lfx equivalents, or explicitly document the dependency.

♻️ Duplicate comments (3)
src/backend/base/langflow/base/embeddings/__init__.py (1)

3-3: Same wildcard-import concern as noted for base.prompts

Please apply the forwarder approach suggested in that file to keep the namespace clean here as well.

src/backend/base/langflow/base/memory/__init__.py (1)

3-3: Same wildcard-import concern as noted for base.prompts

Replicate the explicit re-export pattern for consistency.

src/backend/base/langflow/base/tools/__init__.py (1)

3-3: Same wildcard-import concern as noted for base.prompts

Swap to the explicit re-export helper to avoid namespace pollution.

🧹 Nitpick comments (15)
src/backend/base/langflow/components/__init__.py (1)

1-1: Remove the self-alias and the # noqa: PLC0414 suppression

Aliasing the imported module to the exact same name is unnecessary and only exists to silence the linter. Dropping the alias keeps the intent clear and avoids an extra ignore comment.

-from lfx import components as components  # noqa: PLC0414
+from lfx import components

__all__ already exposes the public symbol, so no further change is required.

src/backend/base/langflow/base/prompts/__init__.py (1)

3-3: Replace wildcard re-export with an explicit pass-through to avoid namespace pollution

Using import * can introduce hundreds of symbols into the current module and breaks static analysis. An explicit forwarder keeps the surface area predictable and still fulfils the backward-compatibility goal:

-from lfx.base.prompts import *  # noqa: F403
+# Re-export exactly what lfx already exposes
+from lfx.base import prompts as _prompts
+
+globals().update({name: getattr(_prompts, name) for name in _prompts.__all__})
+__all__ = list(_prompts.__all__)

This pattern keeps linting happy, preserves type information, and avoids leaking private names that happen to live inside lfx.base.prompts.

src/backend/base/langflow/base/vectorstores/__init__.py (1)

3-3: Avoid import * – export explicitly to keep namespace predictable

Wild-card re-exports hinder static analysis and can leak private symbols.
Consider a lazy re-export that mirrors the upstream __all__ instead:

-from lfx.base.vectorstores import *  # noqa: F403
+from importlib import import_module
+
+_mod = import_module("lfx.base.vectorstores")
+globals().update(_mod.__dict__)
+__all__ = getattr(_mod, "__all__", [n for n in _mod.__dict__ if not n.startswith("_")])

This preserves backward compatibility while keeping the public surface explicit.

src/backend/base/langflow/base/__init__.py (1)

7-8: Star import in package root-level shim

Same concern as above—import * pollutes langflow.base with every private helper from lfx.base.
A minimal proxy using import_module and __all__ would be cleaner and mypy-friendly.

src/backend/base/langflow/base/textsplitters/__init__.py (1)

3-3: Replace wildcard with explicit re-export

Replicate the upstream __all__ set instead of using * to avoid accidental symbol leakage.

src/backend/base/langflow/base/io/text.py (1)

3-3: Compatibility shim should expose only the intended API

For consistency with the other shims, prefer an explicit __all__-based re-export rather than import *.
This also prevents unexpected names (e.g. private helpers) from surfacing in langflow.base.io.text.

src/backend/base/langflow/custom/custom_component/component_with_cache.py (1)

1-4: Backwards compatibility shim correctly implemented.

The migration to re-export from lfx.custom.custom_component.component_with_cache maintains API compatibility. The wildcard import approach is appropriate for this compatibility layer.

Consider removing the redundant comment on line 3, as the wildcard import already re-exports everything:

 from lfx.custom.custom_component.component_with_cache import *  # noqa: F403

-# Re-export everything from lfx.custom.custom_component.component_with_cache
pyproject.toml (1)

308-308: Consider documenting the reason for ignoring D10 rule.

The addition of "D10" (Missing docstring in public module) to the ignore list might be temporary during the migration. Consider adding a comment explaining why this rule is being ignored or create a plan to address missing docstrings after the migration.

src/backend/base/langflow/base/data/utils.py (1)

1-4: Replace wildcard import with explicit re-export for maintainability

from lfx.base.data.utils import * # noqa: F403 maximises compatibility but obscures the public surface, inhibits static analysis, and risks accidental name leaks. A lightweight alternative keeps compatibility while being explicit:

"""Backwards compatibility module for langflow.base.data.utils."""
from lfx.base.data import utils as _u

__all__ = _u.__all__
globals().update({name: getattr(_u, name) for name in __all__})

This re-export pattern avoids the wildcard import while preserving the full API.

src/backend/base/langflow/events/event_manager.py (1)

1-18: Emit a DeprecationWarning for smoother developer transition

This shim silently re-exports symbols, which may hide the fact that the import path is deprecated.
Emitting a warning once at import-time makes the migration path explicit while preserving backwards compatibility.

+# Backwards compatibility module for langflow.events.event_manager
+# This module redirects imports to the new lfx.events.event_manager module
+
+import warnings
+
+warnings.warn(
+    "Importing from 'langflow.events.event_manager' is deprecated. "
+    "Please switch to 'lfx.events.event_manager'.",
+    DeprecationWarning,
+    stacklevel=2,
+)
+
 from lfx.events.event_manager import (

No functional change, negligible overhead, clear signal to users.

src/backend/base/langflow/custom/__init__.py (1)

14-27: Consider alphabetizing the all list for consistency.

Based on the coding guidelines for backend development, imports should be organized alphabetically. The __all__ list should follow the same pattern for consistency.

 __all__ = [
+    "build_custom_component_template",
     "Component",
-    "CustomComponent",
-    "build_custom_component_template",
     "create_class",
     "create_function",
     "custom",
     "custom_component",
+    "CustomComponent",
     "extract_class_name",
     "extract_function_name",
     "get_component_toolkit",
     "utils",
     "validate",
 ]
src/backend/base/langflow/custom/custom_component/component.py (1)

1-4: Consider documenting exported symbols

While the wildcard import is intentional for creating a compatibility layer, it makes it difficult to track what symbols are being exposed by this module. Consider adding a comment or __all__ declaration to document the expected public API.

 from lfx.custom.custom_component.component import *  # noqa: F403
 
 # Re-export everything from lfx.custom.custom_component.component
+# This module serves as a compatibility layer, re-exporting:
+# - Component
+# - PlaceholderGraph
+# - ComponentToolkit (via _get_component_toolkit)
+# - and other component-related utilities
src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json (2)

1500-1510: memory_inputs is computed but never used

memory_inputs = [set_advanced_true(component_input) for component_input in MemoryComponent().inputs]
is kept after the in-line comment “removed memory inputs from agent component”.
Leaving an unused variable adds noise and confuses static-analysis tools.

-# removed memory inputs from agent component
-# *memory_inputs,

and drop the memory_inputs assignment above.
No functional change, just clarity.


260-275: Avoid shadowing the standard json module

Inside AgentQL.build_output the response body is stored in a variable named json, obscuring the standard library module should it be needed later in the method.

-            json = response.json()
-            data = Data(result=json["data"], metadata=json["metadata"])
+            body = response.json()
+            data = Data(result=body["data"], metadata=body["metadata"])

A tiny change that prevents accidental misuse down the road.

src/backend/base/langflow/initial_setup/starter_projects/Nvidia Remix.json (1)

1033-1038: Dead variable / commented-out usage – drop memory_inputs

memory_inputs is computed but never referenced (the only consumer is a commented line).
Keeping it increases bundle size and confuses readers.

-    memory_inputs = [set_advanced_true(component_input) for component_input in MemoryComponent().inputs]
-

(remove or reinstate the line that inlines it into inputs)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2fa2a43 and 3be6dbc.

📒 Files selected for processing (54)
  • .vscode/launch.json (1 hunks)
  • pyproject.toml (3 hunks)
  • src/backend/base/langflow/api/build.py (1 hunks)
  • src/backend/base/langflow/api/limited_background_tasks.py (1 hunks)
  • src/backend/base/langflow/api/utils.py (1 hunks)
  • src/backend/base/langflow/api/v1/base.py (1 hunks)
  • src/backend/base/langflow/api/v1/chat.py (2 hunks)
  • src/backend/base/langflow/api/v1/endpoints.py (1 hunks)
  • src/backend/base/langflow/api/v1/mcp_projects.py (1 hunks)
  • src/backend/base/langflow/api/v1/mcp_utils.py (1 hunks)
  • src/backend/base/langflow/api/v1/schemas.py (1 hunks)
  • src/backend/base/langflow/api/v1/starter_projects.py (1 hunks)
  • src/backend/base/langflow/api/v1/validate.py (1 hunks)
  • src/backend/base/langflow/api/v2/mcp.py (1 hunks)
  • src/backend/base/langflow/base/__init__.py (1 hunks)
  • src/backend/base/langflow/base/agents/__init__.py (1 hunks)
  • src/backend/base/langflow/base/data/__init__.py (1 hunks)
  • src/backend/base/langflow/base/data/utils.py (1 hunks)
  • src/backend/base/langflow/base/embeddings/__init__.py (1 hunks)
  • src/backend/base/langflow/base/io/__init__.py (1 hunks)
  • src/backend/base/langflow/base/io/chat.py (1 hunks)
  • src/backend/base/langflow/base/io/text.py (1 hunks)
  • src/backend/base/langflow/base/memory/__init__.py (1 hunks)
  • src/backend/base/langflow/base/models/__init__.py (1 hunks)
  • src/backend/base/langflow/base/prompts/__init__.py (1 hunks)
  • src/backend/base/langflow/base/prompts/api_utils.py (1 hunks)
  • src/backend/base/langflow/base/textsplitters/__init__.py (1 hunks)
  • src/backend/base/langflow/base/tools/__init__.py (1 hunks)
  • src/backend/base/langflow/base/vectorstores/__init__.py (1 hunks)
  • src/backend/base/langflow/components/__init__.py (1 hunks)
  • src/backend/base/langflow/custom/__init__.py (1 hunks)
  • src/backend/base/langflow/custom/custom_component/__init__.py (1 hunks)
  • src/backend/base/langflow/custom/custom_component/component.py (1 hunks)
  • src/backend/base/langflow/custom/custom_component/component_with_cache.py (1 hunks)
  • src/backend/base/langflow/custom/custom_component/custom_component.py (1 hunks)
  • src/backend/base/langflow/custom/utils.py (1 hunks)
  • src/backend/base/langflow/custom/validate.py (1 hunks)
  • src/backend/base/langflow/events/event_manager.py (1 hunks)
  • src/backend/base/langflow/graph/__init__.py (0 hunks)
  • src/backend/base/langflow/graph/utils.py (0 hunks)
  • src/backend/base/langflow/helpers/flow.py (4 hunks)
  • src/backend/base/langflow/initial_setup/setup.py (1 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Basic Prompt Chaining.json (10 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json (6 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Blog Writer.json (10 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Custom Component Generator.json (8 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Document Q&A.json (7 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Financial Report Parser.json (7 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.json (9 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Invoice Summarizer.json (8 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Market Research.json (10 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json (8 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json (9 hunks)
  • src/backend/base/langflow/initial_setup/starter_projects/Nvidia Remix.json (9 hunks)
📓 Path-based instructions (5)
{src/backend/**/*.py,tests/**/*.py,Makefile}

📄 CodeRabbit Inference Engine (.cursor/rules/backend_development.mdc)

{src/backend/**/*.py,tests/**/*.py,Makefile}: Run make format_backend to format Python code before linting or committing changes
Run make lint to perform linting checks on backend Python code

Files:

  • src/backend/base/langflow/api/v1/base.py
  • src/backend/base/langflow/custom/validate.py
  • src/backend/base/langflow/api/limited_background_tasks.py
  • src/backend/base/langflow/api/v1/schemas.py
  • src/backend/base/langflow/api/v2/mcp.py
  • src/backend/base/langflow/api/v1/validate.py
  • src/backend/base/langflow/base/prompts/__init__.py
  • src/backend/base/langflow/custom/custom_component/component_with_cache.py
  • src/backend/base/langflow/base/agents/__init__.py
  • src/backend/base/langflow/base/tools/__init__.py
  • src/backend/base/langflow/components/__init__.py
  • src/backend/base/langflow/api/v1/mcp_projects.py
  • src/backend/base/langflow/api/v1/mcp_utils.py
  • src/backend/base/langflow/base/embeddings/__init__.py
  • src/backend/base/langflow/base/vectorstores/__init__.py
  • src/backend/base/langflow/api/utils.py
  • src/backend/base/langflow/base/__init__.py
  • src/backend/base/langflow/api/build.py
  • src/backend/base/langflow/api/v1/chat.py
  • src/backend/base/langflow/base/textsplitters/__init__.py
  • src/backend/base/langflow/base/models/__init__.py
  • src/backend/base/langflow/helpers/flow.py
  • src/backend/base/langflow/base/io/chat.py
  • src/backend/base/langflow/base/memory/__init__.py
  • src/backend/base/langflow/base/io/text.py
  • src/backend/base/langflow/api/v1/endpoints.py
  • src/backend/base/langflow/custom/custom_component/__init__.py
  • src/backend/base/langflow/base/data/utils.py
  • src/backend/base/langflow/base/io/__init__.py
  • src/backend/base/langflow/events/event_manager.py
  • src/backend/base/langflow/initial_setup/setup.py
  • src/backend/base/langflow/custom/custom_component/custom_component.py
  • src/backend/base/langflow/base/data/__init__.py
  • src/backend/base/langflow/custom/__init__.py
  • src/backend/base/langflow/base/prompts/api_utils.py
  • src/backend/base/langflow/custom/custom_component/component.py
  • src/backend/base/langflow/custom/utils.py
  • src/backend/base/langflow/api/v1/starter_projects.py
src/backend/**/*component*.py

📄 CodeRabbit Inference Engine (.cursor/rules/icons.mdc)

Set the icon attribute in your Python component class to a string matching the frontend icon mapping exactly (case-sensitive).

Files:

  • src/backend/base/langflow/custom/custom_component/component_with_cache.py
  • src/backend/base/langflow/custom/custom_component/custom_component.py
  • src/backend/base/langflow/custom/custom_component/component.py
src/backend/base/langflow/components/**/*.py

📄 CodeRabbit Inference Engine (.cursor/rules/backend_development.mdc)

src/backend/base/langflow/components/**/*.py: Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Implement async component methods using async def and await for asynchronous operations
Use asyncio.create_task for background work in async components and ensure proper cleanup on cancellation
Use asyncio.Queue for non-blocking queue operations in async components and handle timeouts appropriately

Files:

  • src/backend/base/langflow/components/__init__.py
src/backend/base/langflow/components/**/__init__.py

📄 CodeRabbit Inference Engine (.cursor/rules/backend_development.mdc)

Update init.py with alphabetical imports when adding new components

Files:

  • src/backend/base/langflow/components/__init__.py
src/backend/**/components/**/*.py

📄 CodeRabbit Inference Engine (.cursor/rules/icons.mdc)

Set the icon attribute in your Python component class to a string matching the frontend icon mapping exactly (case-sensitive).

Files:

  • src/backend/base/langflow/components/__init__.py
🧠 Learnings (51)
📓 Common learnings
Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the `module_name` parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.595Z
Learning: Applies to src/frontend/src/components/**/@(FlowGraph|nodes)/**/*.{ts,tsx,js,jsx} : Use React Flow for flow graph visualization components.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.
src/backend/base/langflow/api/v1/base.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/custom/validate.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

src/backend/base/langflow/api/limited_background_tasks.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Use asyncio.create_task for background work in async components and ensure proper cleanup on cancellation

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

src/backend/base/langflow/api/v1/schemas.py (3)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/api/v2/mcp.py (2)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

src/backend/base/langflow/api/v1/validate.py (3)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/base/prompts/__init__.py (3)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

src/backend/base/langflow/custom/custom_component/component_with_cache.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Use ComponentTestBaseWithClient or ComponentTestBaseWithoutClient as base classes for component unit tests

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

src/backend/base/langflow/base/agents/__init__.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/base/tools/__init__.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/components/__init__.py (10)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Mirror the component directory structure for unit tests in src/backend/tests/unit/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Create comprehensive unit tests for all new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Use asyncio.create_task for background work in async components and ensure proper cleanup on cancellation

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Use asyncio.Queue for non-blocking queue operations in async components and handle timeouts appropriately

src/backend/base/langflow/api/v1/mcp_projects.py (2)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

src/backend/base/langflow/api/v1/mcp_utils.py (3)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

.vscode/launch.json (9)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.595Z
Learning: Applies to src/frontend/@(package*.json|tsconfig.json|tailwind.config.|vite.config.) : Frontend configuration files such as package.json, tsconfig.json, and Tailwind/Vite configs must be maintained and updated as needed.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Backend auto-reloads on file changes and browser refresh is required to see component changes

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/frontend/**/*.@(test|spec).{ts,tsx,js,jsx} : Test both sync and async code paths in frontend test files.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to {src/backend//*.py,tests//*.py,Makefile} : Run make lint to perform linting checks on backend Python code

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to {src/backend//*.py,tests//*.py,Makefile} : Run make format_backend to format Python code before linting or committing changes

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test both sync and async code paths in backend Python tests, using '@pytest.mark.asyncio' for async tests.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.091Z
Learning: Applies to src/backend/tests/**/*.py : Unit tests for backend code must be located in the 'src/backend/tests/' directory, with component tests organized by component subdirectory under 'src/backend/tests/unit/components/'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Use 'anyio' and 'aiofiles' for async file operations in backend Python tests that involve file handling.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

src/backend/base/langflow/base/embeddings/__init__.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/base/vectorstores/__init__.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/api/utils.py (3)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/base/__init__.py (6)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

src/backend/base/langflow/api/build.py (8)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.595Z
Learning: Applies to src/frontend/src/components//@(FlowGraph|nodes)//*.{ts,tsx,js,jsx} : Use React Flow for flow graph visualization components.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Use asyncio.create_task for background work in async components and ensure proper cleanup on cancellation

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/**/*.py : Test component integration within flows using create_flow, build_flow, and get_build_events utilities

src/backend/base/langflow/api/v1/chat.py (2)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

src/backend/base/langflow/base/textsplitters/__init__.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/base/models/__init__.py (7)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Use 'MockLanguageModel' for testing language model components without external API calls in backend Python tests.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Provide file_names_mapping for backward compatibility in component tests

src/backend/base/langflow/helpers/flow.py (9)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's REST API endpoints in backend Python tests using the async client fixture and asserting response codes and payloads.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.595Z
Learning: Applies to src/frontend/src/components//@(FlowGraph|nodes)//*.{ts,tsx,js,jsx} : Use React Flow for flow graph visualization components.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

src/backend/base/langflow/base/io/chat.py (6)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Provide file_names_mapping for backward compatibility in component tests

src/backend/base/langflow/base/memory/__init__.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/base/io/text.py (5)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Provide file_names_mapping for backward compatibility in component tests

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

src/backend/base/langflow/api/v1/endpoints.py (8)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's REST API endpoints in backend Python tests using the async client fixture and asserting response codes and payloads.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/**/*.py : Test component integration within flows using create_flow, build_flow, and get_build_events utilities

src/backend/base/langflow/custom/custom_component/__init__.py (9)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Mirror the component directory structure for unit tests in src/backend/tests/unit/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Create comprehensive unit tests for all new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/**/*.py : Test component integration within flows using create_flow, build_flow, and get_build_events utilities

src/backend/base/langflow/base/data/utils.py (3)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Provide file_names_mapping for backward compatibility in component tests

src/backend/base/langflow/base/io/__init__.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Use 'anyio' and 'aiofiles' for async file operations in backend Python tests that involve file handling.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

src/backend/base/langflow/initial_setup/setup.py (8)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Use asyncio.Queue for non-blocking queue operations in async components and handle timeouts appropriately

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's REST API endpoints in backend Python tests using the async client fixture and asserting response codes and payloads.

src/backend/base/langflow/custom/custom_component/custom_component.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

src/backend/base/langflow/base/data/__init__.py (7)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Provide file_names_mapping for backward compatibility in component tests

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.091Z
Learning: Applies to src/backend/tests/**/*.py : When writing component tests, inherit from the appropriate base class in 'src/backend/tests/base.py' (ComponentTestBase, ComponentTestBaseWithClient, or ComponentTestBaseWithoutClient) and provide the required fixtures: 'component_class', 'default_kwargs', and 'file_names_mapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

src/backend/base/langflow/custom/__init__.py (6)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

pyproject.toml (3)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json (8)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/components/**/*.{md,mdx} : Component documentation pages must follow the provided template, including sections for Overview, Configuration (Inputs/Outputs), Usage Example, and Common Issues.

src/backend/base/langflow/custom/custom_component/component.py (6)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Mirror the component directory structure for unit tests in src/backend/tests/unit/components/

src/backend/base/langflow/initial_setup/starter_projects/Financial Report Parser.json (8)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-06-23T12:46:29.953Z
Learning: All terminology such as 'Langflow', 'Component', 'Flow', 'API', and 'JSON' must be capitalized or uppercased as specified in the terminology section.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

src/backend/base/langflow/initial_setup/starter_projects/Basic Prompt Chaining.json (8)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/components/**/*.{md,mdx} : Component documentation pages must follow the provided template, including sections for Overview, Configuration (Inputs/Outputs), Usage Example, and Common Issues.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

src/backend/base/langflow/initial_setup/starter_projects/Custom Component Generator.json (12)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: When implementing a new component icon in Langflow, ensure the icon name is clear, recognizable, and used consistently across both backend (Python 'icon' attribute) and frontend (React/TypeScript mapping).

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-06-23T12:46:29.953Z
Learning: All terminology such as 'Langflow', 'Component', 'Flow', 'API', and 'JSON' must be capitalized or uppercased as specified in the terminology section.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: Custom React Flow node types should be implemented as memoized components, using Handle components for connection points and supporting optional icons and labels.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/components/**/*.{md,mdx} : Component documentation pages must follow the provided template, including sections for Overview, Configuration (Inputs/Outputs), Usage Example, and Common Issues.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

src/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.json (8)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/components/**/*.{md,mdx} : Component documentation pages must follow the provided template, including sections for Overview, Configuration (Inputs/Outputs), Usage Example, and Common Issues.

src/backend/base/langflow/initial_setup/starter_projects/Blog Writer.json (8)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/components/**/*.{md,mdx} : Component documentation pages must follow the provided template, including sections for Overview, Configuration (Inputs/Outputs), Usage Example, and Common Issues.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: When implementing a new component icon in Langflow, ensure the icon name is clear, recognizable, and used consistently across both backend (Python 'icon' attribute) and frontend (React/TypeScript mapping).

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

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-06-23T12:46:29.953Z
Learning: All terminology such as 'Langflow', 'Component', 'Flow', 'API', and 'JSON' must be capitalized or uppercased as specified in the terminology section.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: When implementing a new component icon in Langflow, ensure the icon name is clear, recognizable, and used consistently across both backend (Python 'icon' attribute) and frontend (React/TypeScript mapping).

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: Custom React Flow node types should be implemented as memoized components, using Handle components for connection points and supporting optional icons and labels.

src/backend/base/langflow/custom/utils.py (6)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Provide file_names_mapping for backward compatibility in component tests

src/backend/base/langflow/api/v1/starter_projects.py (1)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's REST API endpoints in backend Python tests using the async client fixture and asserting response codes and payloads.

src/backend/base/langflow/initial_setup/starter_projects/Document Q&A.json (10)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-06-23T12:46:29.953Z
Learning: All terminology such as 'Langflow', 'Component', 'Flow', 'API', and 'JSON' must be capitalized or uppercased as specified in the terminology section.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/components/**/*.{md,mdx} : Component documentation pages must follow the provided template, including sections for Overview, Configuration (Inputs/Outputs), Usage Example, and Common Issues.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Provide file_names_mapping for backward compatibility in component tests

src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json (7)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

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

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/components/**/*.{md,mdx} : Component documentation pages must follow the provided template, including sections for Overview, Configuration (Inputs/Outputs), Usage Example, and Common Issues.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: When implementing a new component icon in Langflow, ensure the icon name is clear, recognizable, and used consistently across both backend (Python 'icon' attribute) and frontend (React/TypeScript mapping).

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

src/backend/base/langflow/initial_setup/starter_projects/Nvidia Remix.json (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

src/backend/base/langflow/initial_setup/starter_projects/Market Research.json (8)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: When implementing a new component icon in Langflow, ensure the icon name is clear, recognizable, and used consistently across both backend (Python 'icon' attribute) and frontend (React/TypeScript mapping).

🧬 Code Graph Analysis (9)
src/backend/base/langflow/api/v1/base.py (1)
src/lfx/src/lfx/template/frontend_node/base.py (1)
  • FrontendNode (9-212)
src/backend/base/langflow/api/limited_background_tasks.py (1)
src/lfx/src/lfx/graph/utils.py (1)
  • log_vertex_build (142-175)
src/backend/base/langflow/api/v1/schemas.py (1)
src/lfx/src/lfx/graph/schema.py (1)
  • RunOutputs (73-75)
src/backend/base/langflow/api/v1/validate.py (1)
src/lfx/src/lfx/base/prompts/api_utils.py (1)
  • process_prompt_template (201-224)
src/backend/base/langflow/api/utils.py (1)
src/lfx/src/lfx/graph/graph/base.py (1)
  • Graph (59-2209)
src/backend/base/langflow/api/v1/chat.py (2)
src/lfx/src/lfx/graph/graph/base.py (1)
  • Graph (59-2209)
src/lfx/src/lfx/graph/utils.py (1)
  • log_vertex_build (142-175)
src/backend/base/langflow/custom/custom_component/__init__.py (1)
src/backend/base/langflow/api/v1/endpoints.py (1)
  • custom_component (657-675)
src/backend/base/langflow/events/event_manager.py (1)
src/lfx/src/lfx/events/event_manager.py (4)
  • EventCallback (19-20)
  • PartialEventCallback (23-24)
  • create_default_event_manager (90-101)
  • create_stream_tokens_event_manager (104-109)
src/backend/base/langflow/custom/__init__.py (3)
src/backend/base/langflow/api/v1/endpoints.py (1)
  • custom_component (657-675)
src/lfx/src/lfx/custom/custom_component/component.py (3)
  • Component (95-1789)
  • get_component_toolkit (59-65)
  • validate (531-542)
src/lfx/src/lfx/custom/utils.py (1)
  • build_custom_component_template (495-569)
💤 Files with no reviewable changes (2)
  • src/backend/base/langflow/graph/init.py
  • src/backend/base/langflow/graph/utils.py
🧰 Additional context used
📓 Path-based instructions (5)
{src/backend/**/*.py,tests/**/*.py,Makefile}

📄 CodeRabbit Inference Engine (.cursor/rules/backend_development.mdc)

{src/backend/**/*.py,tests/**/*.py,Makefile}: Run make format_backend to format Python code before linting or committing changes
Run make lint to perform linting checks on backend Python code

Files:

  • src/backend/base/langflow/api/v1/base.py
  • src/backend/base/langflow/custom/validate.py
  • src/backend/base/langflow/api/limited_background_tasks.py
  • src/backend/base/langflow/api/v1/schemas.py
  • src/backend/base/langflow/api/v2/mcp.py
  • src/backend/base/langflow/api/v1/validate.py
  • src/backend/base/langflow/base/prompts/__init__.py
  • src/backend/base/langflow/custom/custom_component/component_with_cache.py
  • src/backend/base/langflow/base/agents/__init__.py
  • src/backend/base/langflow/base/tools/__init__.py
  • src/backend/base/langflow/components/__init__.py
  • src/backend/base/langflow/api/v1/mcp_projects.py
  • src/backend/base/langflow/api/v1/mcp_utils.py
  • src/backend/base/langflow/base/embeddings/__init__.py
  • src/backend/base/langflow/base/vectorstores/__init__.py
  • src/backend/base/langflow/api/utils.py
  • src/backend/base/langflow/base/__init__.py
  • src/backend/base/langflow/api/build.py
  • src/backend/base/langflow/api/v1/chat.py
  • src/backend/base/langflow/base/textsplitters/__init__.py
  • src/backend/base/langflow/base/models/__init__.py
  • src/backend/base/langflow/helpers/flow.py
  • src/backend/base/langflow/base/io/chat.py
  • src/backend/base/langflow/base/memory/__init__.py
  • src/backend/base/langflow/base/io/text.py
  • src/backend/base/langflow/api/v1/endpoints.py
  • src/backend/base/langflow/custom/custom_component/__init__.py
  • src/backend/base/langflow/base/data/utils.py
  • src/backend/base/langflow/base/io/__init__.py
  • src/backend/base/langflow/events/event_manager.py
  • src/backend/base/langflow/initial_setup/setup.py
  • src/backend/base/langflow/custom/custom_component/custom_component.py
  • src/backend/base/langflow/base/data/__init__.py
  • src/backend/base/langflow/custom/__init__.py
  • src/backend/base/langflow/base/prompts/api_utils.py
  • src/backend/base/langflow/custom/custom_component/component.py
  • src/backend/base/langflow/custom/utils.py
  • src/backend/base/langflow/api/v1/starter_projects.py
src/backend/**/*component*.py

📄 CodeRabbit Inference Engine (.cursor/rules/icons.mdc)

Set the icon attribute in your Python component class to a string matching the frontend icon mapping exactly (case-sensitive).

Files:

  • src/backend/base/langflow/custom/custom_component/component_with_cache.py
  • src/backend/base/langflow/custom/custom_component/custom_component.py
  • src/backend/base/langflow/custom/custom_component/component.py
src/backend/base/langflow/components/**/*.py

📄 CodeRabbit Inference Engine (.cursor/rules/backend_development.mdc)

src/backend/base/langflow/components/**/*.py: Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Implement async component methods using async def and await for asynchronous operations
Use asyncio.create_task for background work in async components and ensure proper cleanup on cancellation
Use asyncio.Queue for non-blocking queue operations in async components and handle timeouts appropriately

Files:

  • src/backend/base/langflow/components/__init__.py
src/backend/base/langflow/components/**/__init__.py

📄 CodeRabbit Inference Engine (.cursor/rules/backend_development.mdc)

Update init.py with alphabetical imports when adding new components

Files:

  • src/backend/base/langflow/components/__init__.py
src/backend/**/components/**/*.py

📄 CodeRabbit Inference Engine (.cursor/rules/icons.mdc)

Set the icon attribute in your Python component class to a string matching the frontend icon mapping exactly (case-sensitive).

Files:

  • src/backend/base/langflow/components/__init__.py
🧠 Learnings (51)
📓 Common learnings
Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the `module_name` parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.595Z
Learning: Applies to src/frontend/src/components/**/@(FlowGraph|nodes)/**/*.{ts,tsx,js,jsx} : Use React Flow for flow graph visualization components.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.
src/backend/base/langflow/api/v1/base.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/custom/validate.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

src/backend/base/langflow/api/limited_background_tasks.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Use asyncio.create_task for background work in async components and ensure proper cleanup on cancellation

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

src/backend/base/langflow/api/v1/schemas.py (3)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/api/v2/mcp.py (2)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

src/backend/base/langflow/api/v1/validate.py (3)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/base/prompts/__init__.py (3)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

src/backend/base/langflow/custom/custom_component/component_with_cache.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Use ComponentTestBaseWithClient or ComponentTestBaseWithoutClient as base classes for component unit tests

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

src/backend/base/langflow/base/agents/__init__.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/base/tools/__init__.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/components/__init__.py (10)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Mirror the component directory structure for unit tests in src/backend/tests/unit/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Create comprehensive unit tests for all new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Use asyncio.create_task for background work in async components and ensure proper cleanup on cancellation

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Use asyncio.Queue for non-blocking queue operations in async components and handle timeouts appropriately

src/backend/base/langflow/api/v1/mcp_projects.py (2)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

src/backend/base/langflow/api/v1/mcp_utils.py (3)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

.vscode/launch.json (9)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.595Z
Learning: Applies to src/frontend/@(package*.json|tsconfig.json|tailwind.config.|vite.config.) : Frontend configuration files such as package.json, tsconfig.json, and Tailwind/Vite configs must be maintained and updated as needed.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Backend auto-reloads on file changes and browser refresh is required to see component changes

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/frontend/**/*.@(test|spec).{ts,tsx,js,jsx} : Test both sync and async code paths in frontend test files.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to {src/backend//*.py,tests//*.py,Makefile} : Run make lint to perform linting checks on backend Python code

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to {src/backend//*.py,tests//*.py,Makefile} : Run make format_backend to format Python code before linting or committing changes

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test both sync and async code paths in backend Python tests, using '@pytest.mark.asyncio' for async tests.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.091Z
Learning: Applies to src/backend/tests/**/*.py : Unit tests for backend code must be located in the 'src/backend/tests/' directory, with component tests organized by component subdirectory under 'src/backend/tests/unit/components/'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Use 'anyio' and 'aiofiles' for async file operations in backend Python tests that involve file handling.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

src/backend/base/langflow/base/embeddings/__init__.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/base/vectorstores/__init__.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/api/utils.py (3)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/base/__init__.py (6)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

src/backend/base/langflow/api/build.py (8)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.595Z
Learning: Applies to src/frontend/src/components//@(FlowGraph|nodes)//*.{ts,tsx,js,jsx} : Use React Flow for flow graph visualization components.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Use asyncio.create_task for background work in async components and ensure proper cleanup on cancellation

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/**/*.py : Test component integration within flows using create_flow, build_flow, and get_build_events utilities

src/backend/base/langflow/api/v1/chat.py (2)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

src/backend/base/langflow/base/textsplitters/__init__.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/base/models/__init__.py (7)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Use 'MockLanguageModel' for testing language model components without external API calls in backend Python tests.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Provide file_names_mapping for backward compatibility in component tests

src/backend/base/langflow/helpers/flow.py (9)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's REST API endpoints in backend Python tests using the async client fixture and asserting response codes and payloads.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.595Z
Learning: Applies to src/frontend/src/components//@(FlowGraph|nodes)//*.{ts,tsx,js,jsx} : Use React Flow for flow graph visualization components.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

src/backend/base/langflow/base/io/chat.py (6)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Provide file_names_mapping for backward compatibility in component tests

src/backend/base/langflow/base/memory/__init__.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

src/backend/base/langflow/base/io/text.py (5)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Provide file_names_mapping for backward compatibility in component tests

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

src/backend/base/langflow/api/v1/endpoints.py (8)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's REST API endpoints in backend Python tests using the async client fixture and asserting response codes and payloads.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/**/*.py : Test component integration within flows using create_flow, build_flow, and get_build_events utilities

src/backend/base/langflow/custom/custom_component/__init__.py (9)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Mirror the component directory structure for unit tests in src/backend/tests/unit/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Create comprehensive unit tests for all new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/**/*.py : Test component integration within flows using create_flow, build_flow, and get_build_events utilities

src/backend/base/langflow/base/data/utils.py (3)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Provide file_names_mapping for backward compatibility in component tests

src/backend/base/langflow/base/io/__init__.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Use 'anyio' and 'aiofiles' for async file operations in backend Python tests that involve file handling.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

src/backend/base/langflow/initial_setup/setup.py (8)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Use asyncio.Queue for non-blocking queue operations in async components and handle timeouts appropriately

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's REST API endpoints in backend Python tests using the async client fixture and asserting response codes and payloads.

src/backend/base/langflow/custom/custom_component/custom_component.py (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

src/backend/base/langflow/base/data/__init__.py (7)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Provide file_names_mapping for backward compatibility in component tests

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.091Z
Learning: Applies to src/backend/tests/**/*.py : When writing component tests, inherit from the appropriate base class in 'src/backend/tests/base.py' (ComponentTestBase, ComponentTestBaseWithClient, or ComponentTestBaseWithoutClient) and provide the required fixtures: 'component_class', 'default_kwargs', and 'file_names_mapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

src/backend/base/langflow/custom/__init__.py (6)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

pyproject.toml (3)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/services/database/models/**/*.py : Place database models in src/backend/base/langflow/services/database/models/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json (8)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/components/**/*.{md,mdx} : Component documentation pages must follow the provided template, including sections for Overview, Configuration (Inputs/Outputs), Usage Example, and Common Issues.

src/backend/base/langflow/custom/custom_component/component.py (6)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Mirror the component directory structure for unit tests in src/backend/tests/unit/components/

src/backend/base/langflow/initial_setup/starter_projects/Financial Report Parser.json (8)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-06-23T12:46:29.953Z
Learning: All terminology such as 'Langflow', 'Component', 'Flow', 'API', and 'JSON' must be capitalized or uppercased as specified in the terminology section.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

src/backend/base/langflow/initial_setup/starter_projects/Basic Prompt Chaining.json (8)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/components/**/*.{md,mdx} : Component documentation pages must follow the provided template, including sections for Overview, Configuration (Inputs/Outputs), Usage Example, and Common Issues.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

src/backend/base/langflow/initial_setup/starter_projects/Custom Component Generator.json (12)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: When implementing a new component icon in Langflow, ensure the icon name is clear, recognizable, and used consistently across both backend (Python 'icon' attribute) and frontend (React/TypeScript mapping).

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-06-23T12:46:29.953Z
Learning: All terminology such as 'Langflow', 'Component', 'Flow', 'API', and 'JSON' must be capitalized or uppercased as specified in the terminology section.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: Custom React Flow node types should be implemented as memoized components, using Handle components for connection points and supporting optional icons and labels.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/components/**/*.{md,mdx} : Component documentation pages must follow the provided template, including sections for Overview, Configuration (Inputs/Outputs), Usage Example, and Common Issues.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

src/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.json (8)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/components/**/*.{md,mdx} : Component documentation pages must follow the provided template, including sections for Overview, Configuration (Inputs/Outputs), Usage Example, and Common Issues.

src/backend/base/langflow/initial_setup/starter_projects/Blog Writer.json (8)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/components/**/*.{md,mdx} : Component documentation pages must follow the provided template, including sections for Overview, Configuration (Inputs/Outputs), Usage Example, and Common Issues.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: When implementing a new component icon in Langflow, ensure the icon name is clear, recognizable, and used consistently across both backend (Python 'icon' attribute) and frontend (React/TypeScript mapping).

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

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-06-23T12:46:29.953Z
Learning: All terminology such as 'Langflow', 'Component', 'Flow', 'API', and 'JSON' must be capitalized or uppercased as specified in the terminology section.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: When implementing a new component icon in Langflow, ensure the icon name is clear, recognizable, and used consistently across both backend (Python 'icon' attribute) and frontend (React/TypeScript mapping).

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: Custom React Flow node types should be implemented as memoized components, using Handle components for connection points and supporting optional icons and labels.

src/backend/base/langflow/custom/utils.py (6)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Implement async component methods using async def and await for asynchronous operations

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Provide file_names_mapping for backward compatibility in component tests

src/backend/base/langflow/api/v1/starter_projects.py (1)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's REST API endpoints in backend Python tests using the async client fixture and asserting response codes and payloads.

src/backend/base/langflow/initial_setup/starter_projects/Document Q&A.json (10)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-06-23T12:46:29.953Z
Learning: All terminology such as 'Langflow', 'Component', 'Flow', 'API', and 'JSON' must be capitalized or uppercased as specified in the terminology section.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/components/**/*.{md,mdx} : Component documentation pages must follow the provided template, including sections for Overview, Configuration (Inputs/Outputs), Usage Example, and Common Issues.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/tests/unit/components/**/*.py : Provide file_names_mapping for backward compatibility in component tests

src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json (7)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

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

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/components/**/*.{md,mdx} : Component documentation pages must follow the provided template, including sections for Overview, Configuration (Inputs/Outputs), Usage Example, and Common Issues.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: When implementing a new component icon in Langflow, ensure the icon name is clear, recognizable, and used consistently across both backend (Python 'icon' attribute) and frontend (React/TypeScript mapping).

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

src/backend/base/langflow/initial_setup/starter_projects/Nvidia Remix.json (4)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

src/backend/base/langflow/initial_setup/starter_projects/Market Research.json (8)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/init.py : Update init.py with alphabetical imports when adding new components

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test Langflow's Message objects and chat functionality in backend Python tests by asserting correct instantiation and property values.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: When implementing a new component icon in Langflow, ensure the icon name is clear, recognizable, and used consistently across both backend (Python 'icon' attribute) and frontend (React/TypeScript mapping).

🧬 Code Graph Analysis (9)
src/backend/base/langflow/api/v1/base.py (1)
src/lfx/src/lfx/template/frontend_node/base.py (1)
  • FrontendNode (9-212)
src/backend/base/langflow/api/limited_background_tasks.py (1)
src/lfx/src/lfx/graph/utils.py (1)
  • log_vertex_build (142-175)
src/backend/base/langflow/api/v1/schemas.py (1)
src/lfx/src/lfx/graph/schema.py (1)
  • RunOutputs (73-75)
src/backend/base/langflow/api/v1/validate.py (1)
src/lfx/src/lfx/base/prompts/api_utils.py (1)
  • process_prompt_template (201-224)
src/backend/base/langflow/api/utils.py (1)
src/lfx/src/lfx/graph/graph/base.py (1)
  • Graph (59-2209)
src/backend/base/langflow/api/v1/chat.py (2)
src/lfx/src/lfx/graph/graph/base.py (1)
  • Graph (59-2209)
src/lfx/src/lfx/graph/utils.py (1)
  • log_vertex_build (142-175)
src/backend/base/langflow/custom/custom_component/__init__.py (1)
src/backend/base/langflow/api/v1/endpoints.py (1)
  • custom_component (657-675)
src/backend/base/langflow/events/event_manager.py (1)
src/lfx/src/lfx/events/event_manager.py (4)
  • EventCallback (19-20)
  • PartialEventCallback (23-24)
  • create_default_event_manager (90-101)
  • create_stream_tokens_event_manager (104-109)
src/backend/base/langflow/custom/__init__.py (3)
src/backend/base/langflow/api/v1/endpoints.py (1)
  • custom_component (657-675)
src/lfx/src/lfx/custom/custom_component/component.py (3)
  • Component (95-1789)
  • get_component_toolkit (59-65)
  • validate (531-542)
src/lfx/src/lfx/custom/utils.py (1)
  • build_custom_component_template (495-569)
🔇 Additional comments (61)
src/backend/base/langflow/api/v1/base.py (1)

1-1: Import path migration looks correct.

The FrontendNode import has been properly updated from langflow.template.frontend_node.base to lfx.template.frontend_node.base. This aligns with the broader package restructuring to the lfx namespace.

src/backend/base/langflow/api/limited_background_tasks.py (1)

2-2: Import migration is consistent with package restructuring.

The log_vertex_build import has been correctly updated from langflow.graph.utils to lfx.graph.utils. The function interface remains the same and is properly used in the task limiting logic.

src/backend/base/langflow/api/v2/mcp.py (1)

6-6: MCP utility import correctly migrated to lfx package.

The update_tools import has been properly updated from langflow.base.mcp.util to lfx.base.mcp.util. The function usage in the check_server coroutine remains unchanged.

src/backend/base/langflow/api/v1/schemas.py (1)

7-7: Graph schema import correctly updated to lfx namespace.

The RunOutputs import has been properly migrated from langflow.graph.schema to lfx.graph.schema. The Pydantic model structure remains identical and is correctly used in the RunResponse schema.

src/backend/base/langflow/api/build.py (1)

9-10: Core graph imports successfully migrated to lfx package.

Both Graph and log_vertex_build imports have been correctly updated from the langflow.graph namespace to lfx.graph. These are core components used extensively throughout the flow building process, and the migration maintains all existing functionality.

src/backend/base/langflow/custom/validate.py (1)

1-4: LGTM: Well-implemented compatibility shim

This file correctly implements a compatibility wrapper pattern that maintains backward compatibility during the namespace migration from langflow to lfx. The wildcard import with noqa: F403 is appropriate for re-export modules.

src/backend/base/langflow/api/v1/validate.py (1)

2-2: LGTM: Import path correctly updated for namespace migration

The import path change from langflow.base.prompts.api_utils to lfx.base.prompts.api_utils is consistent with the broader namespace migration. The function signature and usage remain unchanged based on the available context.

src/backend/base/langflow/api/utils.py (1)

11-11: LGTM: Graph import correctly migrated to lfx namespace

The import path update from langflow.graph.graph.base to lfx.graph.graph.base maintains the same Graph class interface and functionality. All existing usage patterns including Graph.from_payload() remain valid with the new import location.

src/backend/base/langflow/api/v1/mcp_projects.py (1)

17-18: LGTM: MCP utility imports correctly updated for namespace migration

The import paths for MAX_MCP_SERVER_NAME_LENGTH and sanitize_mcp_name have been properly updated from langflow.base.mcp to lfx.base.mcp modules. This change is consistent with the broader namespace migration while preserving the same functionality for MCP server name handling.

src/backend/base/langflow/api/v1/mcp_utils.py (1)

15-16: LGTM: MCP utility imports successfully migrated to lfx namespace

The import path updates for MCP utilities (MAX_MCP_TOOL_NAME_LENGTH, get_flow_snake_case, get_unique_name, and sanitize_mcp_name) from langflow.base.mcp to lfx.base.mcp are consistent with the systematic namespace migration. All MCP functionality for tool name handling and flow lookup remains intact.

src/backend/base/langflow/base/agents/__init__.py (1)

1-3: Clean backwards compatibility implementation.

The backwards compatibility shim is well-implemented with a clear docstring and proper wildcard import from lfx.base.agents. The noqa: F403 comment appropriately suppresses the expected linting warning for the wildcard import, which is acceptable in this compatibility layer context.

.vscode/launch.json (1)

23-24: Appropriate debug configuration update for the lfx migration.

Adding ./src/lfx/* to the reload paths ensures that changes to the new lfx package are properly detected during development debugging. This maintains a smooth developer experience during the migration from langflow to lfx implementations.

src/backend/base/langflow/api/v1/chat.py (2)

19-20: Clean import path migration to lfx package.

The imports have been correctly updated from langflow.graph to lfx.graph for Graph and log_vertex_build. Based on the relevant code snippets, the functionality is equivalent and the usage throughout the file remains unchanged.


66-66: Type import correctly updated.

The InterfaceVertex type import has been properly migrated from langflow.graph.vertex.vertex_types to lfx.graph.vertex.vertex_types, maintaining consistency with the broader import path migration.

src/backend/base/langflow/base/io/chat.py (1)

1-7: Well-documented backwards compatibility module.

The backwards compatibility implementation is excellent with a clear docstring explaining the purpose and proper wildcard import from lfx.base.io.chat. The documentation and structure make the migration intent very clear to developers.

src/backend/base/langflow/base/io/__init__.py (1)

1-8: LGTM! Clean backwards compatibility implementation.

The transformation to a compatibility shim is well-executed with appropriate docstring, wildcard import from lfx.base.io, and proper linter suppressions. This maintains backwards compatibility while delegating implementation to the new lfx package structure.

src/backend/base/langflow/api/v1/endpoints.py (1)

14-22: Import path updates look correct.

The namespace migration from langflow to lfx is consistently applied across all relevant imports:

  • Component from lfx.custom.custom_component.component
  • Utility functions from lfx.custom.utils
  • Graph classes from lfx.graph

No functional changes were made, maintaining API compatibility while utilizing the new package structure.

src/backend/base/langflow/base/models/__init__.py (1)

1-3: Backwards compatibility module implemented correctly.

The transformation from explicit imports to a compatibility shim using wildcard import from lfx.base.models is appropriate. The docstring clearly explains the module's role in maintaining compatibility while delegating to the new lfx namespace.

src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json (5)

120-121: Metadata updated correctly for ChatInput component.

The code_hash and module metadata fields have been updated to reflect the new lfx.components.input_output.chat.ChatInput module path, maintaining consistency with the namespace migration.


201-201: Import statements updated correctly in ChatInput code.

The embedded Python code has been systematically updated to use lfx imports instead of langflow. All import paths are correctly migrated:

  • from lfx.base.data.utils import ...
  • from lfx.base.io.chat import ChatComponent
  • from lfx.inputs.inputs import ...
  • And other related imports

The component logic remains unchanged, ensuring functional compatibility.


618-619: ChatOutput metadata updated correctly.

The code_hash and module metadata have been updated to lfx.components.input_output.chat_output.ChatOutput, consistent with the namespace migration.


719-719: ChatOutput code imports fully migrated to lfx.

The embedded Python code for ChatOutput has been completely migrated to use lfx imports, showing a consistent pattern:

  • All imports use the lfx namespace
  • No mixed import patterns like seen in PromptComponent
  • Component functionality remains unchanged

This demonstrates the proper migration pattern.


1004-1004: LanguageModelComponent imports fully migrated to lfx.

The embedded Python code shows complete migration to lfx namespace:

  • Model constants from lfx.base.models.*
  • Base component from lfx.base.models.model
  • Input/output utilities from lfx.*

All imports are consistent with the new package structure, and the component logic remains intact.

src/backend/base/langflow/initial_setup/setup.py (1)

22-35: All lfx imports validated – ready to merge

All five constants (FIELD_FORMAT_ATTRIBUTES, NODE_FORMAT_ATTRIBUTES, ORJSON_OPTIONS, SKIPPED_COMPONENTS, SKIPPED_FIELD_ATTRIBUTES) and DEFAULT_PROMPT_INTUT_TYPES were found in the vendored lfx package. The namespace migration and import ordering follow project conventions.

pyproject.toml (2)

21-21: Dependency addition looks good.

The lfx~=0.1.0 dependency is appropriately versioned with a compatible release specifier, allowing patch updates while preventing potentially breaking minor version changes.


185-192: Workspace configuration properly integrates lfx package.

The addition of lfx as a workspace source and member at src/lfx correctly configures the monorepo structure.

src/backend/base/langflow/helpers/flow.py (2)

18-21: Type hint imports correctly migrated to lfx namespace.

The TYPE_CHECKING imports for Graph, RunOutputs, and Vertex have been properly updated to use the lfx.graph namespace.


50-50: Confirm external lfx package exports Graph and flow-processing utilities

The local imports within load_flow and json_schema_from_flow correctly reference:

  • lfx.graph.graph.base import Graph
  • lfx.base.flow_processing.utils for build_data_from_result_data and format_flow_output_data

Since these modules live in the external lfx package (not the local repo), please verify that:

Graph is exported from lfx.graph.graph.base
build_data_from_result_data and format_flow_output_data are defined in lfx.base.flow_processing.utils
• The installed lfx package version matches these APIs

src/backend/base/langflow/base/data/__init__.py (1)

1-4: Clean backwards compatibility wrapper implementation.

The module has been properly converted to a compatibility layer that re-exports all symbols from lfx.base.data. The docstring clearly explains the module's purpose, and the wildcard import with noqa comment is appropriate for this use case.

src/backend/base/langflow/custom/custom_component/custom_component.py (1)

1-4: Consistent backwards compatibility wrapper pattern.

The CustomComponent implementation has been properly migrated to lfx.custom.custom_component.custom_component with this module serving as a compatibility layer. This approach maintains API compatibility for existing code.

src/backend/base/langflow/custom/__init__.py (2)

1-5: Import organization follows good practices for namespace migration.

The import statements properly establish the re-export layer from lfx to langflow namespace. The use of noqa: PLC0414 comments is appropriate for suppressing "useless-import-alias" warnings since these are intentional re-exports for backward compatibility.


8-12: Verified module_name support in build_custom_component_template

The build_custom_component_template (and its input-based variant) in lfx.custom.utils accepts the module_name parameter and correctly propagates it—setting frontend_node.metadata["module"] and including it in code-hash generation. Backward compatibility is maintained; no changes required.

src/backend/base/langflow/base/prompts/api_utils.py (2)

1-4: Proper backward compatibility implementation.

The approach of using a wildcard import with clear documentation is appropriate for maintaining backward compatibility during the migration to lfx. The noqa: F403 comment correctly suppresses the wildcard import warning.


3-3: All expected functions confirmed in wildcard import

The lfx.base.prompts.api_utils module defines the following functions, matching those previously implemented locally:

  • validate_prompt(prompt_template: str, *, silent_errors: bool = False) -> list[str]
  • process_prompt_template(template: str, name: str, custom_fields: dict[str, list[str]] | None, frontend_node_template: dict[str, Any])
  • add_new_variables_to_template(input_variables, custom_fields, template, name) -> None
  • Internal helper _check_input_variables(input_variables)

Since wildcard imports bring in all public names (i.e., those without a leading underscore), validate_prompt, process_prompt_template, and add_new_variables_to_template will be correctly imported. No further action is needed.

src/backend/base/langflow/initial_setup/starter_projects/Custom Component Generator.json (2)

2015-2015: Verify lfx.base.data.utils path

ChatInput now imports from lfx.base.data.utils, but other converted code uses lfx.helpers.data.
Double-check that lfx.base.data.utils exists; if not, switch to the helper module to avoid another missing-module error.


240-242: Metadata path successfully updated

MemoryComponent now points to lfx.components.helpers.memory.MemoryComponent. Looks good and consistent with the new package layout.

src/backend/base/langflow/initial_setup/starter_projects/Financial Report Parser.json (7)

153-154: Module path updated correctly

The metadata module path has been properly updated from langflow to lfx namespace, maintaining consistency with the PR's refactoring objectives.


258-258: Import paths successfully migrated to lfx

All import statements have been correctly updated to use the lfx namespace instead of langflow, which aligns with the broader package restructuring effort.


468-469: Metadata module reference updated

The module path in metadata correctly reflects the new lfx namespace structure.


555-555: ChatInput imports properly migrated

Import statements have been updated to use lfx modules, maintaining the same import structure and functionality.


1088-1088: LanguageModelComponent imports updated

All imports have been correctly migrated from langflow to lfx namespace while preserving the original functionality.


1296-1297: StructuredOutput metadata updated

Module reference in metadata correctly points to the new lfx namespace.


1350-1350: StructuredOutputComponent imports migrated

All import statements have been properly updated to use the lfx namespace, maintaining consistency with the PR's objectives.

src/backend/base/langflow/custom/custom_component/component.py (1)

7-11: Backwards compatibility function looks good

The _get_component_toolkit() function provides appropriate backwards compatibility by importing and returning the ComponentToolkit from the new lfx module. The lazy import pattern is acceptable here since it's likely used sparingly during the migration period.

src/backend/base/langflow/initial_setup/starter_projects/Blog Writer.json (6)

355-356: LGTM - Consistent namespace migration.

The TextInputComponent properly uses the lfx namespace consistently across both metadata fields and embedded code imports. The updated code hash and module path correctly reflect the migration.

Also applies to: 394-394


471-472: LGTM - Consistent namespace migration.

The ChatOutput component properly uses the lfx namespace consistently across both metadata fields and embedded code imports. The migration appears complete and correct.

Also applies to: 570-570


794-795: LGTM - Consistent namespace migration.

The ParserComponent correctly uses the lfx namespace consistently across metadata and embedded code. The migration is properly implemented.

Also applies to: 835-835


981-982: LGTM - Well-executed namespace migration.

The URLComponent demonstrates a proper migration approach - external library imports remain unchanged while all Langflow-specific imports are consistently updated to use the lfx namespace. The utility function import get_user_agent from lfx.utils.request_utils shows good attention to detail in the migration.

Also applies to: 1072-1072


1424-1424: Verify metadata consistency for LanguageModelComponent.

While the embedded code correctly uses lfx namespace imports consistently, I notice that unlike other components in this file, there are no visible updates to the code_hash and module metadata fields for the LanguageModelComponent. Please verify that the metadata fields are also updated to reflect the migration to the lfx namespace.


219-219: Inconsistent import namespace usage detected.

The PromptComponent code mixes imports from both lfx and langflow namespaces. While the Component is imported from lfx.custom.custom_component.component, other imports still use the langflow namespace. This inconsistent approach could lead to compatibility issues.

Consider updating all imports to use the lfx namespace for consistency:

-from langflow.base.prompts.api_utils import process_prompt_template
-from lfx.custom.custom_component.component import Component
-from langflow.inputs.inputs import DefaultPromptField
-from langflow.io import MessageTextInput, Output, PromptInput
-from langflow.schema.message import Message
-from langflow.template.utils import update_template_values
+from lfx.base.prompts.api_utils import process_prompt_template
+from lfx.custom.custom_component.component import Component
+from lfx.inputs.inputs import DefaultPromptField
+from lfx.io import MessageTextInput, Output, PromptInput
+from lfx.schema.message import Message
+from lfx.template.utils import update_template_values
⛔ Skipped due to learnings
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/__init__.py : Update __init__.py with alphabetical imports when adding new components
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: When implementing a new component icon in Langflow, ensure the icon name is clear, recognizable, and used consistently across both backend (Python 'icon' attribute) and frontend (React/TypeScript mapping).
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.011Z
Learning: Applies to docs/docs/**/*.{md,mdx} : Use consistent terminology: always capitalize Langflow, Component, Flow, and uppercase API and JSON.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.092Z
Learning: Applies to src/backend/tests/**/*.py : Test backward compatibility across Langflow versions in backend Python tests by mapping component files to supported versions using 'VersionComponentMapping'.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.474Z
Learning: Applies to src/backend/base/langflow/components/**/*.py : Add new backend components to the appropriate subdirectory under src/backend/base/langflow/components/
src/backend/base/langflow/api/v1/starter_projects.py (3)

1-43: LGTM - Well-designed Pydantic models for API schema.

The new Pydantic models provide a good balance between schema definition and flexibility:

  • ViewPort properly defines the viewport coordinates and zoom level
  • NodeData and EdgeData use model_config = {"extra": "allow"} which is appropriate for handling complex, dynamic node/edge structures
  • GraphData uses dict[str, Any] for nodes/edges, providing flexibility while maintaining type safety
  • GraphDumpResponse includes all necessary fields with proper optional typing
  • Modern Pydantic v2 syntax is used correctly

This approach improves API documentation and validation while accommodating the complex nature of graph data structures.


45-45: LGTM - Improved type safety with explicit return annotation.

The explicit return type annotation list[GraphDumpResponse] improves type safety and makes the API contract clearer for consumers.


50-75: LGTM - Robust data conversion implementation.

The implementation correctly converts raw TypedDict data to Pydantic model instances:

  • Uses safe .get() methods with appropriate fallbacks to handle missing fields gracefully
  • Properly constructs nested GraphData and GraphDumpResponse models
  • Preserves existing error handling patterns
  • The comment referencing "lfx GraphDump" aligns with the broader package migration effort

The conversion logic is robust and maintains API stability while improving response structure and validation.

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

308-310: LGTM – metadata correctly migrated to lfx

The ChatOutput node now references lfx.components.input_output.chat_output.ChatOutput; this aligns with the new namespace.


672-674: LGTM – NeedleComponent metadata is up-to-date

"module": "lfx.components.needle.needle.NeedleComponent" is correct.


880-882: LGTM – ChatInput metadata is up-to-date

"module": "lfx.components.input_output.chat.ChatInput" is correct.

src/backend/base/langflow/initial_setup/starter_projects/Document Q&A.json (1)

352-367: Field-order still refers to store_message while the input is now should_store_message

The template adds an input named should_store_message, but the earlier field_order list (lines 137-144) still references the old store_message.
This causes the UI to ignore ordering for the new field.

Action: either rename the input back or update field_order accordingly to keep the node’s form stable.

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

151-152: Metadata correctly updated to lfx

module now points to the new package – good catch.

src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json (1)

1245-1252: Mixed langflow.* and lfx.* namespaces – double-check the dependency graph

SaveToFileComponent now lives under lfx.components.processing, yet still imports runtime services from langflow.api.* & langflow.services.*.
If the goal of the PR is to make starter projects self-contained against the external lfx package, these cross-package references will raise ModuleNotFoundError when users install only lfx.

Please verify the runtime environment:

  1. Do we still vendor the langflow server inside the mono-repo?
  2. If not, mirror the required helpers inside lfx (or expose them via an SDK) and update the imports.
src/backend/base/langflow/initial_setup/starter_projects/Market Research.json (2)

276-310: Verify the new import paths

ChatInput now imports inputs like so:

from lfx.inputs.inputs import BoolInput
from lfx.io import (
    DropdownInput,
    FileInput,
    MessageTextInput,
    MultilineInput,
    Output,
)
  1. lfx.inputs.inputs feels redundant (double inputs).
  2. Other components import BoolInput from lfx.io instead.

Please confirm that the public API really exposes BoolInput from lfx.inputs.inputs; otherwise adjust to a single, canonical path:

-from lfx.inputs.inputs import BoolInput
+from lfx.io import BoolInput

A quick grep across the repository for "inputs.inputs" will highlight any inconsistencies.


199-201: Metadata-only updates look good

The code_hash and module fields now point to the lfx namespace, aligning the starter project with the new package.

Also applies to: 500-502, 842-844, 1193-1195

"title_case": false,
"type": "code",
"value": "from langflow.base.prompts.api_utils import process_prompt_template\nfrom langflow.custom.custom_component.component import Component\nfrom langflow.inputs.inputs import DefaultPromptField\nfrom langflow.io import MessageTextInput, Output, PromptInput\nfrom langflow.schema.message import Message\nfrom langflow.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"braces\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n MessageTextInput(\n name=\"tool_placeholder\",\n display_name=\"Tool Placeholder\",\n tool_mode=True,\n advanced=True,\n info=\"A placeholder input for tool mode.\",\n ),\n ]\n\n outputs = [\n Output(display_name=\"Prompt\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(self) -> Message:\n prompt = Message.from_template(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n async def update_frontend_node(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"This function is called after the code validation is done.\"\"\"\n frontend_node = await super().update_frontend_node(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n"
"value": "from langflow.base.prompts.api_utils import process_prompt_template\nfrom lfx.custom.custom_component.component import Component\nfrom langflow.inputs.inputs import DefaultPromptField\nfrom langflow.io import MessageTextInput, Output, PromptInput\nfrom langflow.schema.message import Message\nfrom langflow.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"braces\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n MessageTextInput(\n name=\"tool_placeholder\",\n display_name=\"Tool Placeholder\",\n tool_mode=True,\n advanced=True,\n info=\"A placeholder input for tool mode.\",\n ),\n ]\n\n outputs = [\n Output(display_name=\"Prompt\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(self) -> Message:\n prompt = Message.from_template(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n async def update_frontend_node(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"This function is called after the code validation is done.\"\"\"\n frontend_node = await super().update_frontend_node(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n"
Copy link
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

Mixed import pattern in PromptComponent code.

The embedded code shows a mix of langflow and lfx imports. While lfx.custom.custom_component.component is used for Component, other imports still reference langflow modules like langflow.inputs.inputs, langflow.io, and langflow.schema.message.

This mixed pattern may be intentional if some modules haven't been migrated yet, but should be verified for consistency.


🏁 Script executed:

#!/bin/bash
# Description: Check for mixed import patterns across starter project files
# Expected: Identify if this mixed pattern is consistent across other starter projects

echo "=== Checking import patterns in starter project JSON files ==="
find src/backend/base/langflow/initial_setup/starter_projects -name "*.json" -exec grep -l "from langflow" {} \; | head -5 | while read file; do
    echo "File: $file"
    grep -o "from [a-zA-Z_.]*" "$file" | sort | uniq -c | sort -rn
    echo "---"
done

echo "=== Checking if PromptComponent has been migrated to lfx ==="
ast-grep --pattern 'class PromptComponent'

Length of output: 14497


🏁 Script executed:

#!/bin/bash
# Inspect imports in the migrated PromptComponent in lfx
grep -n "^from " src/lfx/src/lfx/components/processing/prompt.py

Length of output: 400


Update starter project JSON imports to lfx only

The starter templates under src/backend/base/langflow/initial_setup/starter_projects/ currently mix old langflow.* imports with the new lfx.* paths. Since PromptComponent has been fully migrated into the lfx package (src/lfx/src/lfx/components/processing/prompt.py uses only lfx.*), you should update these JSON files to import exclusively from lfx.*. Otherwise users loading the built‐in flows will hit missing‐module errors.

Replace in each file:

  • from langflow.base.prompts.api_utilsfrom lfx.base.prompts.api_utils
  • from langflow.inputs.inputsfrom lfx.inputs.inputs
  • from langflow.iofrom lfx.io
  • from langflow.schema.messagefrom lfx.schema.message
  • from langflow.template.utilsfrom lfx.template.utils

Affected files:

  • src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json
  • src/backend/base/langflow/initial_setup/starter_projects/Basic Prompt Chaining.json
  • src/backend/base/langflow/initial_setup/starter_projects/Blog Writer.json
  • src/backend/base/langflow/initial_setup/starter_projects/Custom Component Generator.json
  • src/backend/base/langflow/initial_setup/starter_projects/Document Q&A.json

After updating, rerun the setup to confirm no langflow.* imports remain.

🤖 Prompt for AI Agents
In src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json
at line 448, update all import statements that start with "from langflow." to
use "from lfx." instead. Specifically, replace "from
langflow.base.prompts.api_utils" with "from lfx.base.prompts.api_utils", "from
langflow.inputs.inputs" with "from lfx.inputs.inputs", "from langflow.io" with
"from lfx.io", "from langflow.schema.message" with "from lfx.schema.message",
and "from langflow.template.utils" with "from lfx.template.utils". This ensures
all imports in the JSON starter project file use the new lfx package paths to
avoid missing module errors.

"title_case": false,
"type": "code",
"value": "from langflow.base.prompts.api_utils import process_prompt_template\nfrom langflow.custom.custom_component.component import Component\nfrom langflow.inputs.inputs import DefaultPromptField\nfrom langflow.io import MessageTextInput, Output, PromptInput\nfrom langflow.schema.message import Message\nfrom langflow.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"braces\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n MessageTextInput(\n name=\"tool_placeholder\",\n display_name=\"Tool Placeholder\",\n tool_mode=True,\n advanced=True,\n info=\"A placeholder input for tool mode.\",\n ),\n ]\n\n outputs = [\n Output(display_name=\"Prompt\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(self) -> Message:\n prompt = Message.from_template(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n async def update_frontend_node(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"This function is called after the code validation is done.\"\"\"\n frontend_node = await super().update_frontend_node(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n"
"value": "from langflow.base.prompts.api_utils import process_prompt_template\nfrom lfx.custom.custom_component.component import Component\nfrom langflow.inputs.inputs import DefaultPromptField\nfrom langflow.io import MessageTextInput, Output, PromptInput\nfrom langflow.schema.message import Message\nfrom langflow.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"braces\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n MessageTextInput(\n name=\"tool_placeholder\",\n display_name=\"Tool Placeholder\",\n tool_mode=True,\n advanced=True,\n info=\"A placeholder input for tool mode.\",\n ),\n ]\n\n outputs = [\n Output(display_name=\"Prompt\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(self) -> Message:\n prompt = Message.from_template(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n async def update_frontend_node(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"This function is called after the code validation is done.\"\"\"\n frontend_node = await super().update_frontend_node(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Imports still target deprecated langflow.* namespace

PromptComponent's code string keeps pulling helpers from langflow.* packages.
After the renaming to lfx, these imports will break at runtime.

-from langflow.base.prompts.api_utils import process_prompt_template
-from langflow.inputs.inputs import DefaultPromptField
-from langflow.io import MessageTextInput, Output, PromptInput
-from langflow.schema.message import Message
-from langflow.template.utils import update_template_values
+from lfx.base.prompts.api_utils import process_prompt_template
+from lfx.inputs.inputs import DefaultPromptField
+from lfx.io import MessageTextInput, Output, PromptInput
+from lfx.schema.message import Message
+from lfx.template.utils import update_template_values

Search/replace the whole code string (and metadata module field) to reference the new lfx paths, otherwise this starter project won’t load.

📝 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
"value": "from langflow.base.prompts.api_utils import process_prompt_template\nfrom lfx.custom.custom_component.component import Component\nfrom langflow.inputs.inputs import DefaultPromptField\nfrom langflow.io import MessageTextInput, Output, PromptInput\nfrom langflow.schema.message import Message\nfrom langflow.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"braces\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n MessageTextInput(\n name=\"tool_placeholder\",\n display_name=\"Tool Placeholder\",\n tool_mode=True,\n advanced=True,\n info=\"A placeholder input for tool mode.\",\n ),\n ]\n\n outputs = [\n Output(display_name=\"Prompt\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(self) -> Message:\n prompt = Message.from_template(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n async def update_frontend_node(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"This function is called after the code validation is done.\"\"\"\n frontend_node = await super().update_frontend_node(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n"
"value": "from lfx.base.prompts.api_utils import process_prompt_template\nfrom lfx.custom.custom_component.component import Component\nfrom lfx.inputs.inputs import DefaultPromptField\nfrom lfx.io import MessageTextInput, Output, PromptInput\nfrom lfx.schema.message import Message\nfrom lfx.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"braces\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n MessageTextInput(\n name=\"tool_placeholder\",\n display_name=\"Tool Placeholder\",\n tool_mode=True,\n advanced=True,\n info=\"A placeholder input for tool mode.\",\n ),\n ]\n\n outputs = [\n Output(display_name=\"Prompt\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(self) -> Message:\n prompt = Message.from_template(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n async def update_frontend_node(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"This function is called after the code validation is done.\"\"\"\n frontend_node = await super().update_frontend_node(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\""
🤖 Prompt for AI Agents
In src/backend/base/langflow/initial_setup/starter_projects/Custom Component
Generator.json at line 720, the import statements in the code string still use
the deprecated langflow.* namespace, which will cause runtime errors. Update all
import paths in the code string from langflow.* to the corresponding lfx.* paths
to reflect the renaming. Also, ensure the metadata module field references the
new lfx namespace to prevent loading issues with this starter project.

"title_case": false,
"type": "code",
"value": "from langflow.base.prompts.api_utils import process_prompt_template\nfrom langflow.custom.custom_component.component import Component\nfrom langflow.inputs.inputs import DefaultPromptField\nfrom langflow.io import MessageTextInput, Output, PromptInput\nfrom langflow.schema.message import Message\nfrom langflow.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"braces\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n MessageTextInput(\n name=\"tool_placeholder\",\n display_name=\"Tool Placeholder\",\n tool_mode=True,\n advanced=True,\n info=\"A placeholder input for tool mode.\",\n ),\n ]\n\n outputs = [\n Output(display_name=\"Prompt\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(self) -> Message:\n prompt = Message.from_template(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n async def update_frontend_node(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"This function is called after the code validation is done.\"\"\"\n frontend_node = await super().update_frontend_node(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n"
"value": "from langflow.base.prompts.api_utils import process_prompt_template\nfrom lfx.custom.custom_component.component import Component\nfrom langflow.inputs.inputs import DefaultPromptField\nfrom langflow.io import MessageTextInput, Output, PromptInput\nfrom langflow.schema.message import Message\nfrom langflow.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"braces\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n MessageTextInput(\n name=\"tool_placeholder\",\n display_name=\"Tool Placeholder\",\n tool_mode=True,\n advanced=True,\n info=\"A placeholder input for tool mode.\",\n ),\n ]\n\n outputs = [\n Output(display_name=\"Prompt\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(self) -> Message:\n prompt = Message.from_template(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n async def update_frontend_node(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"This function is called after the code validation is done.\"\"\"\n frontend_node = await super().update_frontend_node(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Update PromptComponent’s imports to lfx.*

Inside the embedded code block the first three import lines still use langflow.*. With the new package layout those modules are now exported from lfx.*.

-from langflow.base.prompts.api_utils import process_prompt_template
-from langflow.inputs.inputs import DefaultPromptField
-from langflow.io import MessageTextInput, Output, PromptInput
-from langflow.schema.message import Message
-from langflow.template.utils import update_template_values
+from lfx.base.prompts.api_utils import process_prompt_template
+from lfx.inputs.inputs import DefaultPromptField
+from lfx.io import MessageTextInput, Output, PromptInput
+from lfx.schema.message import Message
+from lfx.template.utils import update_template_values

Search/replace any other lingering langflow. references in this block to avoid import errors.

📝 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
"value": "from langflow.base.prompts.api_utils import process_prompt_template\nfrom lfx.custom.custom_component.component import Component\nfrom langflow.inputs.inputs import DefaultPromptField\nfrom langflow.io import MessageTextInput, Output, PromptInput\nfrom langflow.schema.message import Message\nfrom langflow.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"braces\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n MessageTextInput(\n name=\"tool_placeholder\",\n display_name=\"Tool Placeholder\",\n tool_mode=True,\n advanced=True,\n info=\"A placeholder input for tool mode.\",\n ),\n ]\n\n outputs = [\n Output(display_name=\"Prompt\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(self) -> Message:\n prompt = Message.from_template(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n async def update_frontend_node(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"This function is called after the code validation is done.\"\"\"\n frontend_node = await super().update_frontend_node(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n"
"value": "from lfx.base.prompts.api_utils import process_prompt_template\nfrom lfx.custom.custom_component.component import Component\nfrom lfx.inputs.inputs import DefaultPromptField\nfrom lfx.io import MessageTextInput, Output, PromptInput\nfrom lfx.schema.message import Message\nfrom lfx.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"braces\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n MessageTextInput(\n name=\"tool_placeholder\",\n display_name=\"Tool Placeholder\",\n tool_mode=True,\n advanced=True,\n info=\"A placeholder input for tool mode.\",\n ),\n ]\n\n outputs = [\n Output(display_name=\"Prompt\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(self) -> Message:\n prompt = Message.from_template(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n async def update_frontend_node(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"This function is called after the code validation is done.\"\"\"\n frontend_node = await super().update_frontend_node(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n"
🤖 Prompt for AI Agents
In src/backend/base/langflow/initial_setup/starter_projects/Invoice
Summarizer.json at line 215, the PromptComponent class imports still use the old
langflow.* package paths. Update the first three import statements to use the
new lfx.* package paths instead. Also, search through the entire code block for
any other langflow.* references and replace them with the appropriate lfx.*
paths to prevent import errors.

Comment on lines 841 to 842
"value": "from langflow.base.prompts.api_utils import process_prompt_template\nfrom lfx.custom.custom_component.component import Component\nfrom langflow.inputs.inputs import DefaultPromptField\nfrom langflow.io import MessageTextInput, Output, PromptInput\nfrom langflow.schema.message import Message\nfrom langflow.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"braces\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n MessageTextInput(\n name=\"tool_placeholder\",\n display_name=\"Tool Placeholder\",\n tool_mode=True,\n advanced=True,\n info=\"A placeholder input for tool mode.\",\n ),\n ]\n\n outputs = [\n Output(display_name=\"Prompt\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(self) -> Message:\n prompt = Message.from_template(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n async def update_frontend_node(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"This function is called after the code validation is done.\"\"\"\n frontend_node = await super().update_frontend_node(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Prompt component still references langflow – update to lfx before the cut-over

The embedded PromptComponent code was touched in this PR but its imports and metadata remain under the deprecated langflow.* namespace. These will explode once langflow is removed.

-from langflow.base.prompts.api_utils import process_prompt_template
-from langflow.inputs.inputs import DefaultPromptField
-from langflow.io import MessageTextInput, Output, PromptInput
-from langflow.schema.message import Message
-from langflow.template.utils import update_template_values
+from lfx.base.prompts.api_utils import process_prompt_template
+from lfx.inputs.inputs import DefaultPromptField
+from lfx.io import MessageTextInput, Output, PromptInput
+from lfx.schema.message import Message
+from lfx.template.utils import update_template_values

And in the metadata section:

-  "module": "langflow.components.prompts.prompt.PromptComponent"
+  "module": "lfx.components.prompts.prompt.PromptComponent"

Please realign all PromptComponent references (imports, module path, tests) to the new package.

📝 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
"value": "from langflow.base.prompts.api_utils import process_prompt_template\nfrom lfx.custom.custom_component.component import Component\nfrom langflow.inputs.inputs import DefaultPromptField\nfrom langflow.io import MessageTextInput, Output, PromptInput\nfrom langflow.schema.message import Message\nfrom langflow.template.utils import update_template_values\n\n\nclass PromptComponent(Component):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"braces\"\n trace_type = \"prompt\"\n name = \"Prompt\"\n\n inputs = [\n PromptInput(name=\"template\", display_name=\"Template\"),\n MessageTextInput(\n name=\"tool_placeholder\",\n display_name=\"Tool Placeholder\",\n tool_mode=True,\n advanced=True,\n info=\"A placeholder input for tool mode.\",\n ),\n ]\n\n outputs = [\n Output(display_name=\"Prompt\", name=\"prompt\", method=\"build_prompt\"),\n ]\n\n async def build_prompt(self) -> Message:\n prompt = Message.from_template(**self._attributes)\n self.status = prompt.text\n return prompt\n\n def _update_template(self, frontend_node: dict):\n prompt_template = frontend_node[\"template\"][\"template\"][\"value\"]\n custom_fields = frontend_node[\"custom_fields\"]\n frontend_node_template = frontend_node[\"template\"]\n _ = process_prompt_template(\n template=prompt_template,\n name=\"template\",\n custom_fields=custom_fields,\n frontend_node_template=frontend_node_template,\n )\n return frontend_node\n\n async def update_frontend_node(self, new_frontend_node: dict, current_frontend_node: dict):\n \"\"\"This function is called after the code validation is done.\"\"\"\n frontend_node = await super().update_frontend_node(new_frontend_node, current_frontend_node)\n template = frontend_node[\"template\"][\"template\"][\"value\"]\n # Kept it duplicated for backwards compatibility\n _ = process_prompt_template(\n template=template,\n name=\"template\",\n custom_fields=frontend_node[\"custom_fields\"],\n frontend_node_template=frontend_node[\"template\"],\n )\n # Now that template is updated, we need to grab any values that were set in the current_frontend_node\n # and update the frontend_node with those values\n update_template_values(new_template=frontend_node, previous_template=current_frontend_node[\"template\"])\n return frontend_node\n\n def _get_fallback_input(self, **kwargs):\n return DefaultPromptField(**kwargs)\n"
},
// Within the JSON “value” string for the PromptComponent code:
-from langflow.base.prompts.api_utils import process_prompt_template
+from lfx.base.prompts.api_utils import process_prompt_template
from lfx.custom.custom_component.component import Component
-from langflow.inputs.inputs import DefaultPromptField
+from lfx.inputs.inputs import DefaultPromptField
-from langflow.io import MessageTextInput, Output, PromptInput
+from lfx.io import MessageTextInput, Output, PromptInput
-from langflow.schema.message import Message
+from lfx.schema.message import Message
-from langflow.template.utils import update_template_values
+from lfx.template.utils import update_template_values
// In the metadata section of the same JSON object:
- "module": "langflow.components.prompts.prompt.PromptComponent"
+ "module": "lfx.components.prompts.prompt.PromptComponent"
🤖 Prompt for AI Agents
In src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json
around lines 841 to 842, the PromptComponent code still imports and references
the deprecated langflow namespace. Update all import statements and metadata
references from langflow.* to the new lfx.* package to prevent runtime errors
after langflow removal. Ensure consistency by changing all occurrences in
imports, class attributes, and any related tests or metadata to use the lfx
namespace.

Comment on lines 652 to 656
"show": true,
"title_case": false,
"type": "code",
"value": "from collections.abc import Generator\nfrom typing import Any\n\nimport orjson\nfrom fastapi.encoders import jsonable_encoder\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.helpers.data import safe_convert\nfrom langflow.inputs.inputs import BoolInput, DropdownInput, HandleInput, MessageTextInput\nfrom langflow.schema.data import Data\nfrom langflow.schema.dataframe import DataFrame\nfrom langflow.schema.message import Message\nfrom langflow.schema.properties import Source\nfrom langflow.template.field.base import Output\nfrom langflow.utils.constants import (\n MESSAGE_SENDER_AI,\n MESSAGE_SENDER_NAME_AI,\n MESSAGE_SENDER_USER,\n)\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n documentation: str = \"https://docs.langflow.org/components-io#chat-output\"\n icon = \"MessagesSquare\"\n name = \"ChatOutput\"\n minimized = True\n\n inputs = [\n HandleInput(\n name=\"input_value\",\n display_name=\"Inputs\",\n info=\"Message to be passed as output.\",\n input_types=[\"Data\", \"DataFrame\", \"Message\"],\n required=True,\n ),\n BoolInput(\n name=\"should_store_message\",\n display_name=\"Store Messages\",\n info=\"Store the message in the history.\",\n value=True,\n advanced=True,\n ),\n DropdownInput(\n name=\"sender\",\n display_name=\"Sender Type\",\n options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER],\n value=MESSAGE_SENDER_AI,\n advanced=True,\n info=\"Type of sender.\",\n ),\n MessageTextInput(\n name=\"sender_name\",\n display_name=\"Sender Name\",\n info=\"Name of the sender.\",\n value=MESSAGE_SENDER_NAME_AI,\n advanced=True,\n ),\n MessageTextInput(\n name=\"session_id\",\n display_name=\"Session ID\",\n info=\"The session ID of the chat. If empty, the current session ID parameter will be used.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"data_template\",\n display_name=\"Data Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.\",\n ),\n MessageTextInput(\n name=\"background_color\",\n display_name=\"Background Color\",\n info=\"The background color of the icon.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"chat_icon\",\n display_name=\"Icon\",\n info=\"The icon of the message.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"text_color\",\n display_name=\"Text Color\",\n info=\"The text color of the name\",\n advanced=True,\n ),\n BoolInput(\n name=\"clean_data\",\n display_name=\"Basic Clean Data\",\n value=True,\n info=\"Whether to clean the data\",\n advanced=True,\n ),\n ]\n outputs = [\n Output(\n display_name=\"Output Message\",\n name=\"message\",\n method=\"message_response\",\n ),\n ]\n\n def _build_source(self, id_: str | None, display_name: str | None, source: str | None) -> Source:\n source_dict = {}\n if id_:\n source_dict[\"id\"] = id_\n if display_name:\n source_dict[\"display_name\"] = display_name\n if source:\n # Handle case where source is a ChatOpenAI object\n if hasattr(source, \"model_name\"):\n source_dict[\"source\"] = source.model_name\n elif hasattr(source, \"model\"):\n source_dict[\"source\"] = str(source.model)\n else:\n source_dict[\"source\"] = str(source)\n return Source(**source_dict)\n\n async def message_response(self) -> Message:\n # First convert the input to string if needed\n text = self.convert_to_string()\n\n # Get source properties\n source, icon, display_name, source_id = self.get_properties_from_source_component()\n background_color = self.background_color\n text_color = self.text_color\n if self.chat_icon:\n icon = self.chat_icon\n\n # Create or use existing Message object\n if isinstance(self.input_value, Message):\n message = self.input_value\n # Update message properties\n message.text = text\n else:\n message = Message(text=text)\n\n # Set message properties\n message.sender = self.sender\n message.sender_name = self.sender_name\n message.session_id = self.session_id\n message.flow_id = self.graph.flow_id if hasattr(self, \"graph\") else None\n message.properties.source = self._build_source(source_id, display_name, source)\n message.properties.icon = icon\n message.properties.background_color = background_color\n message.properties.text_color = text_color\n\n # Store message if needed\n if self.session_id and self.should_store_message:\n stored_message = await self.send_message(message)\n self.message.value = stored_message\n message = stored_message\n\n self.status = message\n return message\n\n def _serialize_data(self, data: Data) -> str:\n \"\"\"Serialize Data object to JSON string.\"\"\"\n # Convert data.data to JSON-serializable format\n serializable_data = jsonable_encoder(data.data)\n # Serialize with orjson, enabling pretty printing with indentation\n json_bytes = orjson.dumps(serializable_data, option=orjson.OPT_INDENT_2)\n # Convert bytes to string and wrap in Markdown code blocks\n return \"```json\\n\" + json_bytes.decode(\"utf-8\") + \"\\n```\"\n\n def _validate_input(self) -> None:\n \"\"\"Validate the input data and raise ValueError if invalid.\"\"\"\n if self.input_value is None:\n msg = \"Input data cannot be None\"\n raise ValueError(msg)\n if isinstance(self.input_value, list) and not all(\n isinstance(item, Message | Data | DataFrame | str) for item in self.input_value\n ):\n invalid_types = [\n type(item).__name__\n for item in self.input_value\n if not isinstance(item, Message | Data | DataFrame | str)\n ]\n msg = f\"Expected Data or DataFrame or Message or str, got {invalid_types}\"\n raise TypeError(msg)\n if not isinstance(\n self.input_value,\n Message | Data | DataFrame | str | list | Generator | type(None),\n ):\n type_name = type(self.input_value).__name__\n msg = f\"Expected Data or DataFrame or Message or str, Generator or None, got {type_name}\"\n raise TypeError(msg)\n\n def convert_to_string(self) -> str | Generator[Any, None, None]:\n \"\"\"Convert input data to string with proper error handling.\"\"\"\n self._validate_input()\n if isinstance(self.input_value, list):\n return \"\\n\".join([safe_convert(item, clean_data=self.clean_data) for item in self.input_value])\n if isinstance(self.input_value, Generator):\n return self.input_value\n return safe_convert(self.input_value)\n"
"value": "from collections.abc import Generator\nfrom typing import Any\n\nimport orjson\nfrom fastapi.encoders import jsonable_encoder\n\nfrom lfx.base.io.chat import ChatComponent\nfrom lfx.helpers.data import safe_convert\nfrom lfx.inputs.inputs import BoolInput, DropdownInput, HandleInput, MessageTextInput\nfrom lfx.schema.data import Data\nfrom lfx.schema.dataframe import DataFrame\nfrom lfx.schema.message import Message\nfrom lfx.schema.properties import Source\nfrom lfx.template.field.base import Output\nfrom lfx.utils.constants import (\n MESSAGE_SENDER_AI,\n MESSAGE_SENDER_NAME_AI,\n MESSAGE_SENDER_USER,\n)\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n documentation: str = \"https://docs.langflow.org/components-io#chat-output\"\n icon = \"MessagesSquare\"\n name = \"ChatOutput\"\n minimized = True\n\n inputs = [\n HandleInput(\n name=\"input_value\",\n display_name=\"Inputs\",\n info=\"Message to be passed as output.\",\n input_types=[\"Data\", \"DataFrame\", \"Message\"],\n required=True,\n ),\n BoolInput(\n name=\"should_store_message\",\n display_name=\"Store Messages\",\n info=\"Store the message in the history.\",\n value=True,\n advanced=True,\n ),\n DropdownInput(\n name=\"sender\",\n display_name=\"Sender Type\",\n options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER],\n value=MESSAGE_SENDER_AI,\n advanced=True,\n info=\"Type of sender.\",\n ),\n MessageTextInput(\n name=\"sender_name\",\n display_name=\"Sender Name\",\n info=\"Name of the sender.\",\n value=MESSAGE_SENDER_NAME_AI,\n advanced=True,\n ),\n MessageTextInput(\n name=\"session_id\",\n display_name=\"Session ID\",\n info=\"The session ID of the chat. If empty, the current session ID parameter will be used.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"data_template\",\n display_name=\"Data Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.\",\n ),\n MessageTextInput(\n name=\"background_color\",\n display_name=\"Background Color\",\n info=\"The background color of the icon.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"chat_icon\",\n display_name=\"Icon\",\n info=\"The icon of the message.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"text_color\",\n display_name=\"Text Color\",\n info=\"The text color of the name\",\n advanced=True,\n ),\n BoolInput(\n name=\"clean_data\",\n display_name=\"Basic Clean Data\",\n value=True,\n info=\"Whether to clean the data\",\n advanced=True,\n ),\n ]\n outputs = [\n Output(\n display_name=\"Output Message\",\n name=\"message\",\n method=\"message_response\",\n ),\n ]\n\n def _build_source(self, id_: str | None, display_name: str | None, source: str | None) -> Source:\n source_dict = {}\n if id_:\n source_dict[\"id\"] = id_\n if display_name:\n source_dict[\"display_name\"] = display_name\n if source:\n # Handle case where source is a ChatOpenAI object\n if hasattr(source, \"model_name\"):\n source_dict[\"source\"] = source.model_name\n elif hasattr(source, \"model\"):\n source_dict[\"source\"] = str(source.model)\n else:\n source_dict[\"source\"] = str(source)\n return Source(**source_dict)\n\n async def message_response(self) -> Message:\n # First convert the input to string if needed\n text = self.convert_to_string()\n\n # Get source properties\n source, icon, display_name, source_id = self.get_properties_from_source_component()\n background_color = self.background_color\n text_color = self.text_color\n if self.chat_icon:\n icon = self.chat_icon\n\n # Create or use existing Message object\n if isinstance(self.input_value, Message):\n message = self.input_value\n # Update message properties\n message.text = text\n else:\n message = Message(text=text)\n\n # Set message properties\n message.sender = self.sender\n message.sender_name = self.sender_name\n message.session_id = self.session_id\n message.flow_id = self.graph.flow_id if hasattr(self, \"graph\") else None\n message.properties.source = self._build_source(source_id, display_name, source)\n message.properties.icon = icon\n message.properties.background_color = background_color\n message.properties.text_color = text_color\n\n # Store message if needed\n if self.session_id and self.should_store_message:\n stored_message = await self.send_message(message)\n self.message.value = stored_message\n message = stored_message\n\n self.status = message\n return message\n\n def _serialize_data(self, data: Data) -> str:\n \"\"\"Serialize Data object to JSON string.\"\"\"\n # Convert data.data to JSON-serializable format\n serializable_data = jsonable_encoder(data.data)\n # Serialize with orjson, enabling pretty printing with indentation\n json_bytes = orjson.dumps(serializable_data, option=orjson.OPT_INDENT_2)\n # Convert bytes to string and wrap in Markdown code blocks\n return \"```json\\n\" + json_bytes.decode(\"utf-8\") + \"\\n```\"\n\n def _validate_input(self) -> None:\n \"\"\"Validate the input data and raise ValueError if invalid.\"\"\"\n if self.input_value is None:\n msg = \"Input data cannot be None\"\n raise ValueError(msg)\n if isinstance(self.input_value, list) and not all(\n isinstance(item, Message | Data | DataFrame | str) for item in self.input_value\n ):\n invalid_types = [\n type(item).__name__\n for item in self.input_value\n if not isinstance(item, Message | Data | DataFrame | str)\n ]\n msg = f\"Expected Data or DataFrame or Message or str, got {invalid_types}\"\n raise TypeError(msg)\n if not isinstance(\n self.input_value,\n Message | Data | DataFrame | str | list | Generator | type(None),\n ):\n type_name = type(self.input_value).__name__\n msg = f\"Expected Data or DataFrame or Message or str, Generator or None, got {type_name}\"\n raise TypeError(msg)\n\n def convert_to_string(self) -> str | Generator[Any, None, None]:\n \"\"\"Convert input data to string with proper error handling.\"\"\"\n self._validate_input()\n if isinstance(self.input_value, list):\n return \"\\n\".join([safe_convert(item, clean_data=self.clean_data) for item in self.input_value])\n if isinstance(self.input_value, Generator):\n return self.input_value\n return safe_convert(self.input_value)\n"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

isinstance with PEP-604 unions will raise at runtime

Inside the embedded ChatOutput implementation, the helper _validate_input contains several constructs like
isinstance(item, Message | Data | DataFrame | str) and
isinstance(self.input_value, Message | Data | DataFrame | str | list | Generator | type(None)).

isinstance accepts a type or a tuple of types, not a PEP-604 union.
At runtime this explodes with TypeError: isinstance() arg 2 must be a type or tuple of types.

Minimal fix (apply for every affected call):

- if isinstance(item, Message | Data | DataFrame | str)
+ if isinstance(item, (Message, Data, DataFrame, str))

and

- if not isinstance(self.input_value, Message | Data | DataFrame | str | list | Generator | type(None)):
+ if not isinstance(self.input_value, (Message, Data, DataFrame, str, list, Generator, type(None))):

Without the change, any invocation of this component crashes before reaching business logic.

📝 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
"show": true,
"title_case": false,
"type": "code",
"value": "from collections.abc import Generator\nfrom typing import Any\n\nimport orjson\nfrom fastapi.encoders import jsonable_encoder\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.helpers.data import safe_convert\nfrom langflow.inputs.inputs import BoolInput, DropdownInput, HandleInput, MessageTextInput\nfrom langflow.schema.data import Data\nfrom langflow.schema.dataframe import DataFrame\nfrom langflow.schema.message import Message\nfrom langflow.schema.properties import Source\nfrom langflow.template.field.base import Output\nfrom langflow.utils.constants import (\n MESSAGE_SENDER_AI,\n MESSAGE_SENDER_NAME_AI,\n MESSAGE_SENDER_USER,\n)\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n documentation: str = \"https://docs.langflow.org/components-io#chat-output\"\n icon = \"MessagesSquare\"\n name = \"ChatOutput\"\n minimized = True\n\n inputs = [\n HandleInput(\n name=\"input_value\",\n display_name=\"Inputs\",\n info=\"Message to be passed as output.\",\n input_types=[\"Data\", \"DataFrame\", \"Message\"],\n required=True,\n ),\n BoolInput(\n name=\"should_store_message\",\n display_name=\"Store Messages\",\n info=\"Store the message in the history.\",\n value=True,\n advanced=True,\n ),\n DropdownInput(\n name=\"sender\",\n display_name=\"Sender Type\",\n options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER],\n value=MESSAGE_SENDER_AI,\n advanced=True,\n info=\"Type of sender.\",\n ),\n MessageTextInput(\n name=\"sender_name\",\n display_name=\"Sender Name\",\n info=\"Name of the sender.\",\n value=MESSAGE_SENDER_NAME_AI,\n advanced=True,\n ),\n MessageTextInput(\n name=\"session_id\",\n display_name=\"Session ID\",\n info=\"The session ID of the chat. If empty, the current session ID parameter will be used.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"data_template\",\n display_name=\"Data Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.\",\n ),\n MessageTextInput(\n name=\"background_color\",\n display_name=\"Background Color\",\n info=\"The background color of the icon.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"chat_icon\",\n display_name=\"Icon\",\n info=\"The icon of the message.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"text_color\",\n display_name=\"Text Color\",\n info=\"The text color of the name\",\n advanced=True,\n ),\n BoolInput(\n name=\"clean_data\",\n display_name=\"Basic Clean Data\",\n value=True,\n info=\"Whether to clean the data\",\n advanced=True,\n ),\n ]\n outputs = [\n Output(\n display_name=\"Output Message\",\n name=\"message\",\n method=\"message_response\",\n ),\n ]\n\n def _build_source(self, id_: str | None, display_name: str | None, source: str | None) -> Source:\n source_dict = {}\n if id_:\n source_dict[\"id\"] = id_\n if display_name:\n source_dict[\"display_name\"] = display_name\n if source:\n # Handle case where source is a ChatOpenAI object\n if hasattr(source, \"model_name\"):\n source_dict[\"source\"] = source.model_name\n elif hasattr(source, \"model\"):\n source_dict[\"source\"] = str(source.model)\n else:\n source_dict[\"source\"] = str(source)\n return Source(**source_dict)\n\n async def message_response(self) -> Message:\n # First convert the input to string if needed\n text = self.convert_to_string()\n\n # Get source properties\n source, icon, display_name, source_id = self.get_properties_from_source_component()\n background_color = self.background_color\n text_color = self.text_color\n if self.chat_icon:\n icon = self.chat_icon\n\n # Create or use existing Message object\n if isinstance(self.input_value, Message):\n message = self.input_value\n # Update message properties\n message.text = text\n else:\n message = Message(text=text)\n\n # Set message properties\n message.sender = self.sender\n message.sender_name = self.sender_name\n message.session_id = self.session_id\n message.flow_id = self.graph.flow_id if hasattr(self, \"graph\") else None\n message.properties.source = self._build_source(source_id, display_name, source)\n message.properties.icon = icon\n message.properties.background_color = background_color\n message.properties.text_color = text_color\n\n # Store message if needed\n if self.session_id and self.should_store_message:\n stored_message = await self.send_message(message)\n self.message.value = stored_message\n message = stored_message\n\n self.status = message\n return message\n\n def _serialize_data(self, data: Data) -> str:\n \"\"\"Serialize Data object to JSON string.\"\"\"\n # Convert data.data to JSON-serializable format\n serializable_data = jsonable_encoder(data.data)\n # Serialize with orjson, enabling pretty printing with indentation\n json_bytes = orjson.dumps(serializable_data, option=orjson.OPT_INDENT_2)\n # Convert bytes to string and wrap in Markdown code blocks\n return \"```json\\n\" + json_bytes.decode(\"utf-8\") + \"\\n```\"\n\n def _validate_input(self) -> None:\n \"\"\"Validate the input data and raise ValueError if invalid.\"\"\"\n if self.input_value is None:\n msg = \"Input data cannot be None\"\n raise ValueError(msg)\n if isinstance(self.input_value, list) and not all(\n isinstance(item, Message | Data | DataFrame | str) for item in self.input_value\n ):\n invalid_types = [\n type(item).__name__\n for item in self.input_value\n if not isinstance(item, Message | Data | DataFrame | str)\n ]\n msg = f\"Expected Data or DataFrame or Message or str, got {invalid_types}\"\n raise TypeError(msg)\n if not isinstance(\n self.input_value,\n Message | Data | DataFrame | str | list | Generator | type(None),\n ):\n type_name = type(self.input_value).__name__\n msg = f\"Expected Data or DataFrame or Message or str, Generator or None, got {type_name}\"\n raise TypeError(msg)\n\n def convert_to_string(self) -> str | Generator[Any, None, None]:\n \"\"\"Convert input data to string with proper error handling.\"\"\"\n self._validate_input()\n if isinstance(self.input_value, list):\n return \"\\n\".join([safe_convert(item, clean_data=self.clean_data) for item in self.input_value])\n if isinstance(self.input_value, Generator):\n return self.input_value\n return safe_convert(self.input_value)\n"
"value": "from collections.abc import Generator\nfrom typing import Any\n\nimport orjson\nfrom fastapi.encoders import jsonable_encoder\n\nfrom lfx.base.io.chat import ChatComponent\nfrom lfx.helpers.data import safe_convert\nfrom lfx.inputs.inputs import BoolInput, DropdownInput, HandleInput, MessageTextInput\nfrom lfx.schema.data import Data\nfrom lfx.schema.dataframe import DataFrame\nfrom lfx.schema.message import Message\nfrom lfx.schema.properties import Source\nfrom lfx.template.field.base import Output\nfrom lfx.utils.constants import (\n MESSAGE_SENDER_AI,\n MESSAGE_SENDER_NAME_AI,\n MESSAGE_SENDER_USER,\n)\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Playground.\"\n documentation: str = \"https://docs.langflow.org/components-io#chat-output\"\n icon = \"MessagesSquare\"\n name = \"ChatOutput\"\n minimized = True\n\n inputs = [\n HandleInput(\n name=\"input_value\",\n display_name=\"Inputs\",\n info=\"Message to be passed as output.\",\n input_types=[\"Data\", \"DataFrame\", \"Message\"],\n required=True,\n ),\n BoolInput(\n name=\"should_store_message\",\n display_name=\"Store Messages\",\n info=\"Store the message in the history.\",\n value=True,\n advanced=True,\n ),\n DropdownInput(\n name=\"sender\",\n display_name=\"Sender Type\",\n options=[MESSAGE_SENDER_AI, MESSAGE_SENDER_USER],\n value=MESSAGE_SENDER_AI,\n advanced=True,\n info=\"Type of sender.\",\n ),\n MessageTextInput(\n name=\"sender_name\",\n display_name=\"Sender Name\",\n info=\"Name of the sender.\",\n value=MESSAGE_SENDER_NAME_AI,\n advanced=True,\n ),\n MessageTextInput(\n name=\"session_id\",\n display_name=\"Session ID\",\n info=\"The session ID of the chat. If empty, the current session ID parameter will be used.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"data_template\",\n display_name=\"Data Template\",\n value=\"{text}\",\n advanced=True,\n info=\"Template to convert Data to Text. If left empty, it will be dynamically set to the Data's text key.\",\n ),\n MessageTextInput(\n name=\"background_color\",\n display_name=\"Background Color\",\n info=\"The background color of the icon.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"chat_icon\",\n display_name=\"Icon\",\n info=\"The icon of the message.\",\n advanced=True,\n ),\n MessageTextInput(\n name=\"text_color\",\n display_name=\"Text Color\",\n info=\"The text color of the name\",\n advanced=True,\n ),\n BoolInput(\n name=\"clean_data\",\n display_name=\"Basic Clean Data\",\n value=True,\n info=\"Whether to clean the data\",\n advanced=True,\n ),\n ]\n outputs = [\n Output(\n display_name=\"Output Message\",\n name=\"message\",\n method=\"message_response\",\n ),\n ]\n\n def _build_source(self, id_: str | None, display_name: str | None, source: str | None) -> Source:\n source_dict = {}\n if id_:\n source_dict[\"id\"] = id_\n if display_name:\n source_dict[\"display_name\"] = display_name\n if source:\n # Handle case where source is a ChatOpenAI object\n if hasattr(source, \"model_name\"):\n source_dict[\"source\"] = source.model_name\n elif hasattr(source, \"model\"):\n source_dict[\"source\"] = str(source.model)\n else:\n source_dict[\"source\"] = str(source)\n return Source(**source_dict)\n\n async def message_response(self) -> Message:\n # First convert the input to string if needed\n text = self.convert_to_string()\n\n # Get source properties\n source, icon, display_name, source_id = self.get_properties_from_source_component()\n background_color = self.background_color\n text_color = self.text_color\n if self.chat_icon:\n icon = self.chat_icon\n\n # Create or use existing Message object\n if isinstance(self.input_value, Message):\n message = self.input_value\n # Update message properties\n message.text = text\n else:\n message = Message(text=text)\n\n # Set message properties\n message.sender = self.sender\n message.sender_name = self.sender_name\n message.session_id = self.session_id\n message.flow_id = self.graph.flow_id if hasattr(self, \"graph\") else None\n message.properties.source = self._build_source(source_id, display_name, source)\n message.properties.icon = icon\n message.properties.background_color = background_color\n message.properties.text_color = text_color\n\n # Store message if needed\n if self.session_id and self.should_store_message:\n stored_message = await self.send_message(message)\n self.message.value = stored_message\n message = stored_message\n\n self.status = message\n return message\n\n def _serialize_data(self, data: Data) -> str:\n \"\"\"Serialize Data object to JSON string.\"\"\"\n # Convert data.data to JSON-serializable format\n serializable_data = jsonable_encoder(data.data)\n # Serialize with orjson, enabling pretty printing with indentation\n json_bytes = orjson.dumps(serializable_data, option=orjson.OPT_INDENT_2)\n # Convert bytes to string and wrap in Markdown code blocks\n return \"```json\\n\" + json_bytes.decode(\"utf-8\") + \"\\n```\"\n\n def _validate_input(self) -> None:\n \"\"\"Validate the input data and raise ValueError if invalid.\"\"\"\n if self.input_value is None:\n msg = \"Input data cannot be None\"\n raise ValueError(msg)\n if isinstance(self.input_value, list) and not all(\n isinstance(item, Message | Data | DataFrame | str) for item in self.input_value\n ):\n invalid_types = [\n type(item).__name__\n for item in self.input_value\n if not isinstance(item, Message | Data | DataFrame | str)\n ]\n msg = f\"Expected Data or DataFrame or Message or str, got {invalid_types}\"\n raise TypeError(msg)\n if not isinstance(\n self.input_value,\n Message | Data | DataFrame | str | list | Generator | type(None),\n ):\n type_name = type(self.input_value).__name__\n msg = f\"Expected Data or DataFrame or Message or str, Generator or None, got {type_name}\"\n raise TypeError(msg)\n\n def convert_to_string(self) -> str | Generator[Any, None, None]:\n \"\"\"Convert input data to string with proper error handling.\"\"\"\n self._validate_input()\n if isinstance(self.input_value, list):\n return \"\\n\".join([safe_convert(item, clean_data=self.clean_data) for item in self.input_value])\n if isinstance(self.input_value, Generator):\n return self.input_value\n return safe_convert(self.input_value)\n"
},
def _validate_input(self) -> None:
"""Validate the input data and raise ValueError if invalid."""
if self.input_value is None:
msg = "Input data cannot be None"
raise ValueError(msg)
if isinstance(self.input_value, list) and not all(
isinstance(item, (Message, Data, DataFrame, str)) for item in self.input_value
):
invalid_types = [
type(item).__name__
for item in self.input_value
if not isinstance(item, (Message, Data, DataFrame, str))
]
msg = f"Expected Data or DataFrame or Message or str, got {invalid_types}"
raise TypeError(msg)
if not isinstance(
self.input_value,
(Message, Data, DataFrame, str, list, Generator, type(None)),
):
type_name = type(self.input_value).__name__
msg = f"Expected Data or DataFrame or Message or str, Generator or None, got {type_name}"
raise TypeError(msg)
🤖 Prompt for AI Agents
In src/backend/base/langflow/initial_setup/starter_projects/Nvidia Remix.json
around lines 652 to 656, the _validate_input method uses isinstance with PEP-604
union types, which causes a runtime TypeError. Replace all isinstance calls that
use unions like Message | Data | DataFrame | str with a tuple of types instead,
for example (Message, Data, DataFrame, str). Apply this fix consistently to all
isinstance calls with union types in this method to prevent crashes.

Comment on lines 2242 to 2246
"show": true,
"title_case": false,
"type": "code",
"value": "from pathlib import Path\n\nfrom langchain_community.vectorstores import FAISS\n\nfrom langflow.base.vectorstores.model import LCVectorStoreComponent, check_cached_vector_store\nfrom langflow.helpers.data import docs_to_data\nfrom langflow.io import BoolInput, HandleInput, IntInput, StrInput\nfrom langflow.schema.data import Data\n\n\nclass FaissVectorStoreComponent(LCVectorStoreComponent):\n \"\"\"FAISS Vector Store with search capabilities.\"\"\"\n\n display_name: str = \"FAISS\"\n description: str = \"FAISS Vector Store with search capabilities\"\n name = \"FAISS\"\n icon = \"FAISS\"\n\n inputs = [\n StrInput(\n name=\"index_name\",\n display_name=\"Index Name\",\n value=\"langflow_index\",\n ),\n StrInput(\n name=\"persist_directory\",\n display_name=\"Persist Directory\",\n info=\"Path to save the FAISS index. It will be relative to where Langflow is running.\",\n ),\n *LCVectorStoreComponent.inputs,\n BoolInput(\n name=\"allow_dangerous_deserialization\",\n display_name=\"Allow Dangerous Deserialization\",\n info=\"Set to True to allow loading pickle files from untrusted sources. \"\n \"Only enable this if you trust the source of the data.\",\n advanced=True,\n value=True,\n ),\n HandleInput(name=\"embedding\", display_name=\"Embedding\", input_types=[\"Embeddings\"]),\n IntInput(\n name=\"number_of_results\",\n display_name=\"Number of Results\",\n info=\"Number of results to return.\",\n advanced=True,\n value=4,\n ),\n ]\n\n @staticmethod\n def resolve_path(path: str) -> str:\n \"\"\"Resolve the path relative to the Langflow root.\n\n Args:\n path: The path to resolve\n Returns:\n str: The resolved path as a string\n \"\"\"\n return str(Path(path).resolve())\n\n def get_persist_directory(self) -> Path:\n \"\"\"Returns the resolved persist directory path or the current directory if not set.\"\"\"\n if self.persist_directory:\n return Path(self.resolve_path(self.persist_directory))\n return Path()\n\n @check_cached_vector_store\n def build_vector_store(self) -> FAISS:\n \"\"\"Builds the FAISS object.\"\"\"\n path = self.get_persist_directory()\n path.mkdir(parents=True, exist_ok=True)\n\n # Convert DataFrame to Data if needed using parent's method\n self.ingest_data = self._prepare_ingest_data()\n\n documents = []\n for _input in self.ingest_data or []:\n if isinstance(_input, Data):\n documents.append(_input.to_lc_document())\n else:\n documents.append(_input)\n\n faiss = FAISS.from_documents(documents=documents, embedding=self.embedding)\n faiss.save_local(str(path), self.index_name)\n return faiss\n\n def search_documents(self) -> list[Data]:\n \"\"\"Search for documents in the FAISS vector store.\"\"\"\n path = self.get_persist_directory()\n index_path = path / f\"{self.index_name}.faiss\"\n\n if not index_path.exists():\n vector_store = self.build_vector_store()\n else:\n vector_store = FAISS.load_local(\n folder_path=str(path),\n embeddings=self.embedding,\n index_name=self.index_name,\n allow_dangerous_deserialization=self.allow_dangerous_deserialization,\n )\n\n if not vector_store:\n msg = \"Failed to load the FAISS index.\"\n raise ValueError(msg)\n\n if self.search_query and isinstance(self.search_query, str) and self.search_query.strip():\n docs = vector_store.similarity_search(\n query=self.search_query,\n k=self.number_of_results,\n )\n return docs_to_data(docs)\n return []\n"
"value": "from pathlib import Path\n\nfrom langchain_community.vectorstores import FAISS\n\nfrom lfx.base.vectorstores.model import LCVectorStoreComponent, check_cached_vector_store\nfrom lfx.helpers.data import docs_to_data\nfrom lfx.io import BoolInput, HandleInput, IntInput, StrInput\nfrom lfx.schema.data import Data\n\n\nclass FaissVectorStoreComponent(LCVectorStoreComponent):\n \"\"\"FAISS Vector Store with search capabilities.\"\"\"\n\n display_name: str = \"FAISS\"\n description: str = \"FAISS Vector Store with search capabilities\"\n name = \"FAISS\"\n icon = \"FAISS\"\n\n inputs = [\n StrInput(\n name=\"index_name\",\n display_name=\"Index Name\",\n value=\"langflow_index\",\n ),\n StrInput(\n name=\"persist_directory\",\n display_name=\"Persist Directory\",\n info=\"Path to save the FAISS index. It will be relative to where Langflow is running.\",\n ),\n *LCVectorStoreComponent.inputs,\n BoolInput(\n name=\"allow_dangerous_deserialization\",\n display_name=\"Allow Dangerous Deserialization\",\n info=\"Set to True to allow loading pickle files from untrusted sources. \"\n \"Only enable this if you trust the source of the data.\",\n advanced=True,\n value=True,\n ),\n HandleInput(name=\"embedding\", display_name=\"Embedding\", input_types=[\"Embeddings\"]),\n IntInput(\n name=\"number_of_results\",\n display_name=\"Number of Results\",\n info=\"Number of results to return.\",\n advanced=True,\n value=4,\n ),\n ]\n\n @staticmethod\n def resolve_path(path: str) -> str:\n \"\"\"Resolve the path relative to the Langflow root.\n\n Args:\n path: The path to resolve\n Returns:\n str: The resolved path as a string\n \"\"\"\n return str(Path(path).resolve())\n\n def get_persist_directory(self) -> Path:\n \"\"\"Returns the resolved persist directory path or the current directory if not set.\"\"\"\n if self.persist_directory:\n return Path(self.resolve_path(self.persist_directory))\n return Path()\n\n @check_cached_vector_store\n def build_vector_store(self) -> FAISS:\n \"\"\"Builds the FAISS object.\"\"\"\n path = self.get_persist_directory()\n path.mkdir(parents=True, exist_ok=True)\n\n # Convert DataFrame to Data if needed using parent's method\n self.ingest_data = self._prepare_ingest_data()\n\n documents = []\n for _input in self.ingest_data or []:\n if isinstance(_input, Data):\n documents.append(_input.to_lc_document())\n else:\n documents.append(_input)\n\n faiss = FAISS.from_documents(documents=documents, embedding=self.embedding)\n faiss.save_local(str(path), self.index_name)\n return faiss\n\n def search_documents(self) -> list[Data]:\n \"\"\"Search for documents in the FAISS vector store.\"\"\"\n path = self.get_persist_directory()\n index_path = path / f\"{self.index_name}.faiss\"\n\n if not index_path.exists():\n vector_store = self.build_vector_store()\n else:\n vector_store = FAISS.load_local(\n folder_path=str(path),\n embeddings=self.embedding,\n index_name=self.index_name,\n allow_dangerous_deserialization=self.allow_dangerous_deserialization,\n )\n\n if not vector_store:\n msg = \"Failed to load the FAISS index.\"\n raise ValueError(msg)\n\n if self.search_query and isinstance(self.search_query, str) and self.search_query.strip():\n docs = vector_store.similarity_search(\n query=self.search_query,\n k=self.number_of_results,\n )\n return docs_to_data(docs)\n return []\n"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Dangerous deserialization enabled by default

FaissVectorStoreComponent sets allow_dangerous_deserialization=True as the default for load_local().
This bypasses the pickle-safety guard and can lead to arbitrary code execution when loading a crafted
.pkl inside a FAISS index.

Flip the default to False and let advanced users opt-in explicitly:

- value=True,
+ value=False,

Also update the doc-string / help-text to highlight the security implication.
[security]

📝 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
"show": true,
"title_case": false,
"type": "code",
"value": "from pathlib import Path\n\nfrom langchain_community.vectorstores import FAISS\n\nfrom langflow.base.vectorstores.model import LCVectorStoreComponent, check_cached_vector_store\nfrom langflow.helpers.data import docs_to_data\nfrom langflow.io import BoolInput, HandleInput, IntInput, StrInput\nfrom langflow.schema.data import Data\n\n\nclass FaissVectorStoreComponent(LCVectorStoreComponent):\n \"\"\"FAISS Vector Store with search capabilities.\"\"\"\n\n display_name: str = \"FAISS\"\n description: str = \"FAISS Vector Store with search capabilities\"\n name = \"FAISS\"\n icon = \"FAISS\"\n\n inputs = [\n StrInput(\n name=\"index_name\",\n display_name=\"Index Name\",\n value=\"langflow_index\",\n ),\n StrInput(\n name=\"persist_directory\",\n display_name=\"Persist Directory\",\n info=\"Path to save the FAISS index. It will be relative to where Langflow is running.\",\n ),\n *LCVectorStoreComponent.inputs,\n BoolInput(\n name=\"allow_dangerous_deserialization\",\n display_name=\"Allow Dangerous Deserialization\",\n info=\"Set to True to allow loading pickle files from untrusted sources. \"\n \"Only enable this if you trust the source of the data.\",\n advanced=True,\n value=True,\n ),\n HandleInput(name=\"embedding\", display_name=\"Embedding\", input_types=[\"Embeddings\"]),\n IntInput(\n name=\"number_of_results\",\n display_name=\"Number of Results\",\n info=\"Number of results to return.\",\n advanced=True,\n value=4,\n ),\n ]\n\n @staticmethod\n def resolve_path(path: str) -> str:\n \"\"\"Resolve the path relative to the Langflow root.\n\n Args:\n path: The path to resolve\n Returns:\n str: The resolved path as a string\n \"\"\"\n return str(Path(path).resolve())\n\n def get_persist_directory(self) -> Path:\n \"\"\"Returns the resolved persist directory path or the current directory if not set.\"\"\"\n if self.persist_directory:\n return Path(self.resolve_path(self.persist_directory))\n return Path()\n\n @check_cached_vector_store\n def build_vector_store(self) -> FAISS:\n \"\"\"Builds the FAISS object.\"\"\"\n path = self.get_persist_directory()\n path.mkdir(parents=True, exist_ok=True)\n\n # Convert DataFrame to Data if needed using parent's method\n self.ingest_data = self._prepare_ingest_data()\n\n documents = []\n for _input in self.ingest_data or []:\n if isinstance(_input, Data):\n documents.append(_input.to_lc_document())\n else:\n documents.append(_input)\n\n faiss = FAISS.from_documents(documents=documents, embedding=self.embedding)\n faiss.save_local(str(path), self.index_name)\n return faiss\n\n def search_documents(self) -> list[Data]:\n \"\"\"Search for documents in the FAISS vector store.\"\"\"\n path = self.get_persist_directory()\n index_path = path / f\"{self.index_name}.faiss\"\n\n if not index_path.exists():\n vector_store = self.build_vector_store()\n else:\n vector_store = FAISS.load_local(\n folder_path=str(path),\n embeddings=self.embedding,\n index_name=self.index_name,\n allow_dangerous_deserialization=self.allow_dangerous_deserialization,\n )\n\n if not vector_store:\n msg = \"Failed to load the FAISS index.\"\n raise ValueError(msg)\n\n if self.search_query and isinstance(self.search_query, str) and self.search_query.strip():\n docs = vector_store.similarity_search(\n query=self.search_query,\n k=self.number_of_results,\n )\n return docs_to_data(docs)\n return []\n"
"value": "from pathlib import Path\n\nfrom langchain_community.vectorstores import FAISS\n\nfrom lfx.base.vectorstores.model import LCVectorStoreComponent, check_cached_vector_store\nfrom lfx.helpers.data import docs_to_data\nfrom lfx.io import BoolInput, HandleInput, IntInput, StrInput\nfrom lfx.schema.data import Data\n\n\nclass FaissVectorStoreComponent(LCVectorStoreComponent):\n \"\"\"FAISS Vector Store with search capabilities.\"\"\"\n\n display_name: str = \"FAISS\"\n description: str = \"FAISS Vector Store with search capabilities\"\n name = \"FAISS\"\n icon = \"FAISS\"\n\n inputs = [\n StrInput(\n name=\"index_name\",\n display_name=\"Index Name\",\n value=\"langflow_index\",\n ),\n StrInput(\n name=\"persist_directory\",\n display_name=\"Persist Directory\",\n info=\"Path to save the FAISS index. It will be relative to where Langflow is running.\",\n ),\n *LCVectorStoreComponent.inputs,\n BoolInput(\n name=\"allow_dangerous_deserialization\",\n display_name=\"Allow Dangerous Deserialization\",\n info=\"Set to True to allow loading pickle files from untrusted sources. \"\n \"Only enable this if you trust the source of the data.\",\n advanced=True,\n value=True,\n ),\n HandleInput(name=\"embedding\", display_name=\"Embedding\", input_types=[\"Embeddings\"]),\n IntInput(\n name=\"number_of_results\",\n display_name=\"Number of Results\",\n info=\"Number of results to return.\",\n advanced=True,\n value=4,\n ),\n ]\n\n @staticmethod\n def resolve_path(path: str) -> str:\n \"\"\"Resolve the path relative to the Langflow root.\n\n Args:\n path: The path to resolve\n Returns:\n str: The resolved path as a string\n \"\"\"\n return str(Path(path).resolve())\n\n def get_persist_directory(self) -> Path:\n \"\"\"Returns the resolved persist directory path or the current directory if not set.\"\"\"\n if self.persist_directory:\n return Path(self.resolve_path(self.persist_directory))\n return Path()\n\n @check_cached_vector_store\n def build_vector_store(self) -> FAISS:\n \"\"\"Builds the FAISS object.\"\"\"\n path = self.get_persist_directory()\n path.mkdir(parents=True, exist_ok=True)\n\n # Convert DataFrame to Data if needed using parent's method\n self.ingest_data = self._prepare_ingest_data()\n\n documents = []\n for _input in self.ingest_data or []:\n if isinstance(_input, Data):\n documents.append(_input.to_lc_document())\n else:\n documents.append(_input)\n\n faiss = FAISS.from_documents(documents=documents, embedding=self.embedding)\n faiss.save_local(str(path), self.index_name)\n return faiss\n\n def search_documents(self) -> list[Data]:\n \"\"\"Search for documents in the FAISS vector store.\"\"\"\n path = self.get_persist_directory()\n index_path = path / f\"{self.index_name}.faiss\"\n\n if not index_path.exists():\n vector_store = self.build_vector_store()\n else:\n vector_store = FAISS.load_local(\n folder_path=str(path),\n embeddings=self.embedding,\n index_name=self.index_name,\n allow_dangerous_deserialization=self.allow_dangerous_deserialization,\n )\n\n if not vector_store:\n msg = \"Failed to load the FAISS index.\"\n raise ValueError(msg)\n\n if self.search_query and isinstance(self.search_query, str) and self.search_query.strip():\n docs = vector_store.similarity_search(\n query=self.search_query,\n k=self.number_of_results,\n )\n return docs_to_data(docs)\n return []\n"
},
BoolInput(
name="allow_dangerous_deserialization",
display_name="Allow Dangerous Deserialization",
info="Set to True to allow loading pickle files from untrusted sources. "
"Only enable this if you trust the source of the data.",
advanced=True,
value=False,
),
🤖 Prompt for AI Agents
In src/backend/base/langflow/initial_setup/starter_projects/Nvidia Remix.json
around lines 2242 to 2246, the allow_dangerous_deserialization input is set to
True by default, which poses a security risk by enabling unsafe pickle
deserialization. Change the default value of allow_dangerous_deserialization to
False to disable this by default, and update the input's info/help text to
clearly warn users about the security implications and that enabling it should
only be done if the data source is trusted.

@edwinjosechittilappilly
Copy link
Collaborator

@jordanrfrazier Looking forward to know more details on this PR.

@edwinjosechittilappilly
Copy link
Collaborator

@coderabbitai can you explain the major changes in this PR and generate a documentation for it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 22, 2025

Tip

For best results, initiate chat on the files or code changes.

@edwinjosechittilappilly, this PR represents a major architectural refactoring that introduces the lfx package and restructures the codebase for better modularity and maintainability. Let me break down the major changes and provide comprehensive documentation.

Major Changes Overview

1. New Package Architecture

  • Added lfx dependency (lfx~=0.1.0) - A new external package containing core functionality
  • Workspace restructuring - Added src/lfx to the UV workspace members
  • Backwards compatibility - Maintained existing APIs through compatibility shims

2. Systematic Import Path Updates

  • Codebase-wide changes - Updated imports from langflow.* to lfx.* across ~200+ files
  • Core modules affected: graph utilities, custom components, interface components, base classes
  • Test updates - All test files updated with new import paths

3. Module Restructuring

  • Compatibility shims - Many modules now re-export from lfx using from lfx.* import *
  • Enhanced implementations - New langflow-specific enhanced classes for Data, Message, and ServiceManager
  • Deleted modules - Removed internal implementations that moved to lfx

4. Enhanced Service Management

  • New ServiceManager - Enhanced version with automatic factory discovery and thread-safe operations
  • Centralized registration - All service factories now registered through a single function
  • Improved concurrency - Added keyed memory locks for thread-safe service retrieval

5. Schema Enhancements

  • Enhanced Data/Message classes - New implementations with langflow-specific conversions and utilities
  • Backwards compatibility - Original classes maintained through import redirection
  • Rich content support - Enhanced Message class supports complex content including images and content blocks

LFX Package Integration Documentation

Overview

This document outlines the major architectural changes introduced by the integration of the lfx package into Langflow. This refactoring extracts core functionality into a separate, reusable package while maintaining full backwards compatibility.

Architecture Changes

Package Structure

langflow/
├── src/backend/base/langflow/          # Langflow-specific implementations
│   ├── api/                           # API layer (updated imports)
│   ├── base/                          # Compatibility shims → lfx.base.*
│   ├── components/                    # Compatibility shim → lfx.components
│   ├── custom/                        # Compatibility shims → lfx.custom.*
│   ├── interface/                     # Compatibility shims → lfx.interface.*
│   ├── schema/                        # Enhanced implementations
│   └── services/                      # Enhanced service management
src/lfx/                               # Core functionality package

Dependency Management

New Dependencies:

[project.dependencies]
"lfx~=0.1.0"

[tool.uv.sources]
lfx = { workspace = true }

[tool.uv.workspace.members]
"src/lfx"

Implementation Strategy

1. Backwards Compatibility Shims

Most modules now use compatibility shims to maintain existing APIs:

"""Backwards compatibility module."""
from lfx.module_name import *  # ruff: noqa: F403

Examples:

  • langflow.base.*lfx.base.*
  • langflow.interface.*lfx.interface.*
  • langflow.custom.*lfx.custom.*

2. Enhanced Implementations

Key classes have enhanced langflow-specific implementations:

Enhanced Data Class

# langflow.schema.data_enhanced.py
class Data(lfx.schema.data.Data):
    """Enhanced Data class with langflow-specific methods."""
    
    def to_lc_message(self) -> BaseMessage:
        """Convert to LangChain message."""
    
    def to_message(self) -> Message:
        """Convert to langflow Message."""
    
    def to_dataframe(self) -> DataFrame:
        """Convert to langflow DataFrame."""

Enhanced Message Class

# langflow.schema.message_enhanced.py
class Message(LfxMessage):
    """Enhanced Message with rich content support."""
    
    def to_lc_message(self) -> BaseMessage:
        """Convert to LangChain message with file content."""
    
    def from_lc_prompt(cls, lc_prompt, variables=None) -> Message:
        """Create from LangChain prompt template."""

Enhanced Service Manager

# langflow.services.enhanced_manager.py
class ServiceManager(lfx.services.manager.ServiceManager):
    """Enhanced ServiceManager with automatic factory discovery."""
    
    def register_factories(self) -> None:
        """Automatically discover and register all service factories."""
    
    def get(self, service_name: ServiceType) -> Service:
        """Thread-safe service retrieval with concurrency control."""

3. Import Path Updates

Before:

from langflow.graph import Graph
from langflow.custom.custom_component.component import Component
from langflow.interface.components import get_all_components

After:

from lfx.graph import Graph
from lfx.custom.custom_component.component import Component  
from lfx.interface.components import get_all_components

Service Management Enhancements

Centralized Factory Registration

def register_all_service_factories() -> None:
    """Register all service factories with the global service_manager."""
    factory_modules = [
        'auth', 'cache', 'chat', 'database', 'job_queue',
        'session', 'settings', 'shared_component_cache', 
        'state', 'storage', 'store', 'task', 'telemetry',
        'tracing', 'variable'
    ]
    
    for module_name in factory_modules:
        # Import and register factories

Thread-Safe Service Access

  • Keyed memory locks for concurrent service access
  • Automatic factory discovery from langflow.services package
  • Error handling with detailed logging for factory registration failures

Starter Projects Updates

All starter project JSON files updated with new import paths:

Component Code Updates:

# Old
from langflow.custom.custom_component.component import Component

# New  
from lfx.custom.custom_component.component import Component

Toolkit Function Updates:

# Old
from langflow.custom.custom_component.component import _get_component_toolkit

# New
from langflow.custom.custom_component.component import get_component_toolkit

Benefits of This Architecture

1. Modularity

  • Core functionality extracted into reusable lfx package
  • Clear separation between generic and langflow-specific code
  • Easier testing and maintenance of core components

2. Backwards Compatibility

  • Existing code continues to work without changes
  • Gradual migration path for users
  • No breaking changes to public APIs

3. Enhanced Functionality

  • Langflow-specific enhancements in schema classes
  • Improved service management with better concurrency
  • Rich content support in Message class

4. Better Development Experience

  • Cleaner codebase organization
  • Reduced code duplication
  • Centralized core functionality

Migration Impact

For Users

  • No breaking changes - Existing code continues to work
  • Import paths - Can gradually migrate to new lfx imports for better performance
  • Enhanced features - Access to improved Data/Message classes automatically

For Developers

  • New package structure - Understanding of lfx vs langflow-specific code
  • Service registration - Automatic factory discovery simplifies service setup
  • Enhanced debugging - Better error handling and logging in service management

Conclusion

This refactoring represents a significant architectural improvement that:

  • Extracts reusable core functionality into the lfx package
  • Maintains complete backwards compatibility
  • Provides enhanced langflow-specific implementations
  • Improves code organization and maintainability
  • Sets the foundation for future modularity improvements

The changes are extensive but carefully designed to be non-breaking, allowing for a smooth transition while providing immediate benefits in terms of code organization and enhanced functionality.

@ogabrielluiz ogabrielluiz added the lgtm This PR has been approved by a maintainer label Jul 22, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 22, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jul 22, 2025

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 6%
6.47% (1680/25942) 3.51% (690/19621) 3.47% (194/5587)

Unit Test Results

Tests Skipped Failures Errors Time
682 0 💤 0 ❌ 0 🔥 11.483s ⏱️

@codecov
Copy link

codecov bot commented Jul 22, 2025

Codecov Report

❌ Patch coverage is 74.43182% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.63%. Comparing base (2d5c559) to head (a938049).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...rc/backend/base/langflow/field_typing/constants.py 0.00% 6 Missing ⚠️
src/backend/base/langflow/api/v1/callback.py 0.00% 4 Missing ⚠️
src/backend/base/langflow/api/v1/mcp_projects.py 55.55% 4 Missing ⚠️
src/backend/base/langflow/components/agents.py 0.00% 3 Missing ⚠️
src/backend/base/langflow/components/anthropic.py 0.00% 3 Missing ⚠️
src/backend/base/langflow/components/data.py 0.00% 3 Missing ⚠️
src/backend/base/langflow/components/helpers.py 0.00% 3 Missing ⚠️
src/backend/base/langflow/components/openai.py 0.00% 3 Missing ⚠️
src/backend/base/langflow/__main__.py 81.81% 2 Missing ⚠️
...kend/base/langflow/base/models/openai_constants.py 0.00% 2 Missing ⚠️
... and 9 more

❌ Your project status has failed because the head coverage (5.81%) is below the target coverage (10.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #9133       +/-   ##
===========================================
- Coverage   34.62%   21.63%   -13.00%     
===========================================
  Files        1209     1074      -135     
  Lines       57164    39650    -17514     
  Branches     5418     5418               
===========================================
- Hits        19794     8578    -11216     
+ Misses      37226    30928     -6298     
  Partials      144      144               
Flag Coverage Δ
backend 46.90% <74.43%> (-9.16%) ⬇️
frontend 5.81% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/backend/base/langflow/api/build.py 62.97% <100.00%> (+0.14%) ⬆️
...c/backend/base/langflow/api/health_check_router.py 47.50% <100.00%> (ø)
...kend/base/langflow/api/limited_background_tasks.py 38.46% <100.00%> (ø)
src/backend/base/langflow/api/log_router.py 23.72% <100.00%> (ø)
src/backend/base/langflow/api/utils.py 55.76% <100.00%> (-2.41%) ⬇️
src/backend/base/langflow/api/v1/base.py 100.00% <100.00%> (ø)
src/backend/base/langflow/api/v1/chat.py 37.11% <100.00%> (ø)
src/backend/base/langflow/api/v1/endpoints.py 60.56% <100.00%> (+1.84%) ⬆️
src/backend/base/langflow/api/v1/files.py 49.19% <100.00%> (ø)
src/backend/base/langflow/api/v1/flows.py 42.64% <100.00%> (ø)
... and 139 more

... and 159 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 22, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Sep 2, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Sep 2, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2025

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

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Sep 2, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 2, 2025

@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2025

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

@ogabrielluiz ogabrielluiz added this pull request to the merge queue Sep 2, 2025
Merged via the queue into main with commit aaaaed1 Sep 2, 2025
75 of 77 checks passed
@ogabrielluiz ogabrielluiz deleted the create-lfx branch September 2, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants