logo

NJP

Quick Tutorial: AI Agent Capturing Content from User Uploaded Attachment

New article articles in ServiceNow Community · Sep 16, 2026 · article

I’ve seen a lot of questions from folks wondering how they can configure their AI agent to accept an attachment from a user, rather than relying on pre-situated attachments, like I shared earlier with the File Upload Tool.

 

There’s a few ways to do it, but this might be the easiest way. Let’s go through it here.

 

Prerequisites

For this tutorial, I’m running the following setup:

  • Australia Patch 5 W37 build
  • ServiceNow Otto Platform Prime [sn_ai_plat_prm] 2.2.0
  • ServiceNow Otto AI Agents [sn_aia] 8.3.4
  • Content Understanding (formerly Now Assist in Document Intelligence) [sn_docintel_gen_ai] 7.0.5

Virtual Agent Topic Configuration

You’ll need to first configure a VA Topic to provide the user a place to upload their attachment.

Login as a System Administrator, and go to Conversational Interfaces > Virtual Agent > Designer :

 

warren_chan_0-1789578960668.png

 

In the Conversational Studio, go to Asset library. My example is going to run from AI agents, so I will select LLM and ServiceNow Otto for Virtual Agent (default) as the Conversational Assistant to see my list of existing Assets.

 

Then, select Create asset to get started with the Topic.

 

warren_chan_2-1789579048705.png

 

In the Create asset modal, select Topic :

 

warren_chan_3-1789579078803.png

 

In the Create a topic wizard, enter the following:

  • Application scope: <your desired app scope>
  • Model Type: LLM
  • Type: Topic
  • Internal name: Story upload
  • Display name: Story upload
  • Topic description used for discovery: Upload a story
  • Select LLM assistants to make topics available to them and any primary assistants: ServiceNow Otto for Virtual Agent (default), or Now Assist Panel if you desire as well

warren_chan_4-1789579110154.png

 

Configure Advanced properties if you need to, but I don’t believe you have to make any changes.

 

warren_chan_5-1789579130899.png warren_chan_6-1789579136254.png

 

Select Create when finished. In the Topic builder, click-and-drag the Multi File Upload Utility to the line between Start and End blocks.

 

warren_chan_7-1789579176441.png

 

In the node configuration for the Multi File Upload utility , set the following variable values:

  • Node name: Upload a story
  • prompt (String): Upload a story
  • allow_user_to_skip (Boolean): unchecked
  • max_file_count (String): 5
  • max_file_size (String): 5
  • try_again_message (String): Please try uploading again.
  • user_confirmation_to_repload_msg (String): Reupload
  • allow_all_file_types (Boolean): checked

warren_chan_8-1789579200860.png

 

Create an output mapping variable at the bottom of the node configuration:

  • Name: files
  • Variable Name: files
  • Enable: checked

warren_chan_9-1789579226304.png

 

Save and Publish the Topic. Verify that it is set to Active :

 

warren_chan_10-1789579244812.png

 

Exit the Virtual Agent Designer. We’ll use our Topic as a Tool in our AI Agent.

 

AI Agent Configuration

Now that our VA Topic is ready to go, navigate to the AI Agent Studio. Go to AI Agent Studio > Create and manage :

warren_chan_11-1789579277131.png

 

Under the AI agents pane, select Add > Chat :

 

warren_chan_12-1789579293590.png

 

Set up your AI agent like this. Under Define the specialty , enter the following:

  • AI agent name: Story Summary Agent
  • AI agent description: An AI agent for readers, students, and general users who want to upload a short story file, get a summary, and ask follow-up questions about the story. It reads the uploaded document, returns a concise summary, and provides document-grounded answers to additional questions.
  • AI agent role: Acts as a document-based reading assistant that accepts a user-uploaded short story file, generates a concise summary of the story, and answers additional user questions grounded only in the uploaded story content. Communicates in clear, direct language. Produces accurate story summaries and question responses without adding facts that are not present in the document. Handles both initial summary requests and follow-up questions about plot, characters, themes, setting, tone, and other story details.
  • List of steps:

