Enterprise AI · Mobility & Ride Hailing (UAE)
Tanzim: AI Driver Support & CRM Automation
AI support platform resolving driver tickets across 5-6 workflows, with autonomous email replies with confidence-based escalation into HubSpot CRM.
- Role
- AI Engineer
- Built the agent architecture, guardrail layer, CRM integration, MCP server and the full auth model end to end.
- Industry
- Mobility & Ride Hailing (UAE)
- Timeline
- Jun 2026 - Jul 2026
Business impact
- agent workflows
- 3 + email routing
- graph nodes
- 24
- mcp tools
- 16 allow listed
- guardrail boundaries
- 3
- auth lanes
- 4
Overview
AI support platform where drivers raise tickets across 5 to 6 workflows: lost-and-found items recovered in vehicles, fare-dispute resolution and more. Each inbound email triggers an AI workflow that attempts autonomous resolution by drafting and sending replies.
When a case exceeds its confidence or scope, the agent escalates and auto-creates a HubSpot CRM ticket for a human agent to close the loop. Workflows are engineered in FastAPI and orchestrated with LangChain and LangGraph, with layered guardrails over every automated action, hand-off and escalation. Hardened for production: an Azure API Management gateway fronts the AI app, Container Apps run inside a private VNet, and the MCP server is deployed under the hood of the same VNet and exposed only through the API gateway.
Technical architecture
- Frontend
- React and TypeScript SPA over HTTP/SSE - analyst chat, support chat, CRM grid, trace monitor
- Gateway
- APIM policy with streaming safe forwarding, CORS allow list, anti spoof header stripping and per IP throttling
- Agent Layer
- LangGraph workflows with a strict one way hierarchy: workflow, nodes, agents, tools
- Governance
- Input sanitizer, output reply guard, SQL policy node, tool registry and MCP operation allow list
- CRM
- HubSpot service owning contacts, ticket CRUD and pipelines, with typed errors and graceful degradation
- Identity
- Entra ID session JWT, optional TOTP, service key lane and APIM delegated identity bridge
- Testing
- Hermetic harness faking only external boundaries - guardrail, graph, e2e, multi turn and concurrency suites
Key features
- Natural language data analyst - router, schema fetch, table selection, SQL generation, policy gate and execution
- Lost & Found agent that resolves the trip, records the item and links a match when it finds one
- Fare dispute sub graph with surge, policy and slot checks, supporting multi turn escalation
- Automatic CRM ticket creation when a lost item report finds no match, associated to a resolved contact
- Full HubSpot ticket lifecycle - pipelines, stages, priority, update and archive - with the token held server side
- Prompt injection sanitization on every inbound message before it reaches an LLM node
- Outbound reply guard that strips refund promises, formatting and emoji, and guarantees the ticket reference
- Guardrail audit trail - every protection that fires is recorded as a flag on graph state
- Read only SQL policy gate rejecting eight destructive keywords before execution
- Native MCP server exposing an allow listed tool set to external AI clients under per user API keys
- Four authentication lanes plus opt in TOTP two factor with encrypted secrets and recovery codes
- Live trace monitor surfacing every graph step and tool call to the operator
Challenges solved
- Preventing the agent from promising refunds - sentence level scrubbing tuned to preserve legitimate wording
- Prompt injection on a customer facing channel - deterministic sanitization that excises the injection clause only
- Letting an agent write to a production CRM - scoped trigger, exception safe, and always attributable to a contact
- Exposing agent tools to third party AI clients where the identity provider has no dynamic client registration
- Enforcing two factor on a non interactive lane by proving it through the token claim instead of a prompt
- Text to SQL against a live database - staged generation for accuracy, read only policy gate for safety
Tech stack
- Python
- FastAPI
- LangGraph
- LangChain
- Azure OpenAI
- Model Context Protocol (MCP)
- HubSpot CRM API
- React
- TypeScript
- Microsoft Entra ID
- TOTP 2FA
- Azure API Management
- Azure Container Apps
- Text to SQL
- pytest
- Docker