Forum Discussion

margaretaak's avatar
margaretaak
Frequent Visitor
1 year ago
Solved

Automatically exporting conversations in Data Agent to a Lakehouse .pdf file using Notebook

I have created a Microsoft Fabric Data Agent and published it. As far as I know, Microsoft Fabric Data Agent cannot be published externally yet, so I accessed it by clicking Open Data Agent and then changing Draft to Published. In Microsoft Fabric Data Agent, there is also a link for publishing, but I think access is still limited (considering that Microsoft Fabric Data Agent is still in the preview stage). Could anyone please tell me how to automatically export conversations (input questions submitted by users and output answers generated by Microsoft Fabric Data Agent, including the visualizations) after a session ends to a Lakehouse .pdf file using Microsoft Fabric Notebook?

  • Hi margaretaak,

    Thank you for reaching out to the Microsoft Fabric Community Forum. Also, thanks to ibarrau, for his inputs on this thread.

    I understand you would like to automatically export the conversations (user inputs, Data Agent responses, and visualizations) into a PDF file and store it in a Lakehouse once a session ends.

    Now, Data Agent is still in preview, there isn’t a built-in option to directly export or publish conversations externally. That said, you can achieve this using Microsoft Fabric Notebooks together with your Lakehouse.

    Capture the conversation: Log user questions and agent responses inside a Notebook as a simple table (for example, a pandas DataFrame).

    Generate a PDF: Use Python libraries such as reportlab within the Notebook to write the conversation text (and optionally any regenerated visualizations) into a PDF file.


    Save to Lakehouse: By writing the PDF into /Lakehouse/default/Files/, it is automatically stored in your connected Lakehouse. Automate if needed: You can schedule the Notebook to run after sessions, using Fabric’s orchestration features.

    Refer these links:
    1. https://learn.microsoft.com/en-us/fabric/data-science/concept-data-agent 
    2. https://learn.microsoft.com/en-us/fabric/data-engineering/lakehouse-notebook-explore 
    3. https://learn.microsoft.com/en-us/fabric/data-engineering/how-to-use-notebook 
    4. https://learn.microsoft.com/en-us/fabric/data-science/how-to-create-data-agent 

    Important note: Visuals generated inside Data Agent don’t currently export automatically, but you can recreate them in the Notebook (e.g., matplotlib/seaborn) before writing them to PDF.

    Hope this clears it up. Let us know if you have any doubts regarding this. We will be happy to help.

    Thank you for using the Microsoft Fabric Community Forum.

4 Replies

  • Hi. I'm really not sure if you can export that data. I would say no because I can't see that from the Fabric API. On the other hand, fabric data agents has an sdk. I think you can take it externally if you code a secure web. You would handle the conversations. Of course you would need a lot of coding experience.

    You can read more about that here: https://learn.microsoft.com/en-us/fabric/data-science/fabric-data-agent-sdk

    I hope that helps,

  • v-kpoloju-msft's avatar
    v-kpoloju-msft
    Icon for Community Support rankCommunity Support

    Hi margaretaak,

    Thank you for reaching out to the Microsoft Fabric Community Forum. Also, thanks to ibarrau, for his inputs on this thread.

    I understand you would like to automatically export the conversations (user inputs, Data Agent responses, and visualizations) into a PDF file and store it in a Lakehouse once a session ends.

    Now, Data Agent is still in preview, there isn’t a built-in option to directly export or publish conversations externally. That said, you can achieve this using Microsoft Fabric Notebooks together with your Lakehouse.

    Capture the conversation: Log user questions and agent responses inside a Notebook as a simple table (for example, a pandas DataFrame).

    Generate a PDF: Use Python libraries such as reportlab within the Notebook to write the conversation text (and optionally any regenerated visualizations) into a PDF file.


    Save to Lakehouse: By writing the PDF into /Lakehouse/default/Files/, it is automatically stored in your connected Lakehouse. Automate if needed: You can schedule the Notebook to run after sessions, using Fabric’s orchestration features.

    Refer these links:
    1. https://learn.microsoft.com/en-us/fabric/data-science/concept-data-agent 
    2. https://learn.microsoft.com/en-us/fabric/data-engineering/lakehouse-notebook-explore 
    3. https://learn.microsoft.com/en-us/fabric/data-engineering/how-to-use-notebook 
    4. https://learn.microsoft.com/en-us/fabric/data-science/how-to-create-data-agent 

    Important note: Visuals generated inside Data Agent don’t currently export automatically, but you can recreate them in the Notebook (e.g., matplotlib/seaborn) before writing them to PDF.

    Hope this clears it up. Let us know if you have any doubts regarding this. We will be happy to help.

    Thank you for using the Microsoft Fabric Community Forum.

    • v-kpoloju-msft's avatar
      v-kpoloju-msft
      Icon for Community Support rankCommunity Support

      Hi margaretaak,

      Just checking in to see if the issue has been resolved on your end. If the earlier suggestions helped, that’s great to hear! And if you’re still facing challenges, feel free to share more details happy to assist further.

      Thank you.

      • v-kpoloju-msft's avatar
        v-kpoloju-msft
        Icon for Community Support rankCommunity Support

        Hi margaretaak,

        Hope you had a chance to try out the solution shared earlier. Let us know if anything needs further clarification or if there's an update from your side always here to help.

        Thank you.