Instructions # Gather story 1. Use the "Upload a story" tool and ask for an uploaded short story file from the user. Store the Attachment's [sys_attachment] sys_id value in variable ${attachmentId} # Attachment validation 2. Check whether the uploaded file is accessible and readable. 2.a. If the file is not accessible or readable, return a message asking the user to upload the file again. 2.b. If the file is accessible and readable, continue to the next step. 2.c. Validation: Verify that the file is readable. # Story content 3. Read the story content. Use the "Read story content from attachment" tool. Use the variable ${attachmentId} as the Attachment ID. # Procedure for Summary request 4.a. Classify the request as Summary when the user asks for a general summary of the story. 4.b. If the request type is Summary, generate the story summary when the request type is Summary. 4.c. Return the summary exactly as generated. # Procedure for Question and Answer 5.a. Classify the request as QnA when the user asks a specific question about the story, or when the user asks for a summary in a specific style, format, or length. 5.b. Capture the user's additional question when the request type is QnA. 5.c.. Generate the answer to the user's question from the uploaded story. 5.d. Return the answer exactly as generated. Base every response only on the uploaded story content. 5.e. State that the answer is not available in the story when the uploaded file does not contain the requested information. 5.f. Process each new follow-up question against the same uploaded story when the file remains available.

 

warren_chan_13-1789579419075.png

warren_chan_14-1789579435756.png

 

Under Add tools and information , set up two Tools. For the first, go to Add tool > Conversational topic :

 

warren_chan_15-1789579463072.png

 

In the Add a conversational topic Tool configuration, fill out the form as follows:

 

warren_chan_16-1789579478755.png

 

  • Select topic: Story upload
  • Name: Upload a story
  • Tool description: Allows user to upload a story to the AI agent. Inputs: Story file.
  • Execution mode: Autonomous
  • Display output: unselected

warren_chan_17-1789579498763.png

 

Select Add. Your first Tool should be created:

 

warren_chan_18-1789579525175.png

 

For the second Tool, go to Add tool > AI skill :

 

warren_chan_19-1789579546131.png

 

In the Add an AI skill Tool configuration, fill out the form as follows:

 

warren_chan_20-1789579563221.png

 

  • Select skill: Document extraction
  • Name: Read story content from attachment
  • Tool description: Read story content from the attachment. Input: Attachment ID. Output: Attachment text.
  • Execution mode: Autonomous
  • Display output: unselected

warren_chan_21-1789579588209.png

warren_chan_22-1789579605417.png

 

Let’s take a minute to examine the Document extraction skill. From AI Admin Hub , go to Platform > Other , and search for Document extraction :

 

warren_chan_23-1789579626129.png

 

This is the referenced Document extraction skill within AI Skill Kit (formerly Now Assist Skill Kit):

 

warren_chan_24-1789579643843.png

 

Select Add. Your second Tool should be created:

 

warren_chan_25-1789579666907.png

 

Finish out the rest of the AI agent configuration. Select security controls, triggers, conversation assistants, and be sure to activate your AI agent.

 

warren_chan_26-1789579685921.png

 

warren_chan_27-1789579700707.png

warren_chan_28-1789579720337.png

warren_chan_29-1789579735075.png

 

Testing the AI agent

In the AI Agent Studio, go to the Testing playground. Fill out the test form as follows:

  • Choose a test type: AI agent or workflow
  • Choose a testing mode: (either mode works)
  • Name of the AI agent or agentic workflow: Story Summary Agent
  • Version: (latest)
  • Task: Summarize my story

warren_chan_30-1789579759159.png

 

Select Continue to test chat response.

 

When the execution plan runs, you’ll be asked to upload a file containing a story. I’ll use The Tale of Peter Rabbit, a classic children’s book written by Beatrix Potter in 1902.

 

warren_chan_31-1789579787051.png

 

After uploading my file (I used Microsoft Word, DOCX format), I’ll see a response like this:

 

warren_chan_32-1789579807985.png

 

Once the file content is in the conversation context, you can continue to refer to it:

 

warren_chan_33-1789579828004.png

 

warren_chan_34-1789579843321.png

warren_chan_35-1789579848926.png

 

You’re all done!

 

Troubleshooting

  • If you’re using an older version of Now Assist in Document Intelligence, it should still work, but you may want to consider updating the plugin/application first. If you have skipped records in your upgrade logs [sys_upgrade_history_log], consider reverting those to baseline/OOB as well.
  • If having trouble getting the file extracted in Content Understanding, try using a smaller file with only text.
  • If you’re using a PDF file, you may want to try different encodings, or different export methods.
  • Consider swapping LLMs in your Skill settings if you’re running into continued failures, at least rule out a model configuration issue.

Resources

View original source

https://www.servicenow.com/community/servicenow-otto-articles/quick-tutorial-ai-agent-capturing-content-from-user-uploaded/ta-p/3598782