This tutorial follows a similar format to the Agent Builder Quickstart use case of summarizing text; in this case, it adds the ability to upload and parse PDFs with Agent Builder and summarize the content. This tutorial use case is a research paper summarizer that summarizes papers for a specific persona. If you haven’t completed the Agent Builder Quickstart, you may want to do that first to familiarize yourself with the mechanics of Agent Builder.Documentation Index
Fetch the complete documentation index at: https://dev.writer.com/llms.txt
Use this file to discover all available pages before exploring further.
Build the UI
The UI for the agent contains:- A file input block
- A select input to choose the persona to summarize the file for
- A button to start the summarization process
- A message block to indicate that the file is in progress
- A text block to display the results
Add a File Input block
-
Label:
Research paper PDF -
Allowed file types:
.pdf -
Allow multiple files:
no
Add a select input to choose the persona
-
Label:
Persona -
Options: add the personas you want to summarize the file for. This example uses the personas
Sales,Marketing,Product, andEngineering. -
Link variable under Binding:
persona. You use this variable name in the blueprint when asking the text generation block to generate a summary for the selected persona.
Add a button to start the summarization process
-
Text:
Summarize
Add a message block to indicate that the file is in progress
-
Message:
@{status}. This will display the status message from the agent’s state. You use this variable name in the blueprint to update the status message in the UI.
Add a text block to display the results
-
Text:
@{summary}. This will display the summary results from the agent’s state. You use this name in the blueprint to display the summary results in the UI. -
Use markdown:
yes
Build the blueprints
The agent has two blueprints:- One for uploading a file to Writer cloud when a user adds a file to the file input block
- One for parsing the file and summarizing it when a user clicks the button to start summarizing
First blueprint: Upload file to Writer cloud
Before you can work with the content of a PDF file in a blueprint, you need to upload it to the Writer Cloud with the Add files to Writer Cloud block. Once you’ve uploaded the file, you can access it in the blueprint using the uploaded file’s ID and perform operations like parsing the PDF and providing that information to a text generation block.Add a UI trigger for file input
-
Alias:
File upload. This is optional, but helps to identify the trigger in the blueprint. -
Component Id: Select the
File Inputcomponent from the dropdown of UI blocks -
Event type:
wf-file-change
Add a block to add files to Writer Cloud
-
Files:
@{payload}. This references the payload provided by the preceding UI trigger. The payload contains the file that was uploaded to the file input block.
Add the uploaded file information to the state
file_info state variable. This is the information about the uploaded file, specifically the id of the file in Writer Cloud, that will be used in the next blueprint.In the block’s configuration panel, update the following fields:-
Link variable:
file_info -
Value type:
text -
Value:
@{result}. This references theresultfrom the previous block, which is the information about the uploaded file.
Second blueprint: Parse and summarize the file
Once you’ve uploaded the file to the Writer Cloud, you can parse the PDF and provide the file’s content to a text generation block.Add a new blueprint

Add a UI trigger for the button to start summarizing
-
Alias:
Start summary(optional, to make the trigger easier to identify) -
Component Id: Select the
Summarizebutton component from the dropdown of UI blocks -
Event type:
wf-click
Update the status message
-
Link variable:
status -
Value type:
text -
Value:
%Summarizing.... The%symbol creates an animated spinning icon when the message appears in the UI.
Add a block to parse the uploaded PDF file
- File:
@{file_info.0.id}. This references thefile_infostate variable you defined in the first blueprint and specifically access theidof the uploaded file.

Add a block to generate a summary of the parsed file
- Prompt:
Provide a one-paragraph summary and a list of the three most important takeaways from this research paper: @{result}. Provide the summary for the user persona @{persona}.@{result}references theresultfrom the previous block, which is the parsed PDF file.@{persona}references thepersonastate variable you defined in the UI.
- Model:
Palmyra X5

Add the summary results to the state
summary state variable.In the block’s configuration panel, update the following fields:-
Link variable:
summary -
Value type:
text -
Value:
@{result}. This references theresultfrom the previous block, which is the summary of the parsed PDF file.
Preview the agent
Now that you’ve built the agent, you can preview it.- Navigate to the Preview tab in the Agent Builder.
- Add a PDF file to the file input block and select a persona from the dropdown.
- Click the Summarize button to start the summarization process.
- You should see the status message update to
%Summarizing...and the summary results appear in the text block.

