Building a Conversational Plugin
End-to-end reference architecture for a multi-step conversational plugin.
End-to-end reference architecture for a multi-step conversational plugin.
This guide walks through the full architecture of a realistic conversational plugin — from connector to testing. It’s not a step-by-step tutorial; it’s a reference architecture showing how every piece fits together.
The example: an Expense Report Manager that lets employees look up their pending expense reports, add a new expense line item to a report, and submit a report for approval — all through a single conversational plugin backed by SAP Concur.
The YAML and configurations here are pseudocode — realistic enough to teach the patterns, but not copy-pasteable into Agent Studio. Adapt them to your actual system’s API.
In practice, most of these components are configured through the Agent Studio UI — not written as code. We’re showing code representations here because it’s the clearest way to illustrate the full configuration in a document. When you build, you’ll fill in these same fields through the visual editor.
Here’s what you’re building and how the pieces connect:
Component count: 1 connector, 3 HTTP actions, 2 compound actions, 1 custom data type with dynamic resolver, 1 conversational process with 5 slots and 3 branches.
The connector is the authentication layer. Every HTTP action inherits from it.
One connector per system. If your Concur instance uses one set of credentials for all expense APIs, you need one connector. Only create a second if a different module requires different credentials.
Three actions, each doing one thing:
Used by the dynamic resolver to retrieve the user’s reports.
Response shape (what the API returns):
Adds a new line item to a report.
Changes the report’s workflow status to submitted.
This is what lets the user say “my March travel expenses” and have the system resolve it to a specific report object.
When the user says “my March expenses,” the resolver calls the HTTP action, gets back a list of reports, and presents them for the user to pick from. The selected report object (with all fields) is stored in the slot.
A data type can have multiple resolver strategies. For example, you could add a “search by report ID” resolver for users who say “report 764428.” The AI agent picks the best resolver based on context. See Resolver Strategies.
Compound actions keep intermediate data out of the Reasoning Engine’s context window. Only the return data goes back. This is why you use them instead of chaining action activities.
This is where you define the user-facing flow — what slots to collect, what actions to run, and what decisions to make.
After collecting expense_report and action_choice, a decision policy routes to the right branch:
Input and output mappers are configured on action activities — not on the plugin or the HTTP action. This is where you map slot values and metadata to your action’s input arguments. See Activities.
The plugin ties everything together with triggers and launch configuration.
For detailed testing guidance, see Testing & Error Handling.
Multiple systems: If you also need to sync expenses to an ERP, add a second connector and chain the ERP call inside the compound action after the Concur call.
Approval flow: To add manager approval before submission, use mw.create_generic_approval_request in the compound action. See Built-in Actions.
SDA for analytics: If users ask “how much did I spend this quarter?”, the report list response may be large enough to trigger Structured Data Analysis. Use friendly field names in your output mapper.