Skip to content

An agentic Customer Success auditor that identifies Lean waste (Muda, Mura, Muri) and automates strategic account health reviews

Notifications You must be signed in to change notification settings

ValueInMotion/value-in-motion-agent

Repository files navigation

Value-in-Motion™: The Agentic Customer Success Operating System

Build Status Platform Framework Orchestration Observability License

I. High-Level Vision (The "Why")

1. Value-in-Motion™: The Agentic Customer Success Operating System

Value-in-Motion™ is an event-driven, autonomous architecture that transforms Customer Success from a reactive support function into a scalable revenue engine.

Unlike traditional "human-in-the-loop" automation (which simply fires linear tasks), this system utilizes Autonomous Agentic Orchestration (Stateful Graphs). It maintains the "state" of every customer account, actively reasoning through risks, gating progress based on data readiness, and looping until success criteria are met.


2. The Philosophy: Lean Customer Success Flow of Work

We apply Lean Principles to SaaS telemetry to identify "waste" (Muda) before it becomes churn.

Lean Principle In SaaS Terms The Agentic Response
Muda (Waste) Paying for unused licenses or features. Auto-Audit: Agent identifies shelfware and drafts a "License Optimization Plan" to save the renewal.
Mura (Inconsistency) Erratic login patterns or "spiky" adoption. Auto-Nudge: Agent detects usage gaps and triggers targeted training workflows.
Muri (Overburden) High volume of support tickets/complaints. Auto-Escalate: Agent correlates ticket spikes with renewal dates and alerts the Director of CS.

II. Domain Logic (The "Map")

3. Customer Success Management Lifecycle

The agent operates against a strict map of the customer journey. It does not "hallucinate" random actions; it executes the specific requirements of each phase defined in the state machine.

Value in Motion™ CSM Agent

The Autonomous Customer Success Engine

Value in Motion™ CSM Autonomous Agent

https://github.com/ValueInMotion/value-in-motion-agent/blob/main/Value%20in%20Motion%E2%84%A2%20CSM%20Autonomous%20Agent.png

III. Technical Architecture (The "Engine")

4. Customer Success Stateful Orchestration

This system moves beyond simple "Trigger -> Action" automation. It uses LangGraph to implement a State Machine. The agent has a "Long-Term Memory" (State) for each account and persists context across days or weeks.

Architecture Layers:

  1. Experience Layer: Human interaction via Slack, Email, and CRM (Salesforce/Planhat).
  2. Agent Layer (LangGraph): The runtime brain. Handles branching, loops, and "Human-in-the-loop" gates.
  3. Engineering Layer (LangSmith): Control plane for tracing execution, debugging agent reasoning, and running regression tests.
flowchart TB
    subgraph Memory ["💾 Persistence Layer (Checkpointers)"]
        State["Account State<br/>(Phase, Risk Score, Missing Fields)"]
    end

    Start((Start)) --> Router{Phase Router}

    %% PHASE 1: TRANSITION
    Router -->|Phase 1| P1[Node: Handoff Audit]
    P1 --> G1{Gate: Data Ready?}
    G1 -- No --> L1[Loop: Fetch Missing Anchors]
    L1 --> P1
    G1 -- Yes --> P1_Exit[Update State: Ready for Phase 2]

    %% PHASE 2: DIAGNOSTIC
    P1_Exit --> P2[Node: Diagnostic Agent]
    P2 --> Q1[Task: Stakeholder Mapping]
    P2 --> Q2[Task: Pain Metric Check]
    Q1 & Q2 --> Risk{Risk Detected?}
    
    Risk -- Yes --> Escalate[Node: Draft Risk Mitigation Plan]
    Risk -- No --> CSP[Node: Draft Success Plan]

    %% PHASE 4: VELOCITY
    CSP --> P4[Node: Velocity Sensors]
    P4 --> S1[Check: TTV Metrics]
    P4 --> S2[Check: License Utilization]
    
    S1 & S2 --> NBA[Node: Next Best Action Queue]
    
    %% HUMAN INTERVENTION
    Escalate -.-> Human((👤 Human Approval))
    Human -->|Approve| Action[Execute Mitigation]
    Human -->|Reject| Replan[Re-Reason Strategy]
Loading

5. Tech Stack

  • Orchestration: LangGraph (Python) - Replaces rigid n8n workflows with cyclic graphs.
  • LLM: Claude 3.5 Sonnet / GPT-4o - Powered by LangChain.
  • Observability: LangSmith - For tracing agent thought processes and calculating token costs per account.
  • Data Source: Salesforce / Planhat / Snowflake.

IV. Repository Structure

The repository is structured to support enterprise-grade software engineering practices (Unit Testing, Evals, CI/CD).

value-in-motion-agent/
├── src/
│   ├── graph/
│   │   ├── __init__.py
│   │   ├── state.py           # Defines the AccountState (TypedDict)
│   │   ├── nodes.py           # Core logic (Audit Node, Diagnostic Node)
│   │   ├── edges.py           # Conditional logic (Gates and Routers)
│   │   └── compiled_graph.py  # The LangGraph entry point
│   ├── tools/
│   │   ├── crm_tools.py       # Salesforce/HubSpot connectors
│   │   ├── email_tools.py     # Draft generation
│   │   └── data_tools.py      # Telemetry analysis (Pandas/SQL)
│   └── prompts/
│       ├── auditor_prompt.yaml
│       └── strategist_prompt.yaml
├── tests/
│   ├── unit/                  # Function tests
│   └── integration/           # Full graph run tests
├── docs/
│   ├── architecture.mmd
│   └── setup_guide.md
├── requirements.txt
└── .env.example

V. Observability & Evals (LangSmith)

We treat the agent as a product. Every run is traced in LangSmith to ensure reliability.

Key Metrics Monitored:

  1. Handoff Audit Accuracy: Did the agent correctly identify missing contract fields?
  2. Risk hallucination: Did the agent flag a risk that didn't exist? (Regression testing).
  3. Draft Safety: Ensures no email drafts contain unauthorized pricing commitments.

VI. Getting Started

Installation

  1. Clone the repo: git clone https://github.com/ValueInMotion/value-in-motion-agent.git
  2. Install dependencies: pip install -r requirements.txt
  3. Configure environment variables (API Keys for Anthropic/OpenAI, LangSmith, CRM): cp .env.example .env

VII. Proof of Concept & Use Cases

6. Value-in-Motion-Agent (The Auditor)

An agentic Customer Success auditor that identifies Lean waste (Muda, Mura, Muri) and automates strategic account health reviews.

The Core Problem

Traditional CS health scores are often static and reactive. This framework applies Lean principles (Muda, Mura, Muri) to telemetry data to identify hidden churn risks and expansion opportunities before they hit the dashboard.

Technical Execution

  • Workflow Engine: LangGraph (Stateful Python Orchestrator).
  • Intelligence Layer: Claude 3.5 Sonnet (Reasoning & Narrative Generation).
  • Integrations: Google Sheets / Snowflake (Data Source) and Gmail/Slack (Reporting).

7. Real-World Impact: The "Agentic Audit"

In a recent deployment, the Value-in-Motion agent identified 75% Unused Capacity (Muda) for a Tier-1 account.

  • Calculated Waste: ~$45,000/year/CSM.
  • Outcome: The agent automatically drafted a "Value Realization Roadmap," allowing the CSM to pivot the conversation from a "downsell risk" to a "re-deployment strategy" 6 months before the renewal date.

Releases

No releases published

Packages

No packages published