SupportAI Services

Optimizing GPT-4 Prompt Engineering

Prompt design and evaluation for virtual support and AI assistant performance.

Optimizing GPT-4 Prompt Engineering

Key Details

ChallengeA support assistant drifted, hallucinated policy and had no eval harness.
SolutionPrompt packs, golden sets and regression tests before every prompt change.
TechnologiesGPT-4, LangSmith, pytest, FastAPI

Technologies used

OpenAI Python FastAPI Docker

Client background

A customer-support product shipped an LLM assistant that looked good in demos but drifted in production. Policy answers hallucinated, tone varied by prompt tweak, and nobody could prove a change was safer before release.

Key challenges

  • Prompt changes went live without regression coverage against real tickets.
  • Hallucinated policy replies created escalations and trust issues with agents.
  • No shared golden set — quality debates were anecdotal.
  • Multiple teams edited prompts in isolation, causing conflicting behavior.

Product screenshots

Dark code editor with a versioned prompt file and diff on the left and a terminal on the right showing an evaluation run over golden support transcripts, per-suite scores, and a failed policy-accuracy check that blocks the change.
Regression gate in the terminal: a new prompt version is run against the golden support set, and one policy-accuracy failure blocks the release.
Light review interface showing a golden support question, side-by-side answers from prompt v13 and v14 with rubric scores for grounding, policy accuracy and tone, and a reviewer note on why v14 fails.
Evaluation review screen compares two prompt versions on the same support question, with graded answers, grounding checks and the failure reason.

What we built

  • Versioned prompt packs with ownership and changelog discipline.
  • Golden evaluation sets drawn from real support transcripts.
  • LangSmith + pytest regression gate before every prompt or model change.
  • FastAPI serving layer with structured logging for failure review.

Project team: 4 engineers across AI/ML, backend and domain specialists — delivery over 10 weeks.

Architecture design

Support
Customers
Support answers
Support transcripts
Real conversations
Prompt owners
Changelog discipline
Serving
API
FastAPI
Structured logging
Failure review
Prompts & quality
Versioned prompt packs
Owned & logged
Golden eval sets
From transcripts
Regression gate
LangSmith · pytest
Runtime
Python services
Evaluation
Containers
Docker
AI & tooling
LLM
OpenAI
GPT-4
Testing
LangSmith
Regression tests
pytest
Test runner
Technology stack
AI & ML
OpenAI
Backend & APIs
PythonFastAPIpytest
Cloud & DevOps
Docker

How we delivered

01

Baseline

Captured failure modes from production logs and agent escalations.

02

Golden set

Built labeled examples for policy, tone and tool-use correctness.

03

Harness

Wired evals into CI so regressions block release.

04

Operate

Defined a change process for prompt owners and support leads.

Business impact

MeasurableAnswer quality
SaferPolicy replies
RepeatableReleases

Services used

We empower businesses with AI, ML, and data solutions.

Response within 1 business day. You will hear from an engineer, not a salesperson.

Contact Us →