Build the Benefit Claims Assistant (Conversational Agent)¶
Here is our plan for this lesson:
- Build a conversational AI Agent in Studio Web that answers questions about the benefits program, using the Eligibility context
- Let the same agent register new applications: collect the documents in the chat, upload them and start the Benefit Claims Processing workflow
- Test both scenarios in the agent's chat
Goal¶
By the end of this lesson you'll have a Benefits Assistant that applicants can chat with. It answers questions about the SNAP program from the official documents, and it registers a new application end to end: it asks for the applicant's email, then the application, then the paystub, stores both files and starts the existing Benefit Claims Processing workflow, without waiting for the decision.
What we are building¶
The agent has two jobs:
- Job A: answer questions about the SNAP benefits program, using only the official program documents in the
Eligibilityindex. - Job B: register a new application. It collects the applicant's email address, then the application, then the paystub, uploads each file, and starts the existing Benefit Claims Processing workflow.
Applicant (chat window)
|
v
+-----------------------------------------+
| Benefits Assistant Conversational Agent |
+-----------------------------------------+
| | |
Job A | Job B | | Job B (after "yes")
v v v
+--------------+ +---------------------+ +----------------------+
| Eligibility | | UploadFileTo | | Start Benefit Claim |
| index (RAG) | | StorageBucket (x2) | | (robot, no waiting) |
+--------------+ +---------------------+ +----------------------+
| |
v v
"Input Documents" bucket BenefitClaimsProcessing (BPMN)
application + paystub agents, case worker review,
approval / rejection email
| Piece | Type | What it does | Why it is there |
|---|---|---|---|
| Benefits Assistant Conversational Agent | Low-code agent, Conversational | Chats with the applicant, answers questions, runs the registration flow | One friendly front door for applicants |
| Eligibility | Context Grounding index (already in the solution) | Returns the most relevant passages from the program documents | The agent answers from official rules, not from its own memory |
| UploadFileToStorageBucket | RPA robot (already in the template) | Saves a file the user attached in the chat into the Input Documents bucket and returns the real file name | The BPMN reads its input files from that bucket. A robot with a file argument also lets the chat accept file uploads |
| Start Benefit Claim | RPA robot (already in the template) | Starts the BenefitClaimsProcessing process with the two file names and the email, then returns right away |
No Integration Service connector needed. It does not wait, because the BPMN can run for days |
| BenefitClaimsProcessing | BPMN agentic process (already in the solution) | Extracts data, runs the verification agents, sends the case to a case worker, emails the result | Unchanged. The chat simply becomes a new way to start it |
Key idea
The agent decides what to do and when. Robots do the parts that must be exact: storing files, stamping the real time, starting a process. An LLM has no reliable clock and should never guess a timestamp.
Conversational vs. autonomous agents¶
An autonomous agent, like the ones you built in the earlier lessons, takes one input and returns one structured output. A conversational agent talks with a person over many turns, streams its replies and can ask follow-up questions. Registration needs exactly that.
That's also why a conversational agent looks different:
- No output arguments. A conversational agent's "output" is the chat itself: its messages and the tool calls it makes. Nothing would ever fill an output schema, so leave it empty.
- The user prompt stays blank. In an autonomous agent, the user prompt turns input arguments into a task. Here, each chat message from the user is the input. The platform sends the whole conversation to the agent on every turn.
You also don't add any input argument for "message" or "chat history". The platform provides the conversation automatically.
Steps¶
1. Create the conversational agent¶
-
In the Explorer, click Add (+) and choose Agent under Building Blocks.

-
Name the agent:
-
In the Select agent type dialog, choose Conversational under LOW-CODE and click Start fresh.

-
In the agent settings, choose the model
anthropic.claude-sonnet-5(Claude Sonnet 5).
The agent now appears in the Explorer, its type is Conversational, and it has no input or output arguments.
2. Add the Eligibility context¶
Context Grounding is a component of the UiPath AI Trust Layer which allows you to bring in your data to generate more accurate, reliable GenAI predictions. It stores your documents in an index: a searchable copy that returns the passages that best match a question.
The index contains the program documents (eligibility criteria and benefit calculation rules). With it, the agent answers from the official text and can show where the answer came from. Without it, the agent would answer from general knowledge, which may be outdated or simply wrong for this program.
-
In the agent, click Add Context.

-
Select Context Grounding Indexes.

-
Select the Eligibility index from the current solution.

-
Choose the Semantic search strategy.

-
Paste this as the context description:
SNAP program eligibility rules: income limits, deductions, household size rules and benefit amounts.
-
Keep the search query dynamic (the agent writes the query) and paste this as the query description:
A focused natural-language question about SNAP eligibility rules, income limits, deductions or benefit amounts.
3. Add the UploadFileToStorageBucket tool¶
This robot stores each attached file in the Input Documents bucket. It also has a file argument (In_File): a tool that can process files is what enables file uploads in the chat. Without it, users can't attach files.
-
In the tools section, click +.

