How sam-abishekraj/sutraops works
SutraOps is an enterprise support-operations agent that turns a user’s chat request into grounded answers or guarded actions in mock client systems. The main workflow enters through the Flask API, runs the tool-calling agent, and uses policy retrieval, SQL, or CRM/notification tools; risky actions wait for human approval. The web UI also exposes approvals and operational traces, and an MCP server offers the shared tools to external clients. Edges reflect README architecture statements and source-index references; unsampled implementation details are not inferred.
Main entry points: app.py Flask API · tools.py Tool registry · agent.py Agent loop · db.py Business database
Components 22
User interfaces
- Chat console
static/js/chat.js - Admin console
static/js/admin.js - Flask API
sutraops/web/app.py
Agent orchestration
- Agent loop
sutraops/agent.py - Groq client
sutraops/llm.py - MCP server
sutraops/mcp_server.py - Tool registry
sutraops/tools.py
Safety and approvals
- Guardrails
sutraops/guardrails.py - Approval workflow
sutraops/approvals.py
Client systems
- Systems HTTP client
sutraops/systems/client.py - CRM and outbox API
sutraops/systems/crm_api.py - Guarded SQL
sutraops/sqltool.py - SOP retrieval
sutraops/knowledge/rag.py - SOP documents
sutraops/knowledge/docs
Operational data
- Business database
sutraops/db.py - Operations database
sutraops/db.py - Demo seed data
sutraops/seed_data.py - Run tracing
sutraops/tracing.py
Other components
- Support user
- Team lead
- Groq API
- MCP client
Connections 27
- Support user → Chat console: asks
README.md - Chat console → Flask API: submits chat
README.md - Flask API → Agent loop: runs request
sutraops/web/app.py - Flask API → Run tracing: serves trace views
sutraops/web/app.py - Admin console → Flask API: requests admin data
README.md - Agent loop → Groq client: requests completion
sutraops/agent.py - Groq client → Groq API: calls model API
README.md - Agent loop → Tool registry: executes tools
sutraops/agent.py - Agent loop → Guardrails: checks and sanitizes
sutraops/agent.py - Tool registry → Systems HTTP client: calls CRM tools
sutraops/tools.py - Tool registry → Guarded SQL: runs SQL tool
sutraops/tools.py - Tool registry → SOP retrieval: searches policies
sutraops/tools.py - SOP retrieval → SOP documents: indexes and searches
README.md - Guarded SQL → Business database: queries read-only
README.md - Systems HTTP client → CRM and outbox API: sends HTTP requests
sutraops/systems/client.py - CRM and outbox API → Business database: reads and writes
sutraops/systems/crm_api.py - Tool registry → Approval workflow: queues risky actions
sutraops/tools.py - Team lead → Admin console: reviews requests
README.md - Admin console → Flask API: submits decision
README.md - Flask API → Approval workflow: routes decisions
sutraops/web/app.py - Approval workflow → Systems HTTP client: executes approved action
sutraops/approvals.py - Agent loop → Run tracing: records run steps
sutraops/agent.py - Run tracing → Operations database: persists traces
sutraops/tracing.py - Flask API → Business database: initializes storage
sutraops/web/app.py - Business database → Demo seed data: loads demo records
sutraops/db.py - MCP client → MCP server: connects over MCP
README.md - MCP server → Tool registry: exposes shared tools
sutraops/mcp_server.py