AI Agent Development for Technical Support (L1/L2)
An AI technical support agent L1/L2 handles typical user requests: problem diagnosis, step-by-step troubleshooting, password resets, status checks — without engineer involvement. L2 tasks include more complex diagnosis with access to logs and internal systems.
Technical Support Hierarchy and AI Role
L0 (self-service): FAQ, documentation — fully AI L1 (first line): typical issues, standard solutions — AI handles 60–80% L2 (second line): non-standard cases, log analysis — AI assists engineer L3 (expert level): developers, specialists — outside AI-agent scope
L1/L2 Agent Architecture
from langchain_openai import ChatOpenAI
from langchain_community.vectorstores import Qdrant
from langchain.tools import Tool
import json
class TechSupportAgent:
def __init__(self, kb_retriever, integrations: dict):
self.llm = ChatOpenAI(model="gpt-4o", temperature=0)
self.kb = kb_retriever # Vector knowledge base
self.integrations = integrations # Integrations dict
self.tools = self._build_tools()
def _build_tools(self) -> list:
return [
{
"type": "function",
"function": {
"name": "search_knowledge_base",
"description": "Search knowledge base for solutions by problem description",
"parameters": {
"type": "object",
"properties": {
"query": {"type": "string"},
"product": {"type": "string"},
},
"required": ["query"]
}
}
},
{
"type": "function",
"function": {
"name": "check_service_status",
"description": "Check status of service or system",
"parameters": {
"type": "object",
"properties": {
"service_name": {"type": "string"}
},
"required": ["service_name"]
}
}
},
{
"type": "function",
"function": {
"name": "reset_user_password",
"description": "Reset user password (requires identity verification)",
"parameters": {
"type": "object",
"properties": {
"user_email": {"type": "string"},
"verified": {"type": "boolean", "description": "User identity verified"}
},
"required": ["user_email", "verified"]
}
}
},
{
"type": "function",
"function": {
"name": "escalate_to_l2",
"description": "Escalate task to L2 engineer",
"parameters": {
"type": "object",
"properties": {
"issue_summary": {"type": "string"},
"steps_tried": {"type": "array", "items": {"type": "string"}},
"priority": {"type": "string", "enum": ["normal", "high", "critical"]}
},
"required": ["issue_summary", "steps_tried"]
}
}
},
]
def execute_tool(self, tool_name: str, args: dict) -> str:
if tool_name == "search_knowledge_base":
docs = self.kb.similarity_search(args["query"], k=3,
filter={"product": args.get("product")})
return "\n".join([d.page_content for d in docs])
elif tool_name == "check_service_status":
return self.integrations["monitoring"].get_service_status(args["service_name"])
elif tool_name == "reset_user_password":
if not args.get("verified"):
return "ERROR: User identity must be verified before password reset"
return self.integrations["active_directory"].reset_password(args["user_email"])
elif tool_name == "escalate_to_l2":
ticket_id = self.integrations["jira"].create_ticket(
summary=args["issue_summary"],
description=f"Steps performed: {args['steps_tried']}",
priority=args.get("priority", "normal"),
component="L2",
)
return f"Task created: {ticket_id}"
return "Tool not found"
Diagnostic Decision Tree
For complex technical issues, agent follows structured process:
DIAGNOSTIC_SYSTEM_PROMPT = """You are a technical support specialist. Follow methodology:
1. IDENTIFICATION: clarify exact symptoms, error messages, software/OS version
2. ISOLATION: determine when problem started, what changed
3. DIAGNOSIS: check possible causes from simple to complex
4. RESOLUTION: offer step-by-step solution, verify result
5. ESCALATION: if 2 attempts failed — create L2 ticket with full context
During work:
- Ask max 2 questions per turn
- Verify result after each step
- Document all performed steps
- On password reset — always verify identity via 3 security questions"""
Practical Case: L1 Support for SaaS Platform
Volume: 2400 requests per month, team of 6 L1 operators + 3 L2 engineers.
Top-5 topics: authorization (31%), data loading issues (22%), reports (18%), integrations (15%), other (14%).
Results after 6 months:
| Metric | Before Agent | With Agent |
|---|---|---|
| L1 auto-resolution | 0% | 58% |
| Average L1 closure time | 4.2h | 0.3h (auto) / 3.1h (escalation) |
| CSAT | 3.7 | 4.2 |
| L2 engineer load | 100% | 71% |
| Agent errors (wrong solution) | — | 3.1% |
Identity Verification Before Actions
def verify_user_identity(session_id: str, claimed_email: str) -> bool:
"""Multi-factor verification before privileged actions"""
user = user_service.get_by_email(claimed_email)
if not user:
return False
# Verification questions
verification_questions = [
f"Provide last 4 digits of phone number linked to account",
f"Which department does your company belong to?",
f"State account creation date (month and year)",
]
for question in verification_questions[:2]:
answer = get_user_answer(session_id, question)
if not verify_answer(user, question, answer):
return False
return True
Timeline
- Knowledge base + RAG: 2–3 weeks
- Agent with diagnostic tree: 2–3 weeks
- Integrations (AD, monitoring, tickets): 2–3 weeks
- Testing on real cases: 2 weeks
- Total: 8–11 weeks







