> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wayak.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Customer history lookup

> Consolidate a customer's interactions, open tickets, and account details into a single profile

When a customer contacts support, the agent handling the case needs context fast. But that context is scattered across systems — the CRM has account details, the helpdesk has ticket history, the billing system has invoices, and the email system has recent correspondence. Switching between tabs to piece together a customer profile wastes time and leads to missed details that frustrate the customer ("I already explained this to someone last week").

This use case creates an agent that resolves a customer's identity across your data sources and presents a unified profile in seconds. Ask "Tell me about customer Acme Corp" and you get their account tier, recent tickets, open issues, lifetime value, and any special agreements — all in one response.

***

## What you need

<CardGroup cols={2}>
  <Card title="Data sources" icon="database">
    * **CRM system** — Customer accounts, contacts, contract terms, and purchase history
    * **Helpdesk system** — Ticket history, interaction logs, CSAT scores, and SLA records
    * **Billing system** — Invoice history, payment status, and outstanding balances
  </Card>

  <Card title="Knowledge spaces" icon="book-open">
    * **Customer agreements** — Upload special terms, SLA amendments, and negotiated policies for key accounts
    * **Account management playbook** — Internal guidelines for handling VIP, enterprise, and at-risk accounts
  </Card>
</CardGroup>

**Semantic layer:** Define these in your ontology before setting up the agent.

| Component | Name                    | Definition                                                                                                |
| --------- | ----------------------- | --------------------------------------------------------------------------------------------------------- |
| Object    | Customer                | Maps to the CRM account table. Represents a customer entity with contact info, tier, and contract details |
| Object    | Interaction             | Maps to helpdesk interaction logs. Represents a single touchpoint: ticket, call, email, or chat           |
| Metric    | Lifetime Value          | Total revenue from a customer account across all invoices                                                 |
| Metric    | Average Resolution Time | Mean time to resolve tickets for a specific customer, in hours                                            |
| Dimension | Account Tier            | Segments customers as enterprise, business, or standard                                                   |
| Dimension | Channel                 | Categorizes interactions by channel: email, phone, chat, social                                           |

<Tip>
  See [building a semantic layer](/quickstart/build-semantic-layer) for a step-by-step guide.
</Tip>

***

## Agent setup

<Steps>
  <Step title="Create the agent">
    Go to **Agent Space** > **New agent**.

    | Field    | Value                                                              |
    | -------- | ------------------------------------------------------------------ |
    | **Name** | Customer Context Agent                                             |
    | **Role** | Customer intelligence specialist                                   |
    | **Goal** | Provide instant, comprehensive customer profiles to support agents |
  </Step>

  <Step title="Set the description">
    > You provide instant customer profiles to support agents. When asked about a customer, start with the account basics (tier, contract status, lifetime value), then list open tickets and recent interactions. Highlight anything unusual: recent escalations, overdue invoices, or expiring contracts. If the customer has a special agreement in the knowledge space, mention it prominently. Keep the profile concise but complete — the goal is to give the support agent everything they need in one view without requiring follow-up questions.
  </Step>

  <Step title="Scope data access">
    Grant access to:

    * CRM system data source (accounts, contacts, contracts)
    * Helpdesk system data source (tickets and interactions)
    * Billing system data source (invoices and payments)
    * Customer agreements knowledge space
    * Account management playbook knowledge space
    * Customer and Interaction objects in the semantic layer
  </Step>

  <Step title="Add skills">
    <AccordionGroup>
      <Accordion title="Summarize customer history">
        **Trigger:** User asks about a specific customer or before handling a ticket

        1. Look up the customer by name, email, or account ID across CRM, helpdesk, and billing systems.
        2. Pull account details: tier, contract status, account manager, and lifetime value.
        3. Retrieve the last 10 interactions from the helpdesk (tickets, calls, emails).
        4. Summarize: total tickets, open tickets, average resolution time, and most common issue type.
        5. Note any VIP status, special agreements from the knowledge space, or past escalations.
        6. Check for overdue invoices or expiring contracts that might affect the current interaction.
        7. Present as a brief profile with a timeline of recent interactions.
      </Accordion>

      <Accordion title="Compare customer to segment">
        **Trigger:** User asks how a customer compares to others or whether their experience is typical

        1. Identify the customer's account tier and segment.
        2. Pull aggregate metrics for that segment: average ticket volume, average resolution time, average CSAT.
        3. Compare the individual customer's metrics against the segment averages.
        4. Highlight any metric where the customer is more than one standard deviation from the average.
        5. Present a comparison table with the customer's numbers alongside segment benchmarks.
      </Accordion>
    </AccordionGroup>
  </Step>
</Steps>

***

## Automation

### Playbook: Pre-populate ticket context

<Steps>
  <Step title="Set the trigger">
    Set the playbook to trigger when a ticket is assigned to an agent.
  </Step>

  <Step title="Build the workflow">
    The playbook automatically pulls the customer profile and attaches it to the ticket as an internal note, so the agent has context before they even open the conversation.

    1. **Query step** — Pull the customer email from the ticket and look them up in the CRM.
    2. **Query step** — Pull the customer's last 5 tickets and their outcomes from the helpdesk.
    3. **Query step** — Check for overdue invoices or expiring contracts in the billing system.
    4. **Format step** — Compile a concise customer profile: account tier, lifetime value, open issues, recent interactions, and any flags.
    5. **Action step** — Post the profile as an internal note on the ticket.
  </Step>

  <Step title="Configure delivery">
    The profile is posted directly to the ticket as an internal note. No additional delivery channel is needed.
  </Step>

  <Step title="Test and activate">
    Click **Run now** to test with live data, then toggle to **Active**.
  </Step>
</Steps>

***

## What's next

<CardGroup cols={2}>
  <Card title="Escalation pattern analysis" icon="arrow-right" href="/use-cases/customer-service/escalation-pattern-analysis">
    Identify systemic issues driving repeated escalations and recommend fixes.
  </Card>

  <Card title="All customer service use cases" icon="list" href="/use-cases/customer-service">
    See the full list.
  </Card>
</CardGroup>
