Document Intelligence & Edge Inference — Infiswift.ai

Consolidating fragmented ML repositories into one inference API, building a content-aware document validation agent on Vertex AI Gemini with LangChain and LangGraph, and shipping wake-word models to edge hardware through ONNX and TensorRT.

AI Engineer · Infiswift.ai, California · Nov 2025 – Present

What I built
  • Modular NLP extraction API — consolidated multiple machine learning repositories into a unified inference pipeline, eliminating duplicate LLM workflows and improving maintainability across engineering teams.
  • Content-aware document validation agent — built with Vertex AI Gemini, LangChain, and LangGraph to classify uploaded RFI documents by their actual content, reducing downstream failures caused by incorrect file categorisation.
  • Centralised FileType glossary injection — a mechanism for injecting business rules into LLM prompts, enabling instant rule updates without model retraining and keeping classification consistent across environments.
  • Self-learning classification framework — automatically generated and validated regex patterns from newly identified document titles, expanding deterministic coverage while minimising manual rule creation.
  • AWS serverless orchestration pipeline — Lambda, SQS FIFO, and Amazon S3 managing automated rule promotion, deduplication, version control, and deployment across Development, Preview, and Production.
  • Wake-word detection optimisation — multi-layer perceptron architectures over Mel-spectrogram features, exported through ONNX and TensorRT for low-latency edge inference driving robotic arm control.
  • Testing and evaluation frameworks — PyTest and Moto to validate AI workflows, cloud integrations, and model behaviour, improving deployment reliability and reducing regression risk.
  • LLM evaluation and A/B testing — iterative evaluation across production projects, analysing model agreement and reasoning quality to identify classification gaps and refine prompt strategies.
Architecture
uploadRFI document extraction APIunified pipeline LangGraph agentGemini · LangChaincontent-aware FileType glossaryinjected classification+ confidence self-learningregex generation Lambda · SQS FIFO · S3 dev → preview → production promotionpromoted rules feed back as deterministic matches
Two paths run side by side: an LLM classifies what regex cannot, and confirmed patterns are promoted into deterministic rules so the expensive path is used less over time.
Technical specifications
LLM & platformVertex AI Gemini on Google Cloud
OrchestrationLangChain for components, LangGraph for stateful agent control flow
Rule injectionCentralised FileType glossary injected into prompts at request time
Deterministic layerAuto-generated, validated regex patterns from observed document titles
Cloud pipelineAWS Lambda, SQS FIFO queues, Amazon S3
EnvironmentsDevelopment → Preview → Production, with version control on rules
Edge modelMLP over Mel-spectrogram features for wake-word detection
Edge runtimeONNX export, TensorRT optimisation, low-latency inference for robotic arm control
TestingPyTest for logic, Moto for mocked AWS services
EvaluationLLM evaluation with A/B testing, model agreement and reasoning-quality analysis
Interview questions 132 questions

Grouped by what an interviewer is probing. The "what if" sections are the ones that separate a rehearsed answer from real understanding — they change one variable and see whether your reasoning survives. Terms used here are defined in the glossary.

1 · Framing and scope (10)
  1. What problem was the document validation agent actually solving, in business terms?
  2. What was breaking downstream when files were categorised incorrectly?Name the concrete failure, not "errors" — wrong extraction schema applied, wasted LLM spend, bad data landing in the warehouse.
  3. Why was content-aware classification necessary rather than trusting filenames or MIME types?
  4. How did you decide what counted as a correct classification?
  5. Who were the users of this system, and what did they experience before it existed?
  6. What did "consolidating multiple ML repositories" mean concretely — what was duplicated?
  7. How did you decide which repositories to merge and which to leave alone?
  8. What was the cost of the duplication you removed — engineering time, compute, or correctness?
  9. How did you avoid the consolidated API becoming a bottleneck that every team had to queue behind?
  10. If you started this project again, what would you scope differently?
2 · LLM application design — LangChain and LangGraph (12)
  1. Why LangGraph rather than a plain LangChain chain?The honest answer is state and branching — a document that fails validation needs to route differently, which a linear chain cannot express cleanly.
  2. What state did your graph carry between nodes?
  3. Where were the conditional edges in your graph, and what decided them?
  4. How did you prevent the agent from looping indefinitely?
  5. What did a node failure do — retry, route to a fallback, or fail the request?
  6. Why use a framework at all rather than calling the model API directly?
  7. What did LangChain give you that you would otherwise have written yourself?
  8. How did you handle the model returning malformed or unparseable output?
  9. Did you use structured outputs or schema enforcement? What happens when the schema is violated?
  10. How did you manage prompt versioning across environments?
  11. How much of the latency was model time versus orchestration overhead?
  12. What would make you drop the framework and hand-roll the loop?
