Commit graph

16,486 commits

Author SHA1 Message Date
Eric Hare
0b78ccd4de
fix: Adjust uniqueness constraint on file names (#9014)
* fix: Adjust uniqueness constraint on file names

* Update 1cb603706752_modify_uniqueness_constraint_on_file_.py

* Update 1cb603706752_modify_uniqueness_constraint_on_file_.py

* Update 1cb603706752_modify_uniqueness_constraint_on_file_.py

* Update 1cb603706752_modify_uniqueness_constraint_on_file_.py

* Add index on user id

* Update 1cb603706752_modify_uniqueness_constraint_on_file_.py

* Update 1cb603706752_modify_uniqueness_constraint_on_file_.py

* Update model.py

* Update 1cb603706752_modify_uniqueness_constraint_on_file_.py

* Add duplicate check on upgrade

* Update 1cb603706752_modify_uniqueness_constraint_on_file_.py

* Update 1cb603706752_modify_uniqueness_constraint_on_file_.py

* Update 1cb603706752_modify_uniqueness_constraint_on_file_.py

* Add aiosqlite as dep

* Fix authentication for non-super user envs

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Fix mypy issues

* Update News Aggregator.json

* Update save_file.py

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-19 20:50:18 +00:00
Edwin Jose
fbb0012045
fix: silent error fix in KB components (#9433)
* silent error fix

* silent error fix

* Raise value error if configured column is not available

* [autofix.ci] apply automated fixes

* Remove silent error tests with option gone

* Update test_kb_ingest.py

---------

Co-authored-by: Eric Hare <ericrhare@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-19 20:03:54 +00:00
Lucas Oliveira
bb01fd00fc
fix: remove duplicate embeddings category, refactor render code (#9446)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-19 15:33:28 -03:00
jeevi cao
a973e747cb
feat: set default utc timezone for postgresql in DatabaseService (#8112)
Co-authored-by: tianzhipeng <tzpabc@gmail.com>
2025-08-18 16:31:05 -03:00
Yuqi Tang
ec7579d578
feat: Add exception telemetry (#9194)
* add template tests

* remove files

* adding validate flow build

* add validate endpoint and flow execution

* Update .github/workflows/template-tests.yml

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update src/backend/base/langflow/utils/template_validation.py

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* [autofix.ci] apply automated fixes

* change workflow running

* add ci

* fix test

* fix test

* delete when push

* fix: Exclude template tests from unit test bundle

Template tests are already run separately in CI via the test-templates job.
This change prevents duplicate execution and eliminates timeout failures
in the unit test suite by excluding slow template execution tests.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: Exclude template tests from unit test bundle

Template tests are already run separately in CI via the test-templates job.
This change prevents duplicate execution and eliminates timeout failures
in the unit test suite by excluding slow template execution tests.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: Exclude template tests from unit test bundle

Template tests are already run separately in CI via the test-templates job.
This change prevents duplicate execution and eliminates timeout failures
in the unit test suite by excluding slow template execution tests.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: Remove remaining merge conflict markers

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: Improve validate.py unit tests to eliminate CI failures

Fixed 4 failing tests in test_validate.py:
- test_code_with_syntax_error: Better error message handling for syntax errors
- test_raises_error_for_missing_function: Handle StopIteration along with ValueError
- test_creates_simple_class: Use optional constructor parameter to avoid TypeError
- test_handles_validation_error: Use proper ValidationError constructor from pydantic_core
- test_creates_context_with_langflow_imports: Remove invalid module patching
- test_creates_mock_classes_on_import_failure: Use proper import mocking

All 50 validate tests now pass consistently, improving CI stability.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* enhance: Add comprehensive edge case tests for template_validation.py

Added 6 additional test cases to improve coverage of template_validation.py:
- test_validate_stream_exception: Tests Graph.validate_stream() exception handling
- test_code_validation_other_exceptions: Tests TypeError/KeyError/AttributeError handling
- test_vertices_sorted_without_end_vertex_events: Tests variable usage tracking
- test_vertex_count_tracking: Tests vertex_count increment paths
- test_empty_lines_in_stream: Tests empty line handling in event streams
- test_event_stream_validation_exception: Tests exception handling in _validate_event_stream

These tests target the remaining 7 uncovered lines to maximize coverage percentage.
Total tests: 40 (all passing)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: Add telemetry for unhandled exceptions

Add comprehensive exception telemetry to capture and send unhandled
exceptions to Scarf analytics for better error tracking and debugging.

Features:
- ExceptionPayload schema with type, message, context, and stack hash
- TelemetryService.log_exception() method for exception logging
- Integration in FastAPI exception handlers and lifespan events
- Stack trace hashing for grouping similar exceptions
- Respects existing do_not_track privacy settings

Context tracking:
- "handler" - exceptions in HTTP request processing
- "lifespan" - exceptions during app startup/shutdown

Sends data to: https://langflow.gateway.scarf.sh/exception

Includes comprehensive unit and integration tests covering all
functionality and edge cases.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: Improve exception telemetry implementation

- Replace MD5 with SHA256 for better security practices
- Use contextlib.suppress instead of try-except-pass patterns
- Fix telemetry_service scope issue in lifespan function
- Improve test exception handling to follow best practices
- All linting checks now pass with proper code style

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor the exception logging

* [autofix.ci] apply automated fixes

* update comment

* use mock url

* fix: remove telemetry logging for lifespan cancellation during shutdown

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-08-18 17:28:13 +00:00
Abhishek Patil
f6e6edbc37
feat: update Composio components (#8868)
Co-authored-by: Uday-sidagana <uday.sidgana@gmail.com>
Co-authored-by: Uday Sidagana <udaysidagana@Mac.lan>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Uday Sidagana <129588963+Uday-sidagana@users.noreply.github.com>
2025-08-18 12:57:13 -03:00
Mike Fortman
590682d748
refactor: flowSidebarComponents folder structure refactor and add test coverage (#9383)
* refactor and test coverage

* code issue cleanup

* test and coverage fixes

* fix test + pr comments

* cleanup

* test debugging

* cleanup

* try again

* No logs

* fix test
2025-08-18 09:52:07 -05:00
Gabriel Luiz Freitas Almeida
2c405f77e7
feat(utils): add code hash generation and module name in Custom Components (#9107)
* refactor: update _generate_code_hash function and enhance module name handling

- Removed the class_name parameter from _generate_code_hash for improved clarity and simplicity.
- Added a new function, get_module_name_from_display_name, to generate module names from display names in snake_case.
- Updated build_custom_component_template_from_inputs to use the new module name generation logic when module_name is None.
- Enhanced error handling in code hash generation to log exceptions appropriately.
- Updated unit tests to reflect changes in the _generate_code_hash function and to verify the new module name generation functionality.

* fix: enhance module name handling and error logging in build_custom_component_template

- Added logic to derive module names from display names when not provided, improving metadata accuracy.
- Refined error handling for code hash generation, ensuring exceptions are logged appropriately for better debugging.

* test: add comprehensive unit tests for metadata generation in custom components

- Introduced multiple tests to ensure that the `build_custom_component_template` function consistently generates metadata, including module names and code hashes, across various scenarios.
- Verified that metadata is correctly returned when module names are provided or omitted, and that code hashes change with component code modifications.
- Included tests for handling unicode characters in component code to ensure robustness in metadata generation.

* test: update unit tests to use Component class for metadata generation

- Refactored test cases to replace the CustomComponent with the new Component class, ensuring consistency in testing metadata addition in template builders.
- Adjusted mock component attributes to align with the updated class structure, enhancing clarity and maintainability of the tests.

* test: add unit tests for custom component metadata retrieval and consistency

- Introduced new tests for the /custom_component endpoint to verify that it returns accurate metadata, including module names and code hashes.
- Ensured that identical component code produces consistent metadata across multiple requests, enhancing the reliability of the custom component functionality.

* refactor: improve error logging in code hash generation

- Updated error logging in `build_custom_component_template_from_inputs` and `build_custom_component_template` to use debug level with exception context, enhancing clarity for debugging while reducing log noise.
- This change aims to provide more detailed insights during error occurrences without cluttering the error logs.
2025-08-18 13:56:29 +00:00
April I. Murphy
cfb29134bb
docs: Update, refresh, and expand Vector Store and Processing component documentation (#9407)
* fix anchors

* type convert and structured output components

* vector store intro and flow example

* reorg some vector search components by provider

* still on vector stores

* vector store example and outputs

* finish vector store page

* corrections to astra db vector store

* start split text component

* save file and smart function

* llm router

* parser

* still on dataframe

* finish datafram ops

* remove-extra-kv-pair-and-clarify-serialization-from-python

---------

Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
2025-08-18 13:46:47 +00:00
April I. Murphy
e0816e58a2
docs: Correct the instructions for additional language models that aren't built-in to the primary Language Model component. (#9406)
* fix language about bundled models

* Apply suggestions from code review

---------

Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
2025-08-18 13:29:47 +00:00
psy42a
93517fa3b6
fix: mask Component Secrets in trace logs (#8204)
Co-authored-by: psy42a <17905361+psy42a@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-08-18 10:11:12 -03:00
Gabriel Luiz Freitas Almeida
c8ac453601
chore: update schema version and format JSON structure in biome.json (#9289) 2025-08-18 09:47:27 -03:00
Jordan Frazier
18e2ff2d2d
fix: fallback to env var correctly when using tweaks (#9422)
* Fallback to env var correctly when using tweaks

* Add unit test

* [autofix.ci] apply automated fixes

* refactor: improve docstrings for parameter update tests

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-08-18 12:25:13 +00:00
Eric Hare
226c71bb7c
fix: Allow connections to save file output (#9386)
* fix: Allow connections to save file output

* Update save_file.py

* [autofix.ci] apply automated fixes

* Change name of output

---------

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-14 21:19:42 +00:00
Edwin Jose
3d601ffa79
chore: bump langflow version (#9402)
* bug: re-add NVIDIA Remix starter template (#8994)

feat: add NVIDIA Remix starter template

Introduced a new JSON configuration file for the NVIDIA Remix starter project, defining nodes and edges for chat input, output, and agent interactions. This setup enhances the integration of the NVIDIA RTX Remix Toolkit REST API, providing a structured approach for building chat-based applications.

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>

* chore(release): bump to 1.5.0.post2

* bug: re-add NVIDIA Remix starter template (#8994)

feat: add NVIDIA Remix starter template

Introduced a new JSON configuration file for the NVIDIA Remix starter project, defining nodes and edges for chat input, output, and agent interactions. This setup enhances the integration of the NVIDIA RTX Remix Toolkit REST API, providing a structured approach for building chat-based applications.

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>

* Bump langflow-base version to 0.5.0.post2

Updated the langflow-base package version in pyproject.toml and uv.lock to 0.5.0.post2 for release or deployment purposes.

---------

Co-authored-by: Sebastián Estévez <estevezsebastian@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-08-14 20:41:15 +00:00
Jordan Frazier
c188ec113c
fix: enforce authentication for superuser cli command (#9152)
* Enforce authentication for superuser cli command

* shorten security md

* cleanup

* use session_scope

* re-add uvlock

* [autofix.ci] apply automated fixes

* ruff

* update env example

* [autofix.ci] apply automated fixes

* better exception handling

* [autofix.ci] apply automated fixes

* update tests to not use mocks

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* Remove old test

* Catch exceptions for typer

* Try output instead of stdout

* Use xdist to run in serial

* Separate create superuse

* [autofix.ci] apply automated fixes

* Ruff

* [autofix.ci] apply automated fixes

* lint

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-14 20:29:35 +00:00
Edwin Jose
ede849aaf7
fix: Set 'Include Metadata' as non-advanced option (#9400)
* Set 'Include Metadata' as non-advanced option

Changed the 'Include Metadata' parameter in KBRetrievalComponent from advanced to non-advanced, making it more visible in the UI.

* [autofix.ci] apply automated fixes

* Update Knowledge Retrieval.json

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-14 18:59:05 +00:00
Mendon Kissling
8fff7cc4a4
docs: clarify file upload with API snippet (#9384)
* clarify-file-upload-with-api-snippet

* style

* Apply suggestions from code review

Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>

---------

Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
2025-08-14 18:56:12 +00:00
Mendon Kissling
c205e9914a
docs: clarify available API endpoints and their use cases (#9382)
* available-endpoints

* asterisk

* structure-into-tabs-and-confirm-login-endpoint

* reorg and clarify some usage

---------

Co-authored-by: April M <april.murphy@datastax.com>
2025-08-14 17:58:28 +00:00
Gabriel Luiz Freitas Almeida
75970e5ff4
fix: add langchain-chroma to langflow-base (#9396) 2025-08-14 11:25:57 -03:00
Eric Hare
e68f6a405a
feat: Add support for Ingestion and Retrieval of Knowledge Bases (#9088)
* refactor: Standardize import statements and improve code readability across components

- Updated import statements to use consistent single quotes.
- Refactored various components to enhance readability and maintainability.
- Adjusted folder and file handling logic in the sidebar and file manager components.
- Introduced a new tabbed interface for the files page to separate files and knowledge bases, improving user experience.

* [autofix.ci] apply automated fixes

* feat: Introduce new Files and Knowledge Bases page with tabbed interface

- Added a new FilesPage component to manage file uploads and organization.
- Implemented a tabbed interface to separate Files and Knowledge Bases for improved user experience.
- Created FilesTab and KnowledgeBasesTab components for handling respective functionalities.
- Refactored routing to accommodate the new structure and updated import statements for consistency.
- Removed the old filesPage component to streamline the codebase.

* Create knowledgebase_utils.py

* Push initial ingest component

* [autofix.ci] apply automated fixes

* Create initial KB Ingestion component

* [autofix.ci] apply automated fixes

* Fix ruff check on utility functions

* [autofix.ci] apply automated fixes

* Some quick fixes

* Update kb_ingest.py

* [autofix.ci] apply automated fixes

* First version of retrieval component

* [autofix.ci] apply automated fixes

* Update icon

* Update kb_retrieval.py

* [autofix.ci] apply automated fixes

* Add knowledge bases feature with API integration and UI components

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Refactor imports and update routing paths for assets and main page components. Adjust tab handling in the assets page to reflect URL changes and improve user navigation experience.

* [autofix.ci] apply automated fixes

* Add CreateKnowledgeBaseButton, KnowledgeBaseEmptyState, and KnowledgeBaseSelectionOverlay components. Refactor KnowledgeBasesTab to utilize new components and improve UI for knowledge base management. Introduce utility functions for formatting numbers and average chunk sizes.

* [autofix.ci] apply automated fixes

* PoV: Add Parquet data retrieval to KBRetrievalComponent (#9097)

* Add Parquet data retrieval to KBRetrievalComponent

Introduces a new output to KBRetrievalComponent for returning knowledge base data by reading Parquet files. Updates dependencies to include fastparquet for Parquet support.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* Fix some ruff issues

* [autofix.ci] apply automated fixes

* feat: refactor file management and knowledge base components

- Replaced the existing assetsPage with a new filesPage to better organize file management functionalities.
- Introduced KnowledgePage to handle knowledge base operations, integrating KnowledgeBasesTab for displaying and managing knowledge bases.
- Added various components for file and knowledge base management, including CreateKnowledgeBaseButton, KnowledgeBaseEmptyState, and drag-and-drop functionality.
- Updated routing and imports to reflect the new structure and ensure consistency across the application.
- Enhanced user experience with improved UI elements and state management for file selection and operations.

* feat: implement delete confirmation modal for knowledge base deletion

- Added a DeleteConfirmationModal component to confirm deletion actions.
- Integrated the modal into the KnowledgeBasesTab for handling knowledge base deletions.
- Updated column definitions to include a delete button for each knowledge base.
- Enhanced user experience by ensuring deletion actions require confirmation.
- Adjusted styles for the knowledge base table to improve checkbox visibility.

* feat: enhance knowledge base metadata with embedding model detection

- Added `embedding_model` field to `KnowledgeBaseInfo` for improved metadata tracking.
- Implemented `detect_embedding_model` function to extract embedding model information from configuration files.
- Updated `get_kb_metadata` to prioritize metadata extraction from `embedding_metadata.json`, falling back to detection if necessary.
- Modified `KBIngestionComponent` to save embedding model metadata during ingestion.
- Adjusted frontend components to display embedding model information in knowledge base queries and tables.

* refactor: clean up tooltip and value getter comments in knowledge base columns

- Removed redundant comments in the `knowledgeBaseColumns.tsx` file to enhance code clarity.
- Simplified the tooltip and value getter functions for embedding model display.

* [autofix.ci] apply automated fixes

* refactor: simplify KnowledgeBaseSelectionOverlay component

- Removed the unused onExport prop and its associated functionality.
- Cleaned up code formatting for consistency and readability.
- Updated success message strings to use single quotes for uniformity.

* feat: implement bulk and single deletion for knowledge bases

- Added `BulkDeleteRequest` model to handle bulk deletion requests.
- Implemented `delete_knowledge_base` endpoint for single knowledge base deletion.
- Created `delete_knowledge_bases_bulk` endpoint for deleting multiple knowledge bases at once.
- Introduced `useDeleteKnowledgeBase` and `useDeleteKnowledgeBases` hooks for frontend integration.
- Updated `KnowledgeBaseSelectionOverlay` and `KnowledgeBasesTab` components to utilize new deletion functionality with user feedback on success and error handling.

* Initial support for vector search

* feat: add KnowledgeBaseDrawer component for enhanced knowledge base details

- Introduced `KnowledgeBaseDrawer` component to display detailed information about selected knowledge bases.
- Integrated mock data for source files and linked flows, with a layout for displaying descriptions and embedding models.
- Updated `KnowledgeBasesTab` to handle row clicks and open the drawer with relevant knowledge base data.
- Enhanced `KnowledgePage` to manage drawer state and selected knowledge base, improving user interaction and experience.

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Fix ruff checks

* Update knowledge_bases.py

* feat: update mock data and enhance drawer functionality in KnowledgeBase components

- Replaced mock data in `KnowledgeBaseDrawer` with more descriptive placeholders.
- Added a reference to the drawer in `KnowledgePage` for improved click handling.
- Implemented logic to close the drawer when clicking outside, except for table row clicks.
- Enhanced row click handling to toggle drawer state based on current visibility.

* [autofix.ci] apply automated fixes

* Append scores column to rows

* refactor: improve knowledge base deletion and UI components

- Updated `useDeleteKnowledgeBase` and `useDeleteKnowledgeBases` to enhance parameter naming for clarity.
- Removed the `CreateKnowledgeBaseButton` component and its references to streamline the UI.
- Simplified the `KnowledgeBaseDrawer` and `KnowledgeBasesTab` components by removing mock data and improving state management.
- Enhanced the `KnowledgeBaseSelectionOverlay` to better handle bulk deletions and selection states.
- Refactored various components for consistent styling and improved readability.

* refactor: standardize import statements and improve code readability in SideBarFoldersButtonsComponent

- Updated import statements to use consistent single quotes.
- Refactored various function calls and state management for improved clarity.
- Enhanced folder handling logic and UI interactions for better user experience.

* feat: Add encryption for API keys in KB ingest and retrieval (#9129)

Add encryption for API keys in KB ingest and retrieval

Introduces secure storage of embedding model API keys by encrypting them during knowledge base ingestion and decrypting them during retrieval. Refactors metadata handling to include encrypted API keys, updates retrieval to support decryption and dynamic embedder construction, and improves logging for key operations. Removes legacy embedding client code in retrieval in favor of a provider-based approach.

* [autofix.ci] apply automated fixes

* Fix import of auth utils

* Allow appending to existing knowledge base

* [autofix.ci] apply automated fixes

* Update kb_ingest.py

* Update kb_ingest.py

* feat: enhance table component with editable Vectorize column functionality

- Implemented logic to determine editability of the Vectorize column based on other row values.
- Added checks to refresh grid cells upon changes to the Vectorize column.
- Updated TableAutoCellRender to conditionally disable editing based on Vectorize column state.

* New ingestion creation dialog

* [autofix.ci] apply automated fixes

* Clean up the creation process for KB

* [autofix.ci] apply automated fixes

* Clean up names and descriptions

* Update kb_retrieval.py

* chroma retrieval

* [autofix.ci] apply automated fixes

* Further KB cleanup

* refactor: update KB ingestion component and enhance NodeDialog functionality

- Restored SecretStrInput for API key in KB ingestion component.
- Modified NodeDialog to handle new value format and added support for additional properties.
- Introduced custom hooks for managing global variable states in InputGlobalComponent.
- Improved dropdown component styling and interaction.
- Cleaned up input component code for better readability and maintainability.

* Hash the text as id

* [autofix.ci] apply automated fixes

* Update kb_retrieval.py

* [autofix.ci] apply automated fixes

* Make sure to write out the source parquet

* Remove unneeded old code

* Add ability to block duplicate ingestion chunks

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Rename retrieval component

* Better refresh mechanism for the retrieve

* Clean up some unused functionality

* Update kb_ingest.py

* Fix dropdown component logic to include checks for refresh button and dialog inputs

* Test the API key before saving knowledge

* [autofix.ci] apply automated fixes

* Allow storing updated api keys if provided at ingest time

* Add Knowledge Bases component and enhance Knowledge Base Empty State

- Introduced a new JSON configuration for Knowledge Bases, defining nodes and edges for data processing.
- Enhanced the KnowledgeBaseEmptyState component to include a button for creating a knowledge base template.
- Updated KnowledgeBasesTab to handle template creation, integrating flow management and navigation features.

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Update Knowledge Bases.json

* Update Knowledge Bases configuration and enhance UI components

- Updated the code hash in the Knowledge Bases JSON configuration.
- Modified the KnowledgeBaseEmptyState component to change the button icon and text from "Try Knowledge Base Template" to "Create Knowledge".
- Cleared the options for the knowledge base selection dropdowns to ensure they reflect the current state of available knowledge bases.

* [autofix.ci] apply automated fixes

* Implement feature flag for Knowledge Bases functionality

- Added FEATURE_FLAGS.knowledge_bases to control the visibility of knowledge base components in the API and UI.
- Updated the router to conditionally include the knowledge bases router based on the feature flag.
- Modified KBIngestionComponent and KBRetrievalComponent to hide if the knowledge bases feature is disabled.
- Enhanced the initial setup to skip loading knowledge base starter projects when the feature is disabled.
- Updated frontend routes and sidebar components to conditionally render knowledge base options based on the feature flag.
- Adjusted API queries to return an empty array if the knowledge bases feature is disabled.

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Refactor Knowledge Bases feature flag implementation

- Removed the FEATURE_FLAGS.knowledge_bases flag from backend components and frontend routes.
- Updated the API and UI to always include knowledge base components, simplifying the codebase.
- Adjusted the frontend feature flags to set ENABLE_KNOWLEDGE_BASES to false, ensuring knowledge base features are not displayed.
- Cleaned up related components and routes to reflect the removal of the feature flag, enhancing maintainability.

* revert

* [autofix.ci] apply automated fixes

* Remove Knowledge Bases JSON configuration and clean up KnowledgeBasesTab component by eliminating unused imports and template creation functionality.

* [autofix.ci] apply automated fixes

* Enhance routing structure by adding admin and login routes with protected access. Refactor flow routes for improved organization and clarity.

* added template back

* Use chroma for stats computation

* Fix ruff issue

* [autofix.ci] apply automated fixes

* Update Knowledge Bases.json

* Update Knowledge Bases.json

* Rename to just knowledge

* feat: enhance Jest configuration and add new tests for Knowledge Base components

- Updated jest.config.js to include a new setup file and refined test matching patterns.
- Introduced jest.setup.js for mocking globals and Vite-specific syntax.
- Added tests for KnowledgeBaseDrawer, KnowledgeBaseEmptyState, KnowledgeBaseSelectionOverlay, KnowledgeBasesTab, and KnowledgePage components.
- Created utility functions for testing and mock data for knowledge bases.
- Implemented tests for utility functions related to knowledge base formatting.

* [autofix.ci] apply automated fixes

* refactor: reorganize imports and clean up console log in Dropdown component

- Moved and re-imported necessary dependencies for better structure.
- Removed unnecessary console log statement to clean up the code.

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* feat: add success callback for knowledge base creation in NodeDialog component

- Introduced a new success callback to handle knowledge base creation notifications.
- Enhanced dialog closing logic with a delay for Astra database tracking.
- Reorganized imports for better structure.

* refactor: update table component to handle single-toggle columns

- Renamed functions and variables to improve clarity regarding single-toggle columns (Vectorize and Identifier).
- Updated logic to ensure proper editability checks for single-toggle columns.
- Adjusted related components to reflect changes in column handling and rendering.

* [autofix.ci] apply automated fixes

* feat: Add unit tests for KBIngestionComponent (#9246)

* [autofix.ci] apply automated fixes

* fix: remove unnecessary drawer open state change in KnowledgePage

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Remove kb_info output from KBIngestionComponent (#9275)

* [autofix.ci] apply automated fixes

* Update Knowledge Bases.json

* Use settings service for knowledge base directory

Replaces the hardcoded knowledge base directory path with a value from the settings service. This improves configurability and centralizes directory management.

* Fix knowledge bases mypy issue

* test: Update file page tests for consistency and clarity

- Changed expected title text from "My Files" to "Files" for accuracy.
- Removed unnecessary parentheses in arrow functions for cleaner syntax.
- Updated test assertions to ensure visibility checks are clear and consistent.
- Improved readability by standardizing the formatting of test cases.

* test: Update expected title in file upload component test for accuracy

- Changed expected title text from "My Files" to "Files" to reflect the correct page title.

* [autofix.ci] apply automated fixes

* Fix tests on backend

* Update kb_ingest.py

* [autofix.ci] apply automated fixes

* Switch to two templates for KB

* Update names and descs

* [autofix.ci] apply automated fixes

* Rename templates

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Deon Sanchez <69873175+deon-sanchez@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-08-13 20:15:57 +00:00
Lucas Oliveira
faff2015c4
fix: make tools be selected on mcp server after opening for the first time (#9377)
* Add on grid ready handler to select required nodes after opening

* [autofix.ci] apply automated fixes

* Updated mcp server tab test to test if state is maintained after refresh

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Carlos Coelho <80289056+carlosrcoelho@users.noreply.github.com>
2025-08-13 20:14:30 +00:00
Lucas Oliveira
9141005e6b
fix: make settings nav not enter history (#9376)
* remove unused location store

* make sidebar component replace route in order for back button to go back to previous page before settings

* added test to back button functionality

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Mike Fortman <michael.fortman@datastax.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-13 16:20:04 +00:00
Lucas Oliveira
181606fd80
fix: add cursor state to not skip to end on input components (#9375)
* Add cursor handling to input component

* add cursor handling to text area component

* [autofix.ci] apply automated fixes

* Modified tests to check cursor position

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-13 15:54:49 +00:00
Edwin Jose
4ab322290b
refactor: Remove extraneous flag from package lock (#9371)
Remove extraneous flag from is-unicode-supported

The 'extraneous' flag was removed from the is-unicode-supported dependency in package-lock.json to reflect its correct status in the bundle.
2025-08-13 14:23:31 +00:00
Edwin Jose
0628398fa9
feat: Add GPT-5 series models to OpenAI metadata (#9336)
Add GPT-5 series models to OpenAI metadata

Introduces metadata entries for the new GPT-5, GPT-5-mini, GPT-5-nano, and GPT-5-chat-latest models in the OPENAI_MODELS_DETAILED list. This update ensures these models are recognized and available for use in the application.
2025-08-12 20:54:40 +00:00
Edwin Jose
76a8584c54
refactor: remove Anthropic provider test (#9369)
* Comment out Anthropic provider test and update API key usage

Temporarily commented out the Anthropic provider selection in the Research Translation Loop integration test and switched the API key input to use OPENAI_API_KEY. This change is made pending a way to properly test Anthropic integration.

* Update Research Translation Loop.spec.ts
2025-08-12 16:42:57 -03:00
Ronnie Miller
5b84b51488
docs: Hide previous docs draft build comments on new build (#9334) 2025-08-12 10:18:09 -07:00
Edwin Jose
033453257b
chore: skip mcp everything server test (#9366)
Update test_mcp_util.py
2025-08-12 13:59:00 -03:00
Ítalo Johnny
33d7408096
chore: pin uv version to 0.7.20 (#9365) 2025-08-12 13:11:37 -03:00
Ítalo Johnny
2ef8db7552
chore: bump uv minimum version to 0.7.20 (#9364) 2025-08-12 11:31:26 -03:00
Ítalo Johnny
188220eca3
fix: pin uv to 0.5.6 to restore CI compatibility (#9362) 2025-08-12 11:04:34 -03:00
Ítalo Johnny
5a1ece6dce
test: skip Everything server on Python 3.13 (#9361) 2025-08-12 10:38:26 -03:00
Edwin Jose
163dabdaf3
refactor: Skip MCP Memory leak integration test (#9358)
Update test_mcp_memory_leak.py
2025-08-12 09:26:03 -03:00
Ítalo Johnny
515786c888
fix: improve process cleanup in MCP tests (#9354) 2025-08-11 19:02:47 -03:00
Edwin Jose
6e8767d538
fix: increase Test time out (#9353)
* Improve session fixture cleanup and engine handling

Refactors the session fixture to use an in-memory SQLite engine with proper disposal and ensures tables are dropped and the engine is disposed of after tests. This enhances resource management and test isolation.

* Update src/backend/tests/conftest.py

* Increase pytest timeout to 150 seconds

Updated the pytest timeout setting from 120 to 150 seconds in pyproject.toml to allow tests more time to complete, potentially addressing issues with longer-running tests.

* Update store_pytest_durations.yml

---------

Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
2025-08-11 17:25:00 -03:00
Edwin Jose
42c8cfb2cb
fix: Improve session fixture cleanup and engine handling (#9352)
* Improve session fixture cleanup and engine handling

Refactors the session fixture to use an in-memory SQLite engine with proper disposal and ensures tables are dropped and the engine is disposed of after tests. This enhances resource management and test isolation.

* Update src/backend/tests/conftest.py

---------

Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
2025-08-11 16:45:06 -03:00
Edwin Jose
1b3493aafd
ref: MCP Tests (#9349)
* update MCP Tests

* [autofix.ci] apply automated fixes

* Update util.py

* [autofix.ci] apply automated fixes

* Refactor MCP session manager for better configurability and cleanup (#9176)

* Add log rotation and header validation features

Introduces support for log rotation via the LANGFLOW_LOG_ROTATION environment variable and CLI/config options, with documentation updates. Adds header validation and sanitization for MCP connections, ensuring RFC 7230 compliance and security. Frontend and backend now support passing custom headers for MCP servers. Includes extensive new and updated unit tests for header handling, MCP utilities, and log rotation.

* Add unit tests for MCP utilities and update disconnect logic

Added comprehensive unit tests for MCP utility functions, session management, header validation, and client classes in test_mcp_util.py. Updated MCPStdioClient and MCPSseClient disconnect methods for clearer session cleanup logic. Refactored test_mcp_component.py to remove redundant and duplicated tests, consolidating coverage in the new test suite.

* [autofix.ci] apply automated fixes

* Update test_mcp_memory_leak.py

* Update util.py

* Improve session and process cleanup in MCP

Added explicit session closing and a short delay to allow subprocess transports to clean up, reducing warnings and potential memory leaks. Test code now waits longer after cleanup and increases process termination timeout to ensure all child processes are properly terminated.

* Improve session and process cleanup logic

Enhanced MCPSessionManager to handle both async and sync session closing methods, using inspection to determine awaitability. Updated memory leak test to more robustly wait for and clean up child processes, logging process states and handling termination more gracefully.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-08-11 15:21:17 -03:00
Edwin Jose
b093c1fadb
refactor(session): migrate to server-based session management and add tests (#9077)
* update MCP Tests

* [autofix.ci] apply automated fixes

* Update util.py

* [autofix.ci] apply automated fixes

* Refactor MCP session manager for better configurability and cleanup (#9176)

* Add log rotation and header validation features

Introduces support for log rotation via the LANGFLOW_LOG_ROTATION environment variable and CLI/config options, with documentation updates. Adds header validation and sanitization for MCP connections, ensuring RFC 7230 compliance and security. Frontend and backend now support passing custom headers for MCP servers. Includes extensive new and updated unit tests for header handling, MCP utilities, and log rotation.

* Add unit tests for MCP utilities and update disconnect logic

Added comprehensive unit tests for MCP utility functions, session management, header validation, and client classes in test_mcp_util.py. Updated MCPStdioClient and MCPSseClient disconnect methods for clearer session cleanup logic. Refactored test_mcp_component.py to remove redundant and duplicated tests, consolidating coverage in the new test suite.

* [autofix.ci] apply automated fixes

* Update test_mcp_memory_leak.py

* Update util.py

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-08-09 09:30:39 +00:00
Gabriel Luiz Freitas Almeida
80ebe03d94
refactor(core): implement centralized dynamic lazy import system for components (#8932)
* feat: add import utilities for LangFlow components

- Introduced a new module `_importing.py` containing the `import_mod` function.
- This function dynamically imports attributes from specified modules, enhancing modularity and flexibility in component initialization.
- Comprehensive docstring added for clarity on usage and parameters.

* feat: implement dynamic imports for LangFlow components

- Added dynamic import functionality to various LangFlow components, allowing for lazy loading of attributes on access.
- Introduced  mapping in each component's  to manage imports efficiently.
- Enhanced error handling for import failures, providing clearer messages for missing attributes.
- Updated  method to reflect available attributes for better introspection and tab-completion support.
- Comprehensive docstrings added to improve documentation and usability.

* test: add comprehensive tests for dynamic imports and component accessibility

- Introduced integration tests for dynamic import functionality, ensuring components are discoverable and instantiable post-refactor.
- Added unit tests for the `_import_utils` module, validating the `import_mod` function's behavior and error handling.
- Implemented tests to confirm all component modules are importable and maintain backward compatibility with existing import patterns.
- Enhanced performance tests to measure lazy loading efficiency and memory usage during component access.
- Ensured that all components have the required attributes for dynamic loading and that circular imports are prevented.

* chore: update ruff pre-commit hook to version 0.12.2 in configuration file

* refactor: update warning handling for dynamic imports

- Moved the warning suppression for LangChainDeprecationWarning into the dynamic import context to ensure it only applies during the import process.
- This change enhances clarity and maintains the original functionality while improving the robustness of the import mechanism.

* test: enhance dynamic import integration tests for component attributes

- Removed unnecessary import of AgentComponent and added assertions to verify essential attributes of OpenAIModelComponent, including display_name, description, icon, and inputs.
- Ensured that each input field has the required attributes for better validation of component integrity during dynamic imports.

* refactor: update import paths for Message class in conversation utilities

- Changed the import of the Message class from langflow.field_typing to langflow.schema.message across multiple utility files, ensuring consistency and alignment with the updated module structure.
- This refactor enhances code clarity and maintains compatibility with the latest schema definitions.

* refactor: remove Vectara components from LangFlow

- Deleted the Vectara components module from the codebase, streamlining the component structure.
- This change helps to reduce complexity and maintain focus on core functionalities.

* refactor: remove Vectara references from LangFlow component imports

- Eliminated Vectara from both the import statements and dynamic imports mapping, streamlining the component structure.
- This change contributes to reducing complexity and maintaining focus on core functionalities within the LangFlow framework.

* [autofix.ci] apply automated fixes

* fix: remove 'vectara' from __all__ in components module

* refactor: improve error handling tests for dynamic imports

* test: add tests for ModuleNotFoundError handling with None and special module names

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-08-05 20:48:59 +00:00
Mendon Kissling
087c1a2591
docs: refresh custom dependencies page (#9291)
* update-for-tomls

* move-explanation-to-beginning

* Apply suggestions from code review

---------

Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
2025-08-02 15:25:16 +00:00
Mendon Kissling
f3701989b8
docs: refresh cli page (#9274)
* cli-values

* split-out-introductory-commands

* remove-feature-flag-envs

* cleanup-cli-links

* fix type

* clarification-on-cli-superuser

* remove-internal-env-vars

* alignment and editorial

* audit booleans

---------

Co-authored-by: April M <april.murphy@datastax.com>
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
2025-08-02 15:24:31 +00:00
Mendon Kissling
21f678dd90
docs: kubernetes best practices and postgresql dba guide (#9226)
* content

* dba-style

* kubernetes-best-practices

* edits

* spacing-cleanup

* see-also

* trailing-space

* Apply suggestions from code review

Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>

* title-case-and-via

* steps-for-intro

* ha-postgres

* dba-page

* code-review

* a-the

* Apply suggestions from code review

Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>

* move-file-location

* split-out-bp-page

* cleanup-links

* link

* editorial - k8s dev and prod deployments

* working on dba and best practices

* finish best practices

* fix link

* finish dba and best practices

* fix migration command

---------

Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
Co-authored-by: April M <april.murphy@datastax.com>
2025-08-01 21:37:56 +00:00
Mendon Kissling
67c2523589
docs: add example for plist (#9294)
* add-example-for-plist

* ampersands
2025-08-01 21:23:25 +00:00
Cristhian Zanforlin Lousa
bdcc238618
refactor: Improve cookie security and centralized utility (#9240)
*  (authContext.tsx): Add setCookieWithOptions function to set cookies with specific options for better security and control
📝 (use-post-refresh-access.ts): Update cookies.set calls to use setCookieWithOptions function for consistent cookie settings
♻️ (utils.ts): Refactor setCookieWithOptions function to include httpOnly option and update sameSite values to lowercase for consistency

* 📝 (frontend): add useGetCookieAuth and useSetCookieAuth hooks for managing cookies in auth context
🔧 (frontend): refactor authStore to use new cookie hooks for managing access token and api key cookies
🔧 (frontend): refactor use-post-logout and use-post-refresh-access to use new cookie hooks for cookie management

* 📝 (frontend): Remove redundant useGetCookieAuth hook and use direct access to cookies in authStore and related components
🔧 (utils): Refactor getAuthCookie and setAuthCookie functions to use react-cookie directly for better code organization and readability
2025-08-01 14:38:01 +00:00
Edwin Jose
b18c58e836
ref: Increase max file upload size to 1024 MB (#9276)
Increase max file upload size to 1024 MB

Updated the default value of max_file_size_upload from 100 MB to 1024 MB in the Settings class to allow larger file uploads.

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-08-01 14:30:55 +00:00
Cristhian Zanforlin Lousa
caccdb79e2
fix: Add metadata filtering for Chroma components (#9137)
* 🐛 (chroma.py, local_db.py): Handle ImportError when importing filter_complex_metadata function to avoid crashing the application
💡 (chroma.py, local_db.py): Add try-except block to gracefully handle ImportError and log a warning message if the function cannot be imported

* ♻️ (local_db.py): remove unnecessary try-except block and simplify document adding process in LocalDBComponent

* 🔧 (chroma.py): Remove unused import 'filter_complex_metadata' and add support for filtering complex metadata to prevent ChromaDB errors
🔧 (test_chroma_vector_store_component.py): Add test cases for filtering complex metadata, preserving simple metadata types, handling single file upload scenario, fallback behavior when import fails, and handling empty and None metadata values.

* [autofix.ci] apply automated fixes

* 🐛 (test_chroma_vector_store_component.py): fix failing test due to None value being filtered out by ChromaDB metadata handling

* 🔧 (test_chroma_vector_store_component.py): refactor test method names and data to improve clarity and consistency in metadata filtering and preservation logic

* 🐛 (test_chroma_vector_store_component.py): fix missing variable assignment for error message in mocked import error to improve error handling and debugging in tests

* [autofix.ci] apply automated fixes

* 🔧 (test_chroma_vector_store_component.py): delete the file test_chroma_vector_store_component.py as it is no longer needed in the project

* [autofix.ci] apply automated fixes

*  (test_chroma_vector_store_component.py): add unit tests for ChromaVectorStoreComponent including create_db, create_collection_with_data, similarity_search, mmr_search, search_with_different_types, search_with_score, duplicate_handling, chroma_collection_to_data, metadata_filtering_with_complex_data, metadata_filtering_fallback

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-08-01 14:24:07 +00:00
Cristhian Zanforlin Lousa
73225f4d81
fix: Add outputs support to SQLAgentComponent (#9173)
*  (sql.py): add new output definitions for the SQLAgentComponent to include 'Agent' and 'Response' outputs for better functionality and flexibility

* 📝 (sql.py): update import statement for Output class to match new file structure
♻️ (sql.py): refactor Output class usage to remove unnecessary attributes and improve code readability

---------

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-08-01 14:23:59 +00:00
dependabot[bot]
cf863ff4a9
build(deps):(deps): bump actions/setup-python from 4 to 5 (#9285)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-01 11:14:10 -03:00
dependabot[bot]
e3710f7431
build(deps):(deps): bump astral-sh/setup-uv from 3 to 6 (#9286)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-01 11:13:53 -03:00