- Professional work
- Deployed internally
- 2026
OAK (Output Audit & Knowledge): AI-Powered Error Resolution
An error-resolution agent for R code generated by the ROAK framework. It matches runtime errors to a curated rulebook, explains the cause and returns a known fix, so programmers don't have to wait for the core team.
- My role
- End-to-end owner (designed and built).
- Key result
- Known errors are resolved immediately by deterministic matching, and the LLM is used only when meaning matters.
- Technologies
- Python
- AWS Lambda
- Bedrock AgentCore Gateway
- Amazon OpenSearch Serverless (exact match and k-NN search)
- Azure OpenAI (embeddings)
- Gemini 2.5 Flash through Portkey
- Amazon DocumentDB
- Amazon S3
- LangSmith
- JWT
What I owned
- Problem framing
- Data preparation
- Modeling
- Evaluation
- Application/API
- Deployment
- Monitoring
Built at ZS for internal use. Described in simplified form; no client data, code or internal links are shown.
In [1]:Problem and constraints
Clinical data programmers use ROAK to generate R code for RAW-to-SDTM transformations, and that code can fail at runtime.
- Many errors need knowledge of ROAK's internals, so programmers often had to ask the core ROAK team.
- That caused delays, repeated support work, and a dependency on a few experts.
In [2]:Data and preparation
A curated rulebook of known error patterns and their resolutions, by ROAK version, plus the programmers' error logs (up to 50 per request).
In [3]:Baseline and evaluation design
LangSmith tracing and evaluation, feedback reports saved to S3, and the programmer's approval or rejection of each answer.
In [4]:Architecture and modeling decisions
Retrieve, then verify:
- An exact-match search against the rulebook in OpenSearch. A hit returns the known resolution with no LLM call.
- Otherwise, an Azure OpenAI embedding drives a k-NN semantic search. Gemini 2.5 Flash then checks the top candidates against the error's structure (prefixes, function names, placeholder values).
The LLM never writes a fix: every resolution comes from the curated knowledge base, which keeps hallucination risk low.
In [5]:Implementation and integration
- A Python orchestration layer on AWS Lambda behind Bedrock AgentCore Gateway.
- Parallel batches (ThreadPoolExecutor, up to 10 workers).
- ROAK-version filtering, and retries with exponential backoff.
- JWT-based user identification, DocumentDB audit logging, LangSmith tracing, S3 feedback reports.
- A human-in-the-loop approval step.
In [6]:Deployment and operation
Status: Deployed internally
In production at ZS (internal) on AWS Lambda.
Out[6]:Results and evidence
- Known errors are resolved immediately by deterministic matching, and the LLM is used only when meaning matters.
- Programmers depend less on the core ROAK team for recurring errors.
- The team's knowledge gets reused, traceability improves through audit logs, and debugging becomes self-service.
In [7]:Limitations, failures, and lessons
- OAK can only resolve errors the rulebook already knows. New error types still go to the core team, and the rulebook needs ongoing curation.