How garymapley/support-agent-workbench works
Support Agent Workbench is a support-case workbench backed by a FastAPI service and a LangGraph agent. The primary workflow authenticates an operator, runs the agent against order and policy tools, creates auditable tickets, pauses refund requests for human approval, then resumes the same conversation with the decision. Policy ingestion and run telemetry are meaningful supporting capabilities. Relationships use the README and SOURCE INDEX references; unsampled implementation details are not inferred.
Main entry points: api.py FastAPI routes · graph.py Agent graph · page.tsx Support workbench · workflow_repository.py Ticket and approval records
Components 27
Workbench
- Support workbench
web/app/page.tsx - Web sessions
web/lib/session.ts - Backend proxy
web/app/api/backend/[...path]/route.ts
Agent service
- FastAPI routes
app/api.py - Authorization
app/security.py - Agent graph
app/graph.py - Chat model
app/model.py - Order tools
app/tools/order_tools.py - Workflow tools
app/tools/workflow_tools.py - Approval flow
app/approval_workflow.py - Execution telemetry
app/telemetry.py
Policy knowledge
- Policy tools
app/tools/policy_tools.py - Policy ingestion
app/knowledge_ingestion.py - Document loader
app/knowledge_loader.py - Text embeddings
app/embeddings.py - Policy vector store
app/qdrant_store.py
Persistence and audit
- Order repository
app/order_repository.py - Ticket and approval records
app/workflow_repository.py - Business database
app/database.py - Database models
app/db_models.py - Conversation checkpoints
app/checkpointing.py - Run records
app/run_repository.py
Other components
- Customer
- Operator
- Approval admin
- Model Studio
- Qdrant service
Connections 36
- Customer → Support workbench: submits request
- Operator → Support workbench: handles cases
- Approval admin → Support workbench: reviews refunds
- Support workbench → Web sessions: uses session
- Support workbench → Backend proxy: sends requests
- Backend proxy → FastAPI routes: proxies requests
- FastAPI routes → Authorization: authorizes
app/api.py - FastAPI routes → Agent graph: invokes and resumes
app/api.py - FastAPI routes → Order repository: serves order data
app/api.py - FastAPI routes → Ticket and approval records: manages cases
app/api.py - FastAPI routes → Run records: reads run records
app/api.py - FastAPI routes → Execution telemetry: records execution
app/api.py - Agent graph → Chat model: calls
app/graph.py - Agent graph → Order tools: dispatches
app/graph.py - Agent graph → Policy tools: dispatches
app/graph.py - Agent graph → Workflow tools: dispatches
app/graph.py - Agent graph → Approval flow: pauses and resumes
app/graph.py - Agent graph → Conversation checkpoints: persists state
app/graph.py - Order tools → Order repository: queries orders
app/tools/order_tools.py - Workflow tools → Ticket and approval records: manages tickets
app/tools/workflow_tools.py - Policy tools → Text embeddings: embeds queries
app/tools/policy_tools.py - Policy tools → Policy vector store: searches policies
app/tools/policy_tools.py - Ticket and approval records → Order repository: looks up orders
app/workflow_repository.py - Order repository → Business database: reads orders
app/order_repository.py - Ticket and approval records → Business database: reads and writes
app/workflow_repository.py - Business database → Database models: maps records
app/database.py - Policy ingestion → Document loader: loads chunks
app/knowledge_ingestion.py - Policy ingestion → Text embeddings: embeds chunks
app/knowledge_ingestion.py - Policy ingestion → Policy vector store: indexes policies
app/knowledge_ingestion.py - Policy vector store → Qdrant service: stores vectors
- Chat model → Model Studio: requests completions
- Text embeddings → Model Studio: requests embeddings
- FastAPI routes → Conversation checkpoints: configures persistence
app/api.py - FastAPI routes → Policy vector store: uses policy store
app/api.py - FastAPI routes → Business database: initializes data
app/api.py - FastAPI routes → Run records: records runs
app/api.py