-
Search for UploadFileToStorageBucket under RPA workflows and select it.

-
Paste this into the tool Description. It tells the agent what the tool does and when to call it. The details of each value go in the argument descriptions, in the next step.
-
Fill in the argument descriptions (the text the agent reads to decide what to pass):
-
In_File: -
in_emailAddress: -
in_FileName:Target file name: <sanitized email>_<application|paystub>_{timestamp}.<pdf|png>. Sanitized email = the email with every '@' and '.' replaced by '_'. Keep the literal text {timestamp}, the robot replaces it. The application is always .pdf; the paystub extension must match the attached file. Example: jane_doe_example_com_paystub_{timestamp}.png
-

4. Add the Start Benefit Claim tool¶
Let's add the tool that triggers the Maestro process for claim submission.
-
In the tools section, click +.

-
Search for Start Benefit Claim and select it.

-
Paste this into the tool Description:
-
Fill in the argument descriptions:
-
in_Application: -
in_ExamplePaystub: -
in_emailAddress:

-
5. Write the System Prompt¶
The system prompt is the agent's job description. It sets the scope, the two jobs, the exact registration steps and the rules for tools. A vague prompt is the most common reason an agent misbehaves.
The prompt covers:
- Job A, answer program questions: only from the Eligibility context; at most 3 searches per question; if the documents don't contain the answer, say so; never decide whether a specific person is eligible or estimate their benefit (that's the case worker's job, through the BPMN).
- Job B, register an application, one file at a time:
- Ask for the email address.
- Ask for the application (PDF, max 5 MB), upload it as
<sanitized email>_application_{timestamp}.pdf, and confirm it was received. - Only then ask for the paystub (PDF or PNG, max 5 MB) and upload it as
<sanitized email>_paystub_{timestamp}.pdfor.png, matching the file. - If the user attaches two files at once, ask them to send one at a time, starting with the application.
- Summarise (email + the two stored file names) and ask for confirmation.
- Call Start Benefit Claim with the two returned
out_FileNamevalues and the email. - Tell the user the application was submitted and they'll be contacted by email.
The "sanitized email" replaces every @ and . with _. Example: for jane.doe@example.com the agent sends jane_doe_example_com_application_{timestamp}.pdf, and the robot stores it as, for example, jane_doe_example_com_application_20261016143005.pdf.
Open the agent, select the System prompt field and paste the prompt below. Leave the User prompt empty.
You are the Benefits Assistant for the SNAP benefits program. You help members of the public understand the program rules and register a new benefit application. Tone: friendly, patient, clear and concise. Use plain language and avoid jargon.
Scope:
- In scope (Job A): questions about SNAP eligibility rules, deductions, income limits, household size rules and benefit amounts.
- In scope (Job B): registering a new benefit application by collecting the applicant's email, then the application (PDF), then the paystub (PDF or PNG), one at a time, and submitting the claim.
- Out of scope: any other topic, legal or tax advice, the status or outcome of an existing claim, and changes to a submitted claim. Politely say you cannot help with that and, where relevant, point the user to the benefits office.
Conversation behavior:
- On the first turn, greet the user briefly and explain that you can answer questions about SNAP eligibility rules or help them submit a new application.
- If the user's intent is unclear, ask one short clarifying question before acting.
- Handle one job at a time. If the user switches from questions to applying (or back), follow the new request.
Job A: answering eligibility questions
- Answer ONLY from information retrieved from the Eligibility context. Do not use outside knowledge about SNAP or other programs.
- Search the Eligibility context with a focused query. Search at most 3 times per user question. After the third search, stop searching and answer with what you already have.
- If the retrieved content does not cover the question, or only covers part of it, say so clearly and do not guess.
- Explain rules in general terms. Never make an eligibility decision for a specific person, never say that someone qualifies or does not qualify, and never promise or estimate a benefit amount for a specific person or household. If the user asks whether they personally qualify or how much they will get, explain the relevant general rules and invite them to submit an application so the program can assess their case.
Job B: registering a new application
Follow these steps in order. Do not skip steps.
1. Ask for the applicant's email address. If the value does not look like a valid email address, ask again.
2. Collect and upload the application first. Ask the user to attach ONLY the completed application form (a PDF file, at most 5 MB) and wait for it. Treat the file attached in reply to this request as the application. If it is missing, is not a PDF, or is larger than 5 MB, explain the problem and ask for a correct file. Then upload it with the UploadFileToStorageBucket tool: In_File = the attached application, in_emailAddress = the email address, in_FileName = <sanitized email>_application_{timestamp}.pdf. Keep the returned out_FileName and tell the user the application was received.
3. Then collect and upload the paystub. Only after the application upload has succeeded, ask the user to attach ONLY a recent paystub (a PDF or a PNG image, at most 5 MB) and wait for it. Treat the file attached in reply to this request as the paystub. If it is missing, has another format, or is larger than 5 MB, explain the problem and ask for a correct file. Then upload it with the UploadFileToStorageBucket tool: In_File = the attached paystub, in_emailAddress = the email address, in_FileName = <sanitized email>_paystub_{timestamp}.pdf for a PDF, or <sanitized email>_paystub_{timestamp}.png for a PNG. The extension must match the attached file. Keep the returned out_FileName.
Rules for both uploads:
- Build the sanitized email by replacing every "@" and every "." in the email address with "_". Example: jane.doe@example.com becomes jane_doe_example_com.
- Write the text {timestamp} literally, including the curly braces. The tool replaces it with the real timestamp.
- Ask for one file at a time. If the user attaches more than one file in a single message, do not guess which is which: ask them to send the files one at a time, starting with the application.
- If an upload fails, tell the user and offer to try again; do not continue to step 4 until both uploads have succeeded.
4. Show a short summary: the email address and the two file names returned by the tool (application and paystub). Ask the user to confirm that the details are correct and that they want to submit the application.
5. Only after the user explicitly confirms, call the Start Benefit Claim tool once with in_Application = the out_FileName returned for the application, in_ExamplePaystub = the out_FileName returned for the paystub, and in_emailAddress = the email address. If the user does not confirm, ask what they want to change.
6. Tell the user that the application has been submitted and that they will be contacted by email about the next steps. Do not wait for the processing result, and do not guess or predict the outcome.
Tools:
- Eligibility context: use only for Job A questions, at most 3 searches per question.
- UploadFileToStorageBucket: call only in Job B steps 2 and 3, once per document, and only with a file the user attached in this conversation.
- Start Benefit Claim: call only in Job B step 5, after explicit user confirmation, and only once per application.
- Never invent, edit or reformat file names. Only pass out_FileName values exactly as returned by UploadFileToStorageBucket.
Privacy:
- Ask only for the information needed: the applicant's email and the two documents. Do not ask for social security numbers, bank details or other personal data.
- Do not repeat the contents of the uploaded documents back to the user.
Response style:
- Default to 2 to 4 sentences. Use short bullet lists for multi-part rules or summaries.
- Be warm and encouraging, but factual.
Uncertainty:
- If the Eligibility context does not cover something, say that you do not have that information and suggest contacting the benefits office.
- If a tool returns an error or an unexpected result, explain it simply and offer to retry. Never pretend that an action succeeded.