3 · The FileType glossary injection mechanism (10)
  1. Explain the glossary injection mechanism to someone who has never seen it.
  2. Why inject business rules into the prompt instead of fine-tuning the model on them?Rules change weekly; retraining does not. This is the core argument and it is about change frequency, not model capability.
  3. What exactly gets injected — definitions, examples, or both?
  4. How did you keep the glossary from growing until it consumed the context window?
  5. How did you guarantee the same glossary version was used across Development, Preview, and Production?
  6. What happens to prompt caching when the glossary changes?
  7. How did you validate that a glossary change improved rather than degraded classification?
  8. Who owned the glossary — engineering or the business?
  9. How did you prevent a bad glossary edit from reaching production?
  10. At what glossary size would this approach stop working, and what would replace it?
4 · The self-learning regex framework (12)
  1. Walk me through how a new regex pattern gets generated, validated, and promoted.
  2. What generated the candidate pattern — the LLM, a heuristic, or both?
  3. How did you validate a generated regex before trusting it?The interesting part is the negative set: a pattern that matches everything scores perfectly on positives.
  4. How did you prevent an over-broad pattern such as .* from being promoted?
  5. How did you handle two patterns that both match the same document?
  6. What was the precision requirement for promotion, and how was it chosen?
  7. Why prefer deterministic regex over letting the LLM classify every document?
  8. How much traffic ended up served by regex versus the model?
  9. How did you retire a pattern that started performing badly?
  10. What stops this system from slowly drifting into a thicket of unmaintainable rules?
  11. How is this different from just fine-tuning a classifier on the same data?
  12. How did you catch a regex with catastrophic backtracking before it reached production?
5 · AWS serverless orchestration (12)
  1. Why SQS FIFO rather than a standard queue?Ordering and deduplication. Rule promotion is a state machine — applying version 3 before version 2 corrupts it.
  2. What is a message group ID and how did you choose yours?
  3. What throughput ceiling does FIFO impose, and did you ever hit it?
  4. How did you make the Lambda consumers idempotent?
  5. What happens when a Lambda times out halfway through a promotion?
  6. Where did you use a dead-letter queue, and what did you do with the messages in it?
  7. How did S3 fit — storage of what, exactly, and with what key structure?
  8. How did you version rules, and could you roll back?
  9. How did promotion across Development, Preview, and Production actually work?
  10. What prevented a rule from skipping an environment?
  11. How did you handle Lambda cold starts on this path?
  12. Why serverless rather than a long-running service?
6 · Wake-word detection and audio ML (12)
  1. What is a Mel-spectrogram, and why use it instead of the raw waveform?Mel spacing matches human pitch perception, and it turns a 1-D signal into a 2-D representation a small network can consume cheaply.
  2. What were your window size, hop length, and number of Mel bands, and how did those choices affect latency?
  3. Why an MLP rather than a CNN or an RNN for wake-word detection?
  4. What is the input dimensionality of your MLP and how did you arrive at it?
  5. How do you handle variable-length audio with a fixed-size MLP input?
  6. What is your false-accept versus false-reject tradeoff, and who decided it?
  7. How did you collect and label training data for the wake word?
  8. How did you handle background noise, accents, and distance from the microphone?
  9. What is the streaming inference setup — sliding window, and at what stride?
  10. How did you measure end-to-end latency from utterance to robot action?
  11. What happens when two wake words overlap or the phrase is cut off?
  12. Why does a false accept matter more when the output controls a robotic arm?
7 · Model optimisation and edge inference (12)
  1. Why export to ONNX at all — what does it buy you?
  2. What is ONNX, and what does the exported graph actually contain?
  3. What does TensorRT do to the model that ONNX Runtime does not?Layer fusion, kernel autotuning for the specific GPU, and precision calibration — it compiles rather than interprets.
  4. What precision did you run at, and how did you verify accuracy was preserved?
  5. What is a calibration dataset and why does INT8 quantisation need one?
  6. How did you validate that the ONNX model matched the PyTorch model numerically?
  7. What broke during export, and how did you diagnose it?
  8. What are dynamic axes in an ONNX export and when do you need them?
  9. How did you measure latency — mean, p99, or worst case, and why?
  10. How much of the latency was model inference versus feature extraction?
  11. What is the memory footprint on the edge device, and was that a constraint?
  12. Why is a TensorRT engine not portable between GPU models?
