Skip to content

Unable to run flow with run_flow_from_json if Agent is present #7537

Open
@lucaseduoli

Description

@lucaseduoli

Bug Description

If I create a flow with an Agent component, the flow cannot run with the Python function "run_flow_from_json". That is due to the Agent component receiving a Chat History, which tries to access the Database. Since "run_flow_from_json" does not run the Database, the execution fails.

Reproduction

Steps to reproduce the behavior:

  1. Create a basic Agent flow
  2. Add the API keys
  3. Export the flow with the API keys
  4. Run this code on a Python file:
from langflow.load import run_flow_from_json

flow = run_flow_from_json(flow="simple_agent.json", input_value="hello")

print(flow)
  1. Receive the error: ValueError: Error running graph: Error building Component Agent: (sqlite3.OperationalError) no such table: message

Expected behavior

The flow should run without a chat history and display an output.

Who can help?

@italojohnny @ogabrielluiz @erichare

Operating System

macOS Sequoia

Langflow Version

1.3.2

Python Version

3.12

Screenshot

Image

Flow File

simple_agent.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions