Playground

Test your flow by chatting with it in the Playground.

Type a message into the input box, and see how your flow responds.

playground

Memory Management

Click the Memories tab to open a table of previous interactions for a specific flow.

Chat conversations store messages categorized by a Session ID. A single flow can host multiple Session IDs, and different flows can share the same Session ID.

Individual messages in chat memory can be edited or deleted. Modifying these memories will influence the behavior of the chatbot responses.

Use custom Session IDs for multiple user interactions

Session ID values are used to track user interactions in a flow. They can be configured in the Advanced Settings of the Chat Input and Chat Output components.

By default, if the Session ID value is empty, it is set to the same value as the Flow ID. This means every API call will use the same Session ID, and you’ll effectively have one session.

To have more than one session in a single flow, pass a specific Session ID to a flow with the session_id parameter in the URL. All the components in the flow will automatically use this session_id value.

  1. Post a message to a flow with a specific Session ID with curl:

    curl -X POST \
        "https://api.langflow.astra.datastax.com/lf/YOUR_LANGFLOW_ID/api/v1/run/YOUR_FLOW_ID?stream=false" \
        -H 'Content-Type: application/json'\
        -H "Authorization: Bearer YOUR_APPLICATION_TOKEN"\
        -d '{"input_value": "message",
        "output_type": "chat",
        "input_type": "chat",
        "session_id": "YOUR_SESSION_ID"
    }'

    Replace the following:

    • LANGFLOW_ID: the Langflow ID

    • FLOW_ID: the flow ID

    • APPLICATION_TOKEN: the application token

    • SESSION_ID: the session ID

  2. Check your flow’s Memories tab. In addition to the messages stored for the Default Session, a new chat session is started with your new Session ID.

Use custom Session IDs for specific components

Chat Input and Chat Output components can store a session_id parameter as a Tweak for specific sessions. The Playground will still display all available sessions, but the flow will use the value stored in the session_id tweak.

curl -X POST \
    "https://api.langflow.astra.datastax.com/lf/LANGFLOW_ID/api/v1/run/FLOW_ID?stream=false" \
    -H 'Content-Type: application/json'\
    -H "Authorization: Bearer APPLICATION_TOKEN"\
    -d '{"input_value": "message",
    "output_type": "chat",
    "input_type": "chat",
    "tweaks": {
        "session_id": "SESSION_ID"
    }
}'

Replace the following:

  • LANGFLOW_ID: the Langflow ID

  • FLOW_ID: the flow ID

  • APPLICATION_TOKEN: the application token

  • SESSION_ID: the session ID

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com