8 · Testing and reliability (10)
  1. What is Moto and why use it rather than hitting real AWS in tests?
  2. What did you test with PyTest that was genuinely worth testing?
  3. How do you test a component whose output is non-deterministic?Test the contract, not the text — schema validity, required fields, latency bounds, and behaviour on malformed input.
  4. How did you test the LangGraph agent's routing logic without calling the model?
  5. What is a fixture and how did you use them here?
  6. How did you test the SQS FIFO ordering guarantees?
  7. What did your CI pipeline run on every commit?
  8. How did you prevent flaky tests from eroding trust in the suite?
  9. What regression escaped your tests, and what did you add afterwards?
  10. What is the difference between mocking the model and mocking the cloud service, in terms of what each protects you from?
9 · LLM evaluation and A/B testing (12)
  1. How did you build the evaluation set, and how big was it?
  2. What metrics did you use for classification quality, and why those?
  3. What does "model agreement" mean and how did you measure it?Agreement between models or between runs is a proxy for confidence — high disagreement flags the examples worth human review.
  4. How did you evaluate reasoning quality rather than just the final label?
  5. Did you use an LLM as a judge? What are the failure modes of that?
  6. How did you decide a prompt change was an improvement rather than noise?
  7. How did you run an A/B test on an LLM feature — what was randomised?
  8. What sample size did you need to detect the effect you cared about?
  9. What guardrail metrics did you watch to be sure you were not trading quality for speed?
  10. How did you identify classification gaps from the evaluation results?
  11. How did you stop evaluation set contamination once you started tuning against it?
  12. What did you do when offline evaluation and production behaviour disagreed?
10 · What if — scale and load (10)
  1. What if document volume increased a hundredfold overnight?
  2. What if the LLM provider had a partial outage for two hours during business hours?
  3. What if per-document cost tripled because of a pricing change?
  4. What if the FIFO queue's throughput limit became the bottleneck?
  5. What if a single tenant submitted a million documents and starved everyone else?
  6. What if the glossary grew to twenty thousand tokens?
  7. What if you had to serve this synchronously with a two-second budget instead of asynchronously?
  8. What if documents arrived as scanned images rather than text?
  9. What if the same document was submitted a hundred times in a minute?
  10. What if you needed to run entirely inside a customer's VPC with no internet access?
11 · What if — correctness and failure (10)
  1. What if the model silently started misclassifying one document type after a provider model update?
  2. What if a promoted regex began matching documents it should not?
  3. What if the glossary and the regex layer disagreed on a document?
  4. What if a customer disputed a classification and you had to explain it?This is really about traceability — can you reconstruct which glossary version, which prompt, and which rule produced that answer?
  5. What if the LLM leaked content from one document into the classification of another?
  6. What if someone embedded instructions inside a document to manipulate the classifier?
  7. What if the wake-word model started firing on background speech in a noisy factory?
  8. What if the TensorRT engine produced different results from the PyTorch model in production?
  9. What if a rule promotion was applied to Production but not Preview?
  10. What if you discovered the evaluation set itself was mislabelled?
12 · What if — design alternatives (10)
  1. What if you had to remove the LLM entirely — how far could deterministic rules take you?
  2. What if you fine-tuned a small classifier instead of prompting a large model?
  3. What if you had to switch from Gemini to a different provider next month?
  4. What if the business wanted a confidence score on every classification?
  5. What if you had to support fifty document types instead of a handful?
  6. What if latency mattered more than accuracy?
  7. What if you had no labelled data at all when you started?
  8. What if the wake-word model had to run on a microcontroller instead of a Jetson-class device?
  9. What if you had to make the whole pipeline auditable for a regulated customer?
  10. What if you had unlimited budget — what would you actually change?A good answer names something other than "a bigger model", because the bottleneck usually is not model capability.
