Capstone Phase 1: Prototyping and Tool Schemas
Deconstructing the Customer Support Agent
To build a production-grade customer support agent, we must transition from generic text-completions to structured, safe database interactions and policy lookups. A Customer Support Agent requires two primary datastores:
- Transactional Data (SQL): Structured data containing customer accounts, transaction amounts, and order statuses. This must be accessed via precise queries.
- Policy Guidelines (RAG): Unstructured text containing rules regarding refund eligibility, restocking fees, and escalation parameters.
In this first phase of the capstone project, we establish the mock relational datastores, implement keyword-based search over policy documents, and define the structured JSON schemas that expose these functions as tools to the language model.
Datastore and Schema Architecture
The relationship between the agent, the tool-calling interface, and the underlying databases is shown below:
- SQLite Memory Database: Stores structured tables (
customers,orders, andrefunds). - Policy Vector Array: Stores policy text blocks.
- Schema Registry: Enforces signatures and maps natural language parameters to tool inputs.
Interactive Playground: Data Prototyping
The multi-turn tool calling sequence and execution flow of the prototyping playground is illustrated below:
The following playground establishes the relational tables in an in-memory SQLite database and registers a keyword-based policy lookup function. The model uses these tools to query transaction details and determine refund constraints for a customer.
In this prototyping phase, the agent successfully executes a multi-step verification process:
- It queries the database to retrieve order
101details (amount: $150.00, status: 'Delivered'). - It queries the policy store using the keyword "refund".
- It reads the policy rules, noting that refunds over $100 require manager approval.
- It synthesizes this data into a final response.
The next phase covers Orchestration and State Routing, where we structure this execution path into an explicit routing graph.