Service / AgentForce
[Agentforce] Answer Questions with Knowledge action is slow because the first GenAiPromptTemplate query takes longer time.
Summary
When you create an agent that uses the Answer Questions with Knowledge (AQwK) action, you would observe that the agent can take more than 10 seconds per answer. The first GenAiPromptTemplate query takes longer than expected.
Actual: In an affected sandbox, an agent that uses the Answer Questions with Knowledge (AQwK) action takes 12–19 s per answer. The prepareTemplate step (a GenAiPromptTemplate SOQL query) takes 3.2–4.5 s on every call, and 12–19 s on some calls. Other orgs on the same pod take about 73–89 ms.
Expected: Template lookup takes about 100 ms, so the action takes roughly the retrieval time (about 1–2 s) plus LLM time.
Data 360 retrieval is not the cause (about 0.8–1.9 s). The root cause is under investigation by Engineering.
Workaround
Use a retriever action instead of AQwK, with a small retriever output (a few results, only the needed fields). It skips the template lookup. In testing, response time was 5.8–10 s (median 7 s) against 12–19 s with AQwK. Retriever actions are Beta and need an Agentforce Data Library. Shorter answer instructions can also help.
Steps to reproduce
Steps to replicate:
- Create an agent with the Answer Questions with Knowledge (AQwK) action.
- Start a session with the agent.
- Observe that the agent takes a significant amount of time to respond (for example, 12s to 19s).
History
Description updated
Nov 30, 2026
First tracked here as In Review
Nov 30, 2026