02 — Production AI
Multi-model conversational AI platform
A conversational AI serving ten enterprise brands across eight channels, architected so that a model provider outage or degradation does not interrupt customer service.
- Role
- AI application engineer, sole architect
- Period
- 2025 — present
- automated tests
- 2,645+
- uptime
- 99.9%
Five-tier model failover
A single model provider represents a single point of failure, and language models degrade in ways conventional services do not: rate limiting, reduced output quality, regional outages and silent truncation.
The agent runs a five-tier failover chain — Gemini 3 Pro, Claude, Gemini Flash, GPT-4o-mini, and a deterministic path that guarantees a response. Each tier is a complete fallback rather than a retry, and seven agentic function-calling tools remain available across the chain so capability does not degrade as requests fall through it.
Hybrid retrieval and validation
Retrieval runs on pgvector as a hybrid pipeline: semantic search for meaning, BM25 lexical search for exact model names and part numbers, and HyDE for queries phrased in terms absent from the source material.
Content is ingested with Playwright so the client’s live site remains the source of truth rather than a periodic export. Nine layers of output validation run before any response reaches a customer, as an incorrect price presented to a customer carries commercial and contractual risk.
“Semantic, lexical and HyDE retrieval, followed by nine validation layers before any response reaches a customer.”
Voice, vision and Darija
Customers frequently communicate through voice notes and photographs rather than text. GPT-4o handles transcription, Gemini TTS provides responses across thirty voices, and Gemini Vision matches photographed products against the client catalogue.
The system supports Moroccan Darija, the register customers predominantly use in this market and one that general-purpose assistants handle poorly.
Escalation and reliability
An eight-condition eligibility engine determines per conversation whether the AI continues or a human agent takes over, evaluating sentiment, deal value, complexity, explicit request and repetition, so escalation occurs before customer satisfaction degrades.
The platform runs on Java 21 virtual threads and Spring Boot 3.3, with 2,645+ automated tests, 138 Flyway migrations, Quartz batch jobs and Resilience4j circuit breakers, sustaining 100+ webhooks per second at 99.9% uptime.
Built with
- Gemini
- Claude
- OpenAI
- Java 21
- Spring Boot 3.3
- pgvector
- Redis
- Quartz
- Docker