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 ...
  • v-kpoloju-msft's avatar
    11 months ago

    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.