Glossary
TermWhat it means
RFIRequest For Information — a formal document exchanged in construction and procurement asking for clarification. Here, the document type being classified.
Vertex AIGoogle Cloud's managed machine learning platform, including hosted access to Gemini models.
GeminiGoogle's multimodal model family, accepting text, images, audio, and video in one context.
LangChainA framework of composable components — prompts, models, retrievers, output parsers — for building LLM applications.
LangGraphModels an agent as an explicit state graph with nodes and conditional edges, so loops and branches are first-class rather than implicit.
Node / edgeIn LangGraph, a node is a step (call a model, run a tool) and an edge is the transition between steps. A conditional edge chooses the next node at runtime.
StateThe data carried between nodes of the graph — the document, partial results, retry counts, confidence.
Prompt injectionText inside untrusted input that the model interprets as instructions. A real risk when the model reads customer documents.
Structured outputConstraining the model to emit JSON matching a schema, so downstream parsing cannot fail on free text.
Prompt cachingReusing the processed form of a stable prompt prefix across requests. Cheap and fast — but a prefix match, so changing the glossary early in the prompt invalidates it.
Context windowThe maximum number of tokens a model can attend to at once. The glossary competes with the document for this budget.
RegexRegular expression — a pattern language for matching text. Deterministic, fast, and free compared with a model call.
Catastrophic backtrackingA regex whose evaluation time explodes exponentially on certain inputs, effectively hanging the process. A denial-of-service risk from a badly written pattern.
Precision / recallPrecision is the share of predicted positives that are correct; recall is the share of actual positives found. A promotion rule should demand high precision.
Negative setExamples a pattern should not match. Without it, an over-broad pattern looks perfect.
DeterministicSame input always produces the same output. Regex is deterministic; an LLM call generally is not.
AWS LambdaRuns a function in response to an event with no server to manage, scaling automatically and billing per execution.
Cold startThe extra latency when a Lambda has to initialise a new execution environment before running your code.
SQSAmazon's managed message queue, decoupling producers from consumers.
FIFO queueA queue preserving strict order within a message group and deduplicating messages, giving exactly-once processing at lower throughput than a standard queue.
Message group IDThe key that defines an ordering scope in a FIFO queue. Messages in the same group are strictly ordered; different groups run in parallel.
IdempotencyPerforming an operation twice has the same effect as once. Required because at-least-once delivery means retries will happen.
Dead-letter queueWhere messages go after repeated processing failures, so a poison message stops blocking the queue and becomes visible instead.
Amazon S3Object storage addressed by key within buckets — effectively unlimited, highly durable, the usual home for artefacts and rule files.
Environment promotionMoving a change through Development, then Preview, then Production, each acting as a gate.
Wake wordA short phrase that activates a device, detected by a small always-on model.
Mel-spectrogramA time-frequency representation of audio with frequency bands spaced to match human pitch perception — the standard input for small speech models.
Window / hop lengthHow much audio each analysis frame covers, and how far the window advances each step. Together they set time resolution and latency.
MLPMultilayer perceptron — fully connected layers with non-linear activations. Small, fast, and adequate for fixed-size feature inputs.
Sliding window inferenceRunning the model repeatedly over overlapping audio segments so a wake word is caught wherever it falls.
False accept / false rejectTriggering when the wake word was not said, versus missing it when it was. The costs are asymmetric and depend on what the device then does.
ONNXAn open format for representing a model as a portable computation graph, so it can run in runtimes other than the one that trained it.
Dynamic axesDimensions of an ONNX input marked as variable — typically batch size or sequence length — so one exported model serves many shapes.
TensorRTNVIDIA's inference compiler. Fuses layers, calibrates precision, and selects kernels for a specific GPU, producing a fast but non-portable engine.
Layer fusionCombining several operations into one kernel to avoid writing intermediate results to memory — usually the largest single inference win.
QuantisationRunning weights and activations at lower precision (INT8, FP8) for less memory and faster maths, at some accuracy cost.
Calibration datasetA representative sample used to choose quantisation scales so the reduced precision range covers real activations.
Edge inferenceRunning the model on the device rather than in the cloud — lower latency, no network dependency, tighter memory limits.
PyTestPython's standard testing framework, built around plain functions and fixtures.
FixtureReusable setup shared across tests — a client, a temporary bucket, a sample document.
MotoA library that mocks AWS services in-process, so tests exercise S3 and SQS logic without network calls, credentials, or cost.
Regression testA test that re-runs known cases on every change, catching a quality drop before users do.
LLM-as-judgeUsing a model to score another model's output. Cheap and scalable, with known biases toward length, position, and its own style.
Model agreementHow often two models, or two runs, produce the same answer. Disagreement is a useful signal for which cases need human review.
Guardrail metricA secondary metric watched during an experiment to catch damage the primary metric would hide — cost, latency, or refusal rate.
Evaluation contaminationTuning against your evaluation set until the score stops measuring generalisation and starts measuring memorisation.
A/B testRandomly assigning traffic between variants so the measured difference can be attributed to the change rather than to who received it.

Back to all projects.