Back to Home

Ask Agent: Post-Install Setup

Build the ZeroExport Ask Agent in Agentforce Studio: welcome message, grounding instructions, the Document Q&A subagent, the three actions, and a grounded test - in about fifteen minutes.

Installing the package puts the actions in your org. It does not put them in front of a user. The steps below build the agent that uses them.

Budget about fifteen minutes. Complete installation first.

Prefer to watch? ZeroExport Ask Agent: full setup walkthrough covers every step on this page, in the same order.

0. Install the package

Install ZeroExport Ask Agent into your target org from the link you received. See Install ZeroExport Ask Agent for prerequisites and what to verify after install.

1. Create the agent

Go to Agentforce Studio and click New Agent. Select the template Agentforce Employee Agent.

Choose the employee template rather than a Service Agent: the document action needs the current record context, which exists for an in-app agent, and Service Agents carry separate licensing.

2. Name it

Agent name: ZeroExport Ask Agent. Click Go.

3. Set the welcome message

Open System Messages and replace the welcome message with:

Hi - I'm the ZeroExport Ask Agent. I can list the documents attached to this record, answer questions from any Word document among them, and explain how I work. Everything I say comes from the document itself, cited by section - and nothing leaves your org to make that happen.
Try: "Which documents are attached to this record?"

This is functional configuration, not decoration. The stock message invites an open-ended first question, which a general-purpose subagent will claim. Users mirror the phrasing they are shown, and the sample question above is enough to route turn one correctly.

4. Set the agent instructions

Open Agent Instructions. The template ships a context block; you are wrapping it.

Paste this before the context block:

You are a document assistant. You answer questions about documents attached to Salesforce records by calling a document action and using only what it returns.
The user's current context is:

Paste this after the context block:

Choosing an action:
- When the user asks what is attached, or you need to know what is available, list the attached documents.
- When the user asks anything about a document's contents, read the document.
- When the user asks what you can do, what formats you read, or how you work, read the ZeroExport Ask Agent documentation.

Grounding rules, which override every other consideration:
- Answer only from context returned by a document action in the current conversation. That context is the entire document as far as you are concerned.
- Call the read action on every turn, including follow-up questions. Do not answer from context returned earlier in the conversation.
- If the answer is not in the retrieved context, say plainly that you could not find it in the document, name the document you searched, and offer to answer a different question about it.
- Never answer from general knowledge, training data, prior conversations, or inference. Do not guess, estimate, interpolate, or reason toward a value that is not written in the retrieved text.
- Never state a number, date, name, or obligation that does not appear verbatim in the retrieved context.
- Do not give legal advice or interpret what a clause means beyond restating it.

Presentation:
- The context is Markdown. Headings are lines beginning with #, ## or ###, and everything below a heading belongs to it.
- Cite the nearest heading above the fact you used, for example (Section: 2. Targets). If the document has no headings, cite it by name.
- Never invent a citation. If you cannot identify the heading a fact came from, cite the document name instead.
- Reproduce Markdown tables from the context as tables, not prose.
- Never display the raw retrieved context to the user. Summarize and quote it.

Handling the status an action returns:
- SUCCESS: answer the question from the context.
- NEEDS_SELECTION: several documents match. Ask the user which one, listing exactly the names given. Do not answer the question until they choose.
- NO_RECORD_CONTEXT: you are not open on a record. Tell the user to open the record the document is attached to and ask again from there, or to name the file directly.
- NOT_FOUND: tell the user what the notice says, including which formats can be read. Do not suggest the document exists.
- ERROR: tell the user the document could not be read, and why if the notice says. Do not answer from memory, and do not escalate to a human as a substitute for reading the document.

The grounding rules are the part that decides whether the agent stays honest. If it ever answers from general knowledge, this block is what to tighten - not the action payload.

5. Delete the General FAQ subagent

In the Subagents section of the left sidebar, remove the General FAQ subagent.

It carries an answer-from-knowledge action that requires a Data Cloud data library. Left in place without one, it claims questions and fails. This is the single most common setup problem.

6. Create the Document Q&A subagent

Click the + icon next to the Subagents section in the left sidebar, then select + New Subagent.

  • Name: ZeroExport Document Q&A
  • Description:
The user is asking about the content of a document attached to a record - a contract, agreement, SLA, policy, statement of work, or similar - including its terms, obligations, targets, tables, dates, or penalties.

The router matches on this description, so it needs the vocabulary your users actually open with, not just the word "document". Extend it for your org: severity, resolution target, escalation, uptime, service credit and support window for a support org; clause, renewal, notice period, liability and payment terms for sales or legal.

7. Add the three actions

Click the + icon on the ZeroExport Document Q&A subagent in the left sidebar and select Add from Asset Library.

Search for zeroexport. Three actions appear. Select all three:

ActionWhat it does
ZeroExport Ask Agent Help DocumentAnswers questions about Ask Agent itself
ZeroExport List Attached DocumentsLists what is attached, and what can be read
ZeroExport Read Attached DocumentAnswers a question from a document attached to the record

Click Add to Agent.

8. Delete the unused variables

Go to Variables in the left sidebar and delete these five:

  • EndUserId
  • RoutableId
  • ContactId
  • EndUserLanguage
  • ChannelType

They are messaging context variables linked to MessagingSession and MessagingEndUser. An in-app agent does not use them.

9. Save and test

  1. Save the agent and open the Preview tab.
  2. Open context variables and set currentRecordId to a sample record Id. Use a record that has a .docx file attached.
  3. Ask a question about the document.

Work through these five. The last two matter most.

AskExpected
"Which documents are attached to this record?"A list of attached files, marking which can be read
A question the document clearly answersA correct answer, citing the section and naming the document
"Show me the full table for X"The table reproduced as a table, not flattened into prose
A question the document does not coverIt declines, and names the document it searched
A general-knowledge question, for example a public company's stock priceIt refuses and restates its scope

Test the first question as the first message of a brand new session. A pass on turn one is the bar. A pass only after a nudge means routing is still wrong, and steps 3 and 5 are why.

Adding a subagent or an action to an already-active agent does not reach the preview until the agent is republished and you start a new preview session.

10. Activate and deploy

Activate the agent and deploy it where your users work.

Then grant access. Go to Setup -> Permission Sets, open ZeroExport Ask User, and click Manage Assignments -> Add Assignment. Assign it to:

  • The users who will ask questions. The agent reads as the user who asked, so each person needs the assignment themselves.
  • The agent user. Whichever user the agent runs as. Without this, the agent cannot execute the Apex and every question fails with an access error.

The permission set grants Apex class access only. It does not widen access to any document. Existing sharing rules still decide who can read which file.

Troubleshooting

Every question fails with an access error. The agent user is missing the ZeroExport Ask User permission set. Step 10.

"We couldn't find a data library assigned to this agent." The General FAQ subagent claimed the question. Delete it. Step 5.

The first question of a session goes to the wrong place, later ones work. The welcome message and the General FAQ subagent. Steps 3 and 5.

The agent answers from general knowledge. The grounding rules in the agent instructions are missing or truncated. Step 4.

The agent says a document appears to be empty. The file is most likely a scan or an image-only PDF, which contains no text to extract. It is reporting honestly rather than guessing.

The agent cannot see a document you can see. Confirm the file is attached to the record itself, and that the format is .docx. PDF is not supported yet.

The raw document text appears in the conversation. The grounding output on the read action is set to show in conversation. Turn it off, and confirm the "Never display the raw retrieved context" rule is present in step 4.