Langflow is a powerful tool for building and deploying AI-powered agents and workflows.
feat: agentic UX (#10567)
* Add empty __init__.py files for agentic modules Created empty __init__.py files in agentic, core, tools, and utils directories to initialize them as Python packages. * Add agentic template search utilities and tests Introduces a new agentic utilities module for Langflow, including template search, tag extraction, and template count functions. Adds a README, demo script, and comprehensive unit tests for template search functionality. * Add Langflow Agentic MCP server with FastMCP tools Introduces a new MCP (Model Context Protocol) server for Langflow agentic tools using FastMCP. Adds server, CLI, example usage, tests, and comprehensive documentation. Exposes four MCP tools: search_templates, get_template, list_all_tags, and count_templates, enabling AI assistants to query and filter Langflow templates programmatically. * Handle unparameterized list types in schema inputs Adds support for unparameterized list annotations by treating them as lists of strings when converting schemas to Langflow inputs. This ensures nullable array schemas without explicit item types are handled gracefully. * Refactor search_templates to simplify parameters Removed the 'tags' parameter from the search_templates function and set a default value for 'fields'. Updated the call to list_templates to match the new signature, streamlining template search functionality. * Add output item processing for tool results Introduced process_output_item to handle tool output items, attempting to parse text-type items as JSON. This improves downstream handling of tool outputs by converting JSON strings to dictionaries when possible. * Refactor knowledge base path initialization Replaces direct settings access with a lazy-loading function for the knowledge bases root path in Knowledge Ingestion and Knowledge Retrieval starter projects. This improves reliability and consistency when accessing the knowledge base directory, and updates all usages to the new helper function. * Update component_index.json * Add IBM watsonx.ai support to starter projects Introduces IBM watsonx.ai as a selectable model provider in multiple starter project JSONs. Adds new input fields for 'base_url', 'project_id', and 'max_output_tokens' to support IBM watsonx.ai integration. Updates agent component code to handle new provider and its required parameters. * Add Ollama to supported LLM providers in starter projects Ollama has been added as a supported provider alongside Anthropic, Google Generative AI, OpenAI, and IBM watsonx.ai in all starter project JSON files. This expands the available options for LLM integration in initial setup templates. * Update Ollama model input constants and logic Refactored model_input_constants.py to update the OLLAMA_MODEL_INPUTS and OLLAMA_MODEL_INPUTS_MAP. Modified ollama.py to use the new input mapping and improved input handling for Ollama components. * Add flow creation from template MCP tool Introduces a new MCP tool for creating flows from starter templates in Langflow Agentic. Adds the utility function `create_flow_from_template_and_get_link` and exposes it via the FastMCP server, allowing users to create flows by template id and receive a UI link. Updates imports and documentation accordingly. * Add component search utilities and MCP tools to server Introduces new component search and retrieval tools to the MCP server, including endpoints for searching, listing, and counting components. Adds support functions in support.py for data normalization and a new component_search.py utility module. Updates the Nvidia Remix starter project to use the latest MCPToolsComponent code. * Add flow graph visualization utilities Introduces async utility functions for generating ASCII and text representations of flow graphs, as well as metadata summaries. These utilities support fetching flows by ID or name, error handling, and integration with Langflow's graph and logging modules. * Add flow component operations utilities and MCP tools Introduces flow component management utilities in `flow_component.py` for retrieving, updating, and listing component field values. Exposes new MCP tools in `server.py` for accessing component details, field values, updating fields, and listing all fields within a flow component. * Add SystemMessageGen flow and update MCPTools Introduces SystemMessageGen.json flow for agentic system message generation and updates MCPTools component logic in flow_component.py to support new flow structure and tool handling. * feat: init aiButton create an aiButton that opens the prompt modal for demoing add multiinput mixin * Update component_index.json * Refactor SystemMessageGen flow and remove unused init files Updated SystemMessageGen.json to support custom instructions, OpenAI model configuration, and improved agent settings. Removed unused __init__.py files from agentic, core, tools, and utils directories to clean up the codebase. * update to the mcp component * Add verify_ssl option to MCPToolsComponent Introduces a 'verify_ssl' boolean input to MCPToolsComponent for controlling SSL certificate verification in HTTPS connections. The option is added to the server config if not present, allowing users to disable verification for development or testing with self-signed certificates. * Optimize tool dropdown handling and output processing Improves logic for updating tool dropdown options by checking if the server has changed and whether tool mode is active, reducing unnecessary updates. Adds a process_output_item method to parse tool output as JSON when appropriate, enhancing output handling. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * feat: init onclick assistant prompt generation first pass at on button click generate input and auto fill a field * Replace MCPTools with Prompt Template in SystemMessageGen flow Updated the SystemMessageGen.json flow to use the Prompt Template and Parser components instead of MCPTools. Adjusted edges, nodes, and component configurations to reflect the new prompt-based workflow, removing tool selection and execution logic in favor of prompt generation and parsing. * Update SystemMessageGen flow and frontend dependencies Refactored edge connections and metadata in SystemMessageGen.json to improve flow logic and updated endpoint name. Added new optional and peer dependencies to package-lock.json, including @mapbox/node-pre-gyp and related packages, to support canvas and other modules. * Update user authentication in simplified_run_flow endpoint Replaces the dependency on api_key_security with CurrentActiveUser for the api_key_user parameter in the simplified_run_flow endpoint. This change is part of a TODO to create a new endpoint and may affect how user authentication is handled. * feat: hook everything up and have onclick prompt hook up commit * Add auto-configuration for Agentic MCP server Introduces utilities and startup logic to automatically configure the Langflow Agentic MCP server for all users when the agentic experience is enabled. Adds a new settings flag `agentic_experience` to control this feature, and updates the main server startup to trigger configuration. This enables agentic tools for flow/component operations, template search, and graph visualization in MCP clients. * Enable agentic MCP server and improve initialization Set agentic_experience to True by default in settings. Refactor agentic MCP server initialization in main.py to run in the background with a delay and retry logic, improving startup reliability. Update function calls to use 'current_user' instead of 'user' in agentic_mcp.py for consistency. * Update user authentication in simplified_run_flow Modified the api_key_user parameter to accept either CurrentActiveUser or UserRead from api_key_security, supporting both Bearer and session authentication methods. * revert the apikeu_user changes * test new api endpoint * Refactor agent flow and update component inputs Updated SystemMessageGen.json to refactor edge connections and node IDs for agentic flow. Added 'base_url' as a required input, enabled 'ai_enabled' for agent description, and replaced static memory input handling with dynamic retrieval via get_base_inputs(). Also improved tool callback setup and updated code hash and last_updated metadata. * Improve agentic flow creation and updating logic Enhances the agentic flow setup to extract flow_id and endpoint_name from JSON, update existing flows by ID or endpoint_name, and create new flows if they don't exist. Adds detailed logging and ensures flows are up-to-date in the user's Langflow Assistant folder. * chore: aibutton clean up * chore: add assistant store * Update SystemMessageGen.json * Update agentic_mcp.py * Update component_index.json * Fix agent input extraction from Message objects Agents now correctly extract and use the text content from Message objects, rather than passing the entire object or its string representation. This resolves issues where agents received verbose message representations instead of just the intended string input, and includes improved handling for multimodal content. Corresponding unit and integration tests have been added to verify this behavior for both OpenAI and Anthropic agents. * Add TemplateAssistant Langflow flow definition Introduces TemplateAssistant.json, a comprehensive Langflow flow configuration for agentic workflows. This flow integrates AstraDB, MCP Tools, and user input/output nodes, enabling document ingestion, search, and tool orchestration within the Langflow backend. * Improve MCPToolsComponent server/tool config refresh Refactored MCPToolsComponent to better handle tool and server config refreshes, especially when the MCP server changes. Added logic to avoid unnecessary clearing of tool inputs and options, and improved caching and UI update behavior for tool selection. Also updated related flow and starter project JSON files to reflect these changes. * auto add Global Variables for Agentic Experience * chore: clean up and get button working again * cleanup .md * fix:ruff, Refactor agentic utils and improve error handling Introduces shared default field lists for template/component search, refactors exception handling to use logger and add finally/else blocks, and improves type hinting with TYPE_CHECKING. Updates file opening to use Path objects, enhances error logging in template search, and removes the unused test_template_search.py file. * fix:ruff Expand exception handling in agentic MCP utilities Broadened exception handling in agentic MCP server and variable management functions to catch specific errors such as HTTPException, SQLAlchemyError, and common system exceptions. This improves robustness and error logging during server configuration, removal, and variable initialization. * aka-clean-up-1 * Remove duplicate process_output_item method Deleted two redundant definitions of the process_output_item method from MCPToolsComponent to clean up the code and prevent confusion. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes * Refactor service usage and improve project deletion logging Refactored login API to reuse a single settings service instance. Enhanced logging and error messaging when attempting to delete the Langflow Assistant folder. Minor variable usage cleanup in agentic flows setup and agent component test. * [autofix.ci] apply automated fixes (attempt 2/3) * Update test_template_search.py * Handle specific exceptions in agentic flow loading Updated the exception handling in load_agentic_flows to catch only OSError and orjson.JSONDecodeError instead of all exceptions, improving error specificity and logging. * Update component_index.json * [autofix.ci] apply automated fixes * revert loading setting service * Update login.py * Update SystemMessageGen.json * Update TemplateAssistant.json * [autofix.ci] apply automated fixes * Update constants.py * chore: seperate templateassistant and sysmessgen seperate templateassistant and sysmessgen frontend queries * chore: add header feature flag * use feature flag for all ui * [autofix.ci] apply automated fixes * package-lcok update * [autofix.ci] apply automated fixes * chore: LANGFLOW_AGENTIC_EXPERIENCE fe ff name * Update login.py * lint fix * [autofix.ci] apply automated fixes * Update component_index.json * chore: fix adjust-screan-view click * chore: same force issue as adjust-screen-view * chore: playwright pass 2 * revert package-lock * add type to langflow_modules * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * Handle TypeError in class-based serialization Adds a try-except block to catch TypeError when checking issubclass for objects that are types but not proper classes, such as typing special forms. This prevents serialization errors for generic aliases and similar constructs. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * Refactor type handling in field update and serialization Changed 'new_value' parameter type to str in update_flow_component_field for stricter typing. Simplified exception handling in serialize by removing unnecessary try/except around issubclass checks for class-based Pydantic types. --------- Co-authored-by: Adam Aghili <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
E
Edwin Jose committed
da6f29e37af7b85d1566ae7bd389b7b688470410
Parent: 9a2e2db
Committed by GitHub <[email protected]>
on 11/24/2025, 2:02:01 AM