Back to portfolio

Case Study

Multi-Agent AI Helpdesk System

Concurrent reasoning agents for enterprise support workflows

FastAPIRedisPostgreSQLLangChainDocker

Problem

Single-agent support assistants struggled with policy compliance and quality consistency at high ticket volumes.

System Architecture

High-level component flow.

Component

API Gateway

API Gateway handles external requests, routing, and protocol boundaries.

Connected To

  • Sends output to Orchestrator Agent
  • Receives input from Resolution Agent

Key Engineering Decisions

  • Separated responsibilities into specialist agents to reduce prompt complexity and increase determinism.
  • Added Redis-backed state and caching to preserve context while keeping latency stable.
  • Implemented guardrails for policy validation before final response generation.

Implementation Details

  • FastAPI async endpoints with queue-backed task fan-out for agent calls.
  • PostgreSQL for ticket lifecycle, audit trails, and policy outcomes.
  • Prompt routing strategy tuned by request type and confidence thresholds.

Results

Concurrent Sessions

1,200+

Median Response Latency

1.7s

Auto-resolution Rate

54%

  • Handled 1,200+ concurrent sessions in load tests with no critical failures.
  • Reduced median response latency to 1.7s with Redis cache hit optimization.
  • Raised auto-resolution while preserving policy compliance requirements.

Code Snippet

Agent Routing

async def route_ticket(ticket):
    tasks = [retriever.run(ticket), policy.run(ticket)]
    knowledge, policy_result = await asyncio.gather(*tasks)

    if not policy_result.allowed:
      return policy_result.response

    return await resolver.run(ticket, knowledge)

Lessons Learned

  • Agent boundaries should follow business failure modes, not model capabilities.
  • Caching needs strict invalidation strategy in policy-heavy workflows.
  • Reliable AI systems are built through instrumentation, not intuition.