6. Test the agent: ask a question¶
Conversational agents are tested in the chat in Studio Web. Tool calls during the test are real: files really land in the bucket and the BPMN really starts.
Open the agent and start its test chat (Debug).

Then type:
In the details of the run you see a search in the Eligibility context and no tool calls.

Try a question the documents can't answer, for example "What's the weather tomorrow?", or a specific one like "Am I eligible? I earn $3,000." The agent should say it can't help with the first one. For the second, it should explain the general rules and invite you to submit an application, without saying whether you qualify.
7. Test the agent: register an application¶
-
Type:
-
When the agent asks, give your own email address. You'll receive the final decision email there.
- The agent asks for the application. Use the attach (paperclip) button in the chat and send Sample application.pdf.
- The agent uploads it and tells you the application was received. Then it asks for the paystub.
- Attach your paystub (for example Sample pay stub.png).
- Read the summary. It should show your email and two file names.
- Answer
yes.
In the chat you should see:
- The agent calls UploadFileToStorageBucket twice, in two separate turns: first for the application, then for the paystub.
- The summary shows two different names, with a real timestamp, and the paystub keeps its own extension, for example:
jane_doe_example_com_application_20261016143005.pdfjane_doe_example_com_paystub_20261016143112.png
- After your confirmation, the agent calls Start Benefit Claim once.
- The agent tells you the application was submitted and that you'll be contacted by email. It does not wait for a decision.
In Orchestrator (in the folder your debug run uses; ask your trainer if you're not sure which one):
| Where | What you should see |
|---|---|
| Storage Buckets → Input Documents | The two new files, with the names from the summary |
| Jobs | Two UploadFileToStorageBucket jobs and one Start Benefit Claim job, all Successful within seconds |
| Jobs | One BenefitClaimsProcessing job, Running |
| Maestro → process instances | The new BenefitClaimsProcessing instance with in_Application, in_ExamplePaystub and in_emailAddress filled with your values |
Later, after the case worker review, the approval or rejection email arrives in your inbox.
Time to move to the next one!