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.
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. |
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.
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:
- Experience Layer: Human interaction via Slack, Email, and CRM (Salesforce/Planhat).
- Agent Layer (LangGraph): The runtime brain. Handles branching, loops, and "Human-in-the-loop" gates.
- 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]
- 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.
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
We treat the agent as a product. Every run is traced in LangSmith to ensure reliability.
- Handoff Audit Accuracy: Did the agent correctly identify missing contract fields?
- Risk hallucination: Did the agent flag a risk that didn't exist? (Regression testing).
- Draft Safety: Ensures no email drafts contain unauthorized pricing commitments.
- Clone the repo: git clone https://github.com/ValueInMotion/value-in-motion-agent.git
- Install dependencies: pip install -r requirements.txt
- Configure environment variables (API Keys for Anthropic/OpenAI, LangSmith, CRM): cp .env.example .env
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).
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.
