> ## 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.

# Attrition analysis

> Identify turnover patterns by team, tenure, and engagement signals and deliver monthly trend reports

Employee attrition is expensive — recruiting, onboarding, and lost productivity can cost 50-200% of an employee's annual salary. Most HR teams track attrition reactively, compiling spreadsheets after the fact. By the time a pattern is visible, the damage is done.

Wayak connects your HRIS data, runs Python-powered trend analysis in playbooks, and delivers monthly attrition reports with breakdowns by department, tenure band, job level, and manager. Your HR leadership team gets the signals they need to intervene early, backed by data instead of anecdotes.

***

## What you need

<CardGroup cols={2}>
  <Card title="Data sources" icon="database">
    * **HRIS database** — Employee records with hire date, termination date, department, job level, manager, compensation band, and exit reason
    * **Engagement survey database** — Survey responses with eNPS scores, satisfaction ratings, and open-ended feedback timestamps
    * **Performance review database** — Review scores and promotion history
  </Card>

  <Card title="Knowledge spaces" icon="book-open">
    * **Exit interview summaries** — Anonymized exit interview notes uploaded as documents for thematic analysis
    * **Retention playbooks** — Internal guides on retention strategies, stay interview templates, and compensation benchmarking references
  </Card>
</CardGroup>

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

| Component | Name            | Definition                                                                                                                                          |
| --------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| Object    | `Employee`      | Maps to the HRIS employees table. Represents a current or former employee with their full tenure and role history                                   |
| Metric    | `AttritionRate` | Annualized percentage: (terminations in period / average headcount) x 100                                                                           |
| Metric    | `AverageTenure` | Mean months of employment for terminated employees in the period                                                                                    |
| Dimension | `TenureBand`    | Categorization: 0-6 months, 6-12 months, 1-2 years, 2-5 years, 5+ years                                                                             |
| Dimension | `ExitReason`    | Categorization: voluntary-compensation, voluntary-growth, voluntary-relocation, voluntary-other, involuntary-performance, involuntary-restructuring |

<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** | People Analytics Agent                                                              |
    | **Role** | Workforce analytics and retention specialist                                        |
    | **Goal** | Identify attrition patterns early and provide data-driven retention recommendations |
  </Step>

  <Step title="Set the description">
    > You analyze workforce data to identify attrition trends and risk factors. Present findings with specific numbers — attrition rates, tenure distributions, and department comparisons. Avoid speculation; base every insight on data. When recommending interventions, reference industry benchmarks or internal retention playbooks. Use a neutral, analytical tone appropriate for leadership audiences. Always include period-over-period comparisons so trends are visible.
  </Step>

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

    * HRIS database (employees, terminations, departments, compensation bands)
    * Engagement survey database (eNPS scores, satisfaction ratings)
    * Performance review database (review scores, promotion history)
    * Exit interview summaries knowledge space
    * Retention playbooks knowledge space
    * `Employee` object, `AttritionRate` and `AverageTenure` metrics, `TenureBand` and `ExitReason` dimensions
  </Step>

  <Step title="Add skills">
    <AccordionGroup>
      <Accordion title="Analyze attrition by segment">
        **Trigger:** HR leader asks about attrition trends or monthly review

        1. Pull all terminations for the requested period from the HRIS.
        2. Calculate the attrition rate for each segment: department, tenure band, job level, and manager.
        3. Compare each segment's rate against the company average and the prior period.
        4. Identify the top 3 segments with the highest attrition and the top 3 with the largest increase.
        5. For each high-attrition segment, break down by exit reason.
        6. Search exit interview summaries for recurring themes in those segments.
        7. Present findings as a ranked table with rates, trends, and key themes.
      </Accordion>

      <Accordion title="Identify flight risk indicators">
        **Trigger:** HR leader requests a risk assessment

        1. Query the HRIS for all active employees.
        2. For each employee, gather: tenure, time since last promotion, latest engagement survey score, performance review trend, and compensation band relative to role midpoint.
        3. Flag employees with three or more risk indicators: low eNPS, no promotion in 2+ years, below-midpoint compensation, declining performance reviews.
        4. Group flagged employees by department and manager.
        5. Recommend targeted actions: stay interviews, compensation reviews, or development conversations.
      </Accordion>
    </AccordionGroup>
  </Step>
</Steps>

***

## Automation

### Playbook: Monthly attrition report

<Steps>
  <Step title="Set the trigger">
    Schedule: **First business day of each month at 9:00 AM**.
  </Step>

  <Step title="Build the workflow">
    1. **Query** the HRIS for all terminations in the previous calendar month and calculate the monthly attrition rate.
    2. **Query** the same data for the prior 12 months to build a trend line.
    3. **Run Python analysis** to calculate:
       * Month-over-month and year-over-year attrition rate changes.
       * Rolling 3-month average by department.
       * Tenure distribution of departures (median, mean, standard deviation).
       * Correlation between engagement survey scores and attrition by department.
    4. **Condition:** If any department's rolling 3-month attrition rate exceeds 20% annualized, flag it as "critical" and include a deep-dive section.
    5. **Query** exit interview summaries for the flagged departments and extract the top 3 themes.

    <Info>
      The **trend analysis** step uses a Python code block to compute rolling averages, standard deviations, and correlation coefficients. You can adjust the lookback window and the critical threshold in the code.
    </Info>
  </Step>

  <Step title="Configure delivery">
    Send an email to the HR leadership team and the CHRO with the subject line: "Monthly attrition report — \[Month Year]". Attach a formatted summary with charts. Post a condensed version to the `#people-analytics` Slack channel.
  </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="Policy Q&A" icon="arrow-right" href="/use-cases/hr/policy-qa">
    Pair attrition analysis with policy transparency — employees who understand their benefits are more likely to stay.
  </Card>

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