How mudavathkalyan/customer-action-agent works
Customer Action Agent accepts customer support messages, extracts structured ticket data, validates and classifies the requested action, then executes it or pauses for manager approval. The graph owns the workflow and keeps resumable state in an in-memory checkpointer. The sampled source establishes the API, agent nodes, routing, and LLM client; the gateway node is supported by the configured base URL and the LiteLLM config path, but its runtime implementation was not sampled.
Main entry points: graph.py Workflow graph · tickets.py Ticket endpoints · extraction.py Ticket extraction · approval.py Manager approval
Components 17
API
- FastAPI app
app/main.py - Ticket endpoints
app/api/tickets.py
Agent workflow
- Workflow graph
app/agent/graph.py - Ticket extraction
app/agent/nodes/extraction.py - Ticket validation
app/agent/nodes/validation.py - Validation routing
app/agent/routing.py - Risk assessment
app/agent/nodes/risk.py - Action routing
app/agent/action_router.py - Manager approval
app/agent/nodes/approval.py - Action execution
app/agent/nodes/execution.py - Agent state
app/agent/state.py
Ticket domain
- Ticket schema
app/models/ticket.py
LLM and state
- Structured LLM client
app/services/llm.py - LiteLLM gateway
litellm/config.yaml - Memory checkpoint
app/agent/graph.py
Other components
- Customer
- Manager
Connections 30
- Customer → Ticket endpoints: submits message
- FastAPI app → Ticket endpoints: mounts routes
- Ticket endpoints → Workflow graph: invokes or resumes
- Workflow graph → Ticket endpoints: returns state
- Ticket endpoints → Memory checkpoint: reads snapshot
- Workflow graph → Memory checkpoint: saves workflow state
- Workflow graph → Ticket extraction: dispatches
- Workflow graph → Ticket validation: dispatches
- Workflow graph → Validation routing: checks route
- Workflow graph → Risk assessment: dispatches
- Workflow graph → Action routing: checks route
- Workflow graph → Manager approval: dispatches
- Workflow graph → Action execution: dispatches
- Ticket extraction → Structured LLM client: requests extraction
- Structured LLM client → LiteLLM gateway: sends completion request
- Structured LLM client → Ticket schema: structures output
- Ticket extraction → Workflow graph: returns ticket data
- Ticket validation → Validation routing: provides errors
- Validation routing → Workflow graph: selects retry, risk, or stop
- Risk assessment → Action routing: provides risk flag
- Action routing → Workflow graph: selects approval or execution
- Workflow graph → Ticket extraction: retries on validation error
- Workflow graph → Risk assessment: continues when valid
- Workflow graph → Manager approval: routes high-risk action
- Workflow graph → Action execution: routes ordinary action
- Manager approval → Manager: interrupts for decision
- Manager → Ticket endpoints: approves or rejects
- Action execution → Workflow graph: returns action result
- Manager approval → Workflow graph: returns decision result
- Ticket endpoints → Customer: returns status and state