Salesforce Decode
Salesforcedecode
Back to questions
AgentforceAdvancedperformancelatencycachingintegration

Optimize agent action latency for real-time chat experiences

Real World Scenario

Users abandon chats when Agentforce takes more than 8 seconds to respond after asking for order status. Order lookup hits three systems via MuleSoft.

Expected Answer

• Profile end-to-end latency: LLM reasoning, retrieval, and each action callout separately • Cache order summaries in Platform Cache or Data Cloud calculated insights with short TTL • Parallelize independent lookups using composite APIs or async aggregation patterns in Apex • Return progressive responses: acknowledge query, show typing indicator, stream partial status • Reduce action payload sizes—agents need summary fields, not full order line JSON • Set callout timeouts and circuit breakers with graceful degradation messages • Establish p95 latency SLOs per action with alerting in production

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Main difference: use case and scale. Profile end-to-end latency: LLM reasoning, retrieval, and each action callout separately. Cache order summaries in Platform Cache or Data Cloud calculated insights with short TTL. Pick based on your integration pattern and team capability. Users perceive agent intelligence through speed. Optimize for scale and operational observability.

Architect Perspective

Users perceive agent intelligence through speed. Architects must treat action backends as part of UX—optimize the critical path before tuning prompts. Progressive disclosure beats monolithic mega-responses.