Conversational Search and Third-Party Service Integration: Architecture and Technical Practices
As search converges with conversational AI, the way users obtain information is shifting from "type keywords, click links" to "express intent, complete tasks." External services such as shopping, personal finance, tax, and local services are no longer merely displayed on results pages; a conversational system can recognize, invoke, confirm, and return results for them. This change reflects search evolving from an information retrieval tool into an entry point for task execution. Drawing on architecture, service integration, security and compliance, engineering governance, and user experience, this article explains how conversational search can reliably connect to third-party services, covering layered architecture design, typical task flows, key integration principles, security and privacy requirements, and paths from pilot to scale.
1. Background: From Finding Content to Completing Tasks
Traditional search mainly solves information discovery. Users enter keywords, and the system returns web pages, images, videos, or structured cards. In everyday life, however, users often want to accomplish a complete action rather than simply view information. For example, a user might want to compile a shopping list and compare prices, check their personal credit standing, estimate taxes owed, or find a local repair technician. If the system can only return links, users still have to move between multiple applications to register, authorize, and fill in forms.
This is why conversational search needs the ability to invoke external services. It must understand user intent, decide whether to connect to a service provider, and—with the user’s authorization and confirmation—carry out actions such as querying, placing orders, comparing prices, making appointments, and completing forms. These capabilities are often called “task-oriented search,” “service-based search,” or “agent invocation.” The core of this capability is not merely the model’s answer, but the orchestration, execution, and risk control of external services.
2. Overall Architecture: Conversational Entry, Service Orchestration, and Security Boundaries
A production-ready conversational search system that integrates third-party services can typically be split into several layers. Different teams prioritize different areas, but the underlying logic is similar.
2.1 User Interaction Layer
Users initiate requests through a search box, voice input, a chat interface, or smart devices. This layer collects user input, including natural language, speech transcriptions, image uploads, and existing conversation context. To improve task completion rates, the interaction layer also needs to support clarifying questions, such as confirming an amount range, confirming a service location, or confirming a delivery address.
2.2 Intent Understanding and Task Planning Layer
This layer identifies the type of task a user wants to complete and determines whether an external service needs to be connected. For example:
- “Help me make a shopping list for a weekend gathering” is recognized as shopping and list preparation;
- “I want to understand my personal credit standing” is recognized as a financial information query;
- “Estimate my annual tax burden” is recognized as a tax calculation service.
Intent recognition cannot rely on keywords alone; it must combine context, user history, the current session state, and service availability. The system can then generate a structured task plan, such as “first compile the list, then call retailer services to compare prices, and finally move to a confirmation page.”
2.3 Service Catalog and Adaptation Layer
Third-party services need a unified way to register and expose their capabilities. The system maintains a service catalog that describes what each service can do, what inputs it requires, what results it returns, whether it needs user authorization, and whether it involves payment or sensitive data.
The adaptation layer converts the interfaces of different service providers into a unified invocation model. This prevents the conversational system from depending directly on the details of any single service. The adaptation layer typically handles protocol conversion, parameter validation, timeout control, retry strategies, error code mapping, and result normalization.
2.4 Agent Execution Layer
The agent is the core component that connects user intent to external services. It interprets the task, selects a service, invokes the interface, evaluates the result, and decides the next action. For simple queries, the agent can return results directly. For operations involving orders, payments, or information submission, the agent usually needs to pause execution and wait for user confirmation.
2.5 Account Authorization and Identity Management Layer
Many services require a login state. For instance, checking credit standing requires binding a financial identity, completing a purchase checkout requires account information, and booking a local service requires contact details. The system must support secure authorization, least privilege, revocable authorization, and transparent disclosure. It must not collect information unrelated to the task simply to complete that task.
2.6 Security, Risk Control, and Compliance Audit Layer
When scenarios involve transactions, finance, tax, or personal information, security and risk control become critical. The system needs anomaly detection, permission checks, data masking, operation logging, manual review, and rollback mechanisms. For actions related to funds, contracts, medical data, or identity, a higher level of confirmation and auditing must be established.
3. Typical Business Flows: Shopping, Personal Finance, and Tax
3.1 Shopping and Purchase List Scenarios
Suppose a user says: “Help me compile a shopping list for the family this weekend and try to stay within budget.” The system can first recognize this as a shopping intent and extract entity information such as product categories, quantities, budget, brand preferences, and location preferences.
The system can then call multiple retailer services to aggregate products. The conversational system does not need to maintain a complete product catalog on its own; it accesses external services through the adaptation layer. After the external services return data such as product lists, stock, prices, and delivery times, the agent sorts and summarizes the results.
A simplified task structure might look like this:
{"session_id": "session_10086","intent": "shopping_list","entities": {"items": ["fruit", "beverages", "cleaning supplies"],"budget": {"min": 200,"max": 350},"location_hint": "local home delivery"},"risk_level": "low"}
If the user ultimately wants to place an order, the system must not complete the payment automatically, but instead return a confirmation card:
{"status": "need_user_confirmation","card": {"title": "Shopping Plan to Confirm","summary": "8 items in total, estimated total CNY 298, expected delivery tomorrow","actions": ["Confirm order", "Edit list", "Cancel task"]}}
This approach separates “generating suggestions” from “completing transactions,” reducing the risk of accidental operations.
3.2 Personal Finance and Credit Query Scenarios
Personal finance and credit queries place higher demands on identity verification. A user might ask: “I want to view my personal credit score” or “Are there any low-interest loan options suitable for me?” The system needs to first determine the service type, then prompt the user to complete the necessary authorization. Without authorization, the system should not directly display sensitive financial data.
A general flow could be:
- Identify the financial query intent;
- Show the scope of information that requires authorization;
- The user confirms the authorization;
- Call the external financial service;
- Return masked results;
- Guide the user to their next choice.
For loan recommendation scenarios, the system should also avoid misleading statements. It must not infer from the model alone that a user “qualifies”; instead, it should rely on the real approval results returned by the service provider. For key fields such as interest rates, credit limits, and terms, the source and last-updated time must be stated clearly.
3.3 Tax Estimation Scenarios
Tax estimation usually involves complex factors such as income, deductions, and regional rules. The system can first guide users to enter structured information—for example, income sources, family member details, and deduction items—then call a tax service for estimation. Because tax rules are regional and time-sensitive, the system should emphasize that the result is only an estimate and should provide an entry point to official channels.
The difficulty in these scenarios lies in explainability. Users care not only about “roughly how much I need to pay,” but also about “why the result is what it is.” Therefore, the returned result should ideally include an explanation of key factors, such as the applicable tax rate, deductions, and factors not taken into account.
4. Key Design Principles for Service Integration
4.1 Capability Registration Must Be Describable and Discoverable
Before a third-party service is integrated, it needs to describe its own capabilities in a standardized way. The description typically includes the service name, applicable scenarios, input parameters, output results, dependencies, permission requirements, billing notes, and constraints. This allows the conversational system to select the correct service in the appropriate scenario rather than invoking it blindly.
A simplified service description can be represented as:
{"service_id": "retail_provider_01","category": "shopping","capabilities": ["search_items","add_to_cart","checkout_preview"],"required_scopes": ["basic_profile","delivery_address"],"payment_required": true,"human_confirmation": true}
With this description, the system can clearly determine whether a service requires user authorization, whether it involves payment, and which actions must be confirmed by the user.
4.2 Tool Invocation Must Support Idempotency and Rollback
External service calls do not always succeed. Network timeouts, service rate limiting, inventory changes, and payment failures can all occur. Therefore, when an agent invokes an interface, it must consider idempotency. For example, after a user clicks “Confirm order,” even if the network retries, it must not generate duplicate orders.
Common engineering practices include:
- Generating a unique request ID for each task;
- Adding a status query interface for key actions;
- Providing a compensation flow for failed tasks;
- Adding a second confirmation for irreversible operations;
- Retaining audit records for actions such as orders, appointments, and payments.
4.3 Results Must Be Returned in Structured Form
Agent output should not be limited to natural language descriptions. To support subsequent operations, card rendering, user confirmation, and log auditing, results should contain structured fields. For example:
{"status": "success","summary": "Your shopping list has been generated","items": [{"name": "fruit","quantity": 2,"estimated_price": 78},{"name": "cleaning supplies","quantity": 1,"estimated_price": 55}],"total_amount": 133,"currency": "CNY","next_actions": ["Edit quantity", "Replace item", "Confirm order"]}
Structured results are beneficial for rendering by the upper-layer interface and make it easier to analyze task completion rates and error distribution later.
5. Security, Privacy, and Compliance: Design Must Come First
5.1 Least Privilege Principle
When a conversational system connects to third-party services, it is easy to collect excessive information in the pursuit of a smooth experience. For example, to recommend a nearby repair technician, only the user’s city or approximate area is needed; a precise address should not be requested unnecessarily. To generate a shopping list, the system should not collect a user’s entire purchase history by default. The system must follow the least privilege principle and only request data necessary to complete the current task.
5.2 Sensitive Actions Must Require Explicit Confirmation
For actions involving payment, loan applications, tax filing, contract signing, or on-site appointments, the system must not make the final decision on the user’s behalf. The agent can offer suggestions, fill in forms, and present options, but key actions must be actively confirmed by the user.
It is recommended to set different risk levels:
- Low risk: queries, price comparison, information aggregation;
- Medium risk: adding to cart, saving preferences, generating an order pending confirmation;
- High risk: payment, submitting identity materials, applying for loans, booking paid services.
The higher the risk, the stricter the confirmation mechanism.
5.3 Prevent Prompt Injection and Unauthorized Invocation
When the system reads web pages, emails, user-uploaded documents, or content returned by external services, that content may contain misleading instructions. For example, some text might try to induce the agent to transfer funds, leak information, or ignore user confirmation. Therefore, all external content should be treated as untrusted input and should not inherently have the authority to control the agent.
Multiple layers of protection can be adopted in engineering:
- Isolate and label external text;
- Limit the range of tools the agent can call;
- Require manual confirmation for high-privilege actions;
- Filter sensitive information from output content;
- Intercept and log abnormal instructions.
5.4 Data Masking and Audit Trails
For information such as financial, tax, and personal identity data, the system needs to apply masking in display, storage, and logs. Logs should not record complete sensitive fields such as full ID numbers, bank card numbers, or detailed addresses. At the same time, key operations need to retain audit records to support troubleshooting and compliance review.
Audit records should include at least:
- The task type initiated by the user;
- The authorization scope and authorization time;
- The service provider that was called;
- A summary of request parameters;
- The returned status;
- The user’s confirmation action;
- Anomalies and compensation results.
6. Engineering Implementation: From Pilot to Scale
6.1 Start with a Low-Risk Scenario Pilot
When integrating third-party services, it is not advisable to cover high-risk scenarios from the start. It is better to begin with low-risk, explainable, and easily verifiable tasks, such as compiling product lists, comparing prices, querying business hours, and displaying service catalogs. Once the flow is stable, more complex scenarios such as payment, financial queries, and tax estimation can be integrated gradually.
6.2 Establish a Unified Gradual Rollout and Rollback Mechanism
Each service integration should support a canary release. The system can first open access to a small percentage of users and observe invocation success rate, confirmation rate, complaint rate, and anomaly rate. If a service provider returns abnormal data, if the authorization flow stalls, or if the task failure rate is too high, the system can quickly take the service offline or degrade it.
6.3 Drive Optimization with Monitoring and Metrics
Conversational services should not focus only on the quality of model responses, but also on the quality of task completion. It is recommended to establish multi-dimensional metrics:
- Intent recognition accuracy;
- Service invocation success rate;
- User authorization completion rate;
- Task confirmation conversion rate;
- Average completion time;
- Abnormal interruption rate;
- User feedback rate;
- Sensitive operation interception rate.
When deploying in the cloud, general cloud capabilities can be combined to achieve stable governance. For example, container platforms can host agent services, message queues can handle asynchronous tasks, object storage can store non-sensitive files, logging services can record the invocation chain, and monitoring and alerting can detect service anomalies. This improves system observability and stability without changing the business logic.
6.4 Design Graceful Degradation Paths
When an external service is unavailable, the system should clearly inform the user rather than generate false results. For example, it can prompt “The service is currently unavailable, but your task progress has been preserved,” or switch to another alternative service. If a user has already authorized an action but the invocation fails, the system should support a later retry rather than requiring the user to input information again.
7. Experience Design: Help Users Understand What the System Is Doing
The key to a task-oriented search experience is letting users clearly know what the system is executing, what authorization is required, and what consequences will result.
7.1 Show Clear Action Boundaries
For example, what users see should not be a vague “processing,” but rather:
- “Comparing delivery options across different service providers for you”;
- “Please confirm the delivery address before continuing”;
- “This action will create an order but will not make an automatic payment.”
7.2 Provide Explainable Suggestions
When the system recommends products, loan options, or tax estimation results, it should explain the basis. For example, the basis for price ranking, rating scores, or time estimates. Explainability not only improves trust but also reduces user misjudgment.
7.3 Support Exiting and Editing at Any Time
Users should be able to cancel a task, revoke authorization, modify input, or go back to a previous step at any time. The agent should not lock users into a fixed flow. For long tasks, it can save progress and allow users to continue later.
8. Conclusion
Integrating third-party services such as shopping, personal finance, and tax into conversational search is, in essence, upgrading search from an “information entry point” to a “task entry point.” The difficulty of such systems lies not only in calling external interfaces, but in striking a balance among intent understanding, service orchestration, identity authorization, risk control, compliance auditing, and user experience.
From a technical perspective, the key paths include unified service registration, agent task planning, structured result returns, least-privilege authorization, sensitive action confirmation, idempotent invocation, failure degradation, and end-to-end monitoring. Only by establishing mature mechanisms at each of these stages can conversational search truly help users efficiently complete complex tasks while ensuring security and compliance.
