Starting out
I joined straight out of an internship, and most of what I learned came from owning things end to end rather than being handed specs.
That looked like weekly sessions with my manager digging into what users were actually struggling with, pushing hard on whether a request was a vitamin or a painkiller before writing a line of code. It looked like late nights with our CEO in New York, arguing through product direction. And it looked like being the person who stayed up until 6 AM to make sure a demo went cleanly, because the feature was mine, and shipping it correctly, every edge case, local and production, was my job and not someone else's.
Ownership meant nothing without speed. Early-stage startups don't get the luxury of time, so I shipped at a pace I'd never worked at before, driven mostly by how much I cared about what we were solving.
The company arc ran alongside my own. I was there from the idea stage, when we were running on the CEO's savings, through a $4M seed, partnerships with Microsoft, NVIDIA and Accenture, and into Prometheus, a $60M DOE Genesis Mission Phase II program with Idaho National Laboratory, where Everstar is the deployment partner.
Somewhere in those two years the questions I asked myself changed. I stopped asking how do I build this and started asking should this exist, what does this look like when it fails at 3 AM, and which of these decisions can I not cleanly reverse in eighteen months. Nobody promoted me into that. The system got big enough that not asking became expensive.
The domain, and why it punishes shortcuts
Nuclear compliance is not a forgiving place to put a language model.
The corpus is NRC, DOE and DOD material (regulations, guidance, licensing
correspondence, safety analyses), and it is dense with exact identifiers.
10 CFR 50.59, NUREG numbers, revision tags, docket references. Getting one
character wrong doesn't produce a slightly worse document. It produces a
document that cites the wrong legal obligation, and the person who has to
catch that is a licensing engineer reading a thousand pages under a deadline.
Regulatory language is also repetitive by design. Passages that mean different things are written to look alike, and the passage a user actually needs is frequently the one that differs from its neighbours in a single qualifying clause. The naive retrieval assumptions (semantic similarity is enough, more context is better, longer chunks are safer) are all wrong here in a way that doesn't show up until someone downstream trusts the output.
That constraint shaped every system below.
The agent system
The drafting side is a multi-agent system in LangGraph rather than one long completion. A planner decomposes a drafting request into sections and the retrieval each section needs. A draft-composer writes against retrieved evidence, section by section. A drift-analysis agent checks the result back against source material and flags where the draft has wandered from what the citations actually support.
Claude Opus runs as the lead agent, with Sonnet and Haiku handling sub-agents and narrower tasks. The routing is a cost and latency decision as much as a quality one, since a thousand-page document is a lot of tokens to spend at the top tier.
Around that sits the layer that makes it usable in production: citation-accuracy validation, hallucination guardrails, routing and handoff between agents, parallelism where sections are independent, human-in-the-loop review at the points where a person must sign off, long- and short-term agent memory, reflection loops, error recovery, token budgeting and prompt caching.
The output is citation-backed regulatory documents running to a thousand pages, produced in hours rather than weeks.
Retrieval
Retrieval is hybrid. BM25 and dense vectors fused with RRF, metadata pre-filtering ahead of the vector stage, then Cohere reranking on the survivors, all over OpenSearch.
That took retrieval across 10M+ NRC, DOE and DOD documents from 3–4 seconds to under 200ms, roughly a 90% cut, without giving up accuracy. Worth being precise about where the win came from: the metadata pre-filter is doing most of the latency work, not the reranker. Narrowing the candidate set before the vector stage is what makes the expensive parts affordable.
Ingestion
Documents arrive as PDFs, in every condition a scanned regulatory archive can produce, and have to become something queryable.
Airflow on Kubernetes orchestrates the stages. Parsing and OCR run in a CUDA-accelerated FastAPI microservice on an A100 VM cluster, using Marker for OCR, with autoscaling, exponential backoff, model caching and dead-letter queuing so failures are isolated and retried rather than silently dropped.
Extraction is custom: image extraction, table structure parsing with NumPy,
and contextual chunking that preserves cross-page document context rather than
splitting on a fixed token count. Embeddings are OpenAI text-embedding-3-small.
The pipeline scales to 10M+ PDFs, which means customers can onboard terabytes of their own archives without losing records or needing an engineer watching the queue.
The backend
FastAPI REST and streaming services sit in front of everything: OpenSearch for retrieval, MongoDB for document metadata, PostgreSQL for relational state, Neo4j for the relationships between regulations, revisions and the documents that cite them. Redis handles caching and async workers keep the query path low-latency under load.
Generation streams over SSE, with Redis holding stream state so the connection is resumable rather than merely retryable.
The platform
Everything is declarative. Terraform modules for infrastructure, ArgoCD GitOps for delivery, GitHub Actions for CI gated by automated smoke tests, so shipping is a single merge with zero-downtime deploys and one-click rollback. MongoDB, OpenSearch, Airflow and the backend all run on Kubernetes.
The largest single piece of that work was a zero-downtime production migration from GCP to Azure AKS, moving Airflow, OpenSearch and Percona MongoDB across clouds while the platform stayed up. Having the whole thing codified as Terraform modules is the only reason that was a project rather than a rewrite.
Evals and observability
Every agent change is scored in LangSmith against a golden dataset: LLM-as-judge on faithfulness, helpfulness, correctness and relevance, plus expected tool calls, must-include keywords and must-not-include keywords. Nothing ships without demonstrating it isn't a regression.
In production, end-to-end tracing in LangSmith covers the agent path, with OpenTelemetry, Prometheus and Grafana underneath for the services around it. An agent system you cannot trace is an agent system you cannot debug, and the failures that matter here are rarely a stack trace.
The model pipeline
Separately, I built the MLOps pipeline for circuit-diagram symbol detection (YOLO, Roboflow for annotation, Vertex AI for training and versioned endpoints, Weights & Biases for experiment tracking), where every candidate model is validated against the incumbent before it can go live.
Decisions I'd still defend
Retrieval is hybrid, not pure vector
I fought to keep BM25. The argument against it was reasonable: two indices,
two tuning surfaces, more infrastructure for a team of four. But embeddings
smear exact identifiers together. A document citing 50.59 and one citing
50.69 are near-neighbours in vector space and represent completely different
legal obligations. Semantic similarity is the wrong tool for a docket number.
The agent refuses rather than reaches
When retrieval confidence falls below threshold, the agent says it doesn't have grounding instead of synthesising something plausible out of weak context. This makes the demo worse and the answer-rate metric worse, and I got asked about it more than once.
I'd still defend it. In a regulated domain a fluent wrong citation isn't a degraded answer, it's a liability, and the human reviewer downstream can't catch what they can't see is invented. Refusal is a visible failure. Hallucination is an invisible one.
Evals assert on trajectory, not just output
The golden dataset encodes expected tool calls and the part nobody wanted to write: must-not-include keywords. Asserting on final-answer similarity alone tells you nothing about an agent that reached the right answer through the wrong path, which is exactly the regression that bites you two releases later. It made the dataset genuinely annoying to maintain. It also meant every agent change shipped as a non-regression rather than a vibe.
Chunking preserves structure across page boundaries
Fixed-size chunking is faster to build and faster to run, and it silently destroys the exact content (a table split down the middle, a clause severed from its qualifier) that produces confidently wrong answers. The failure never shows up in ingestion metrics. It shows up as a wrong compliance answer six months later with no trace back to the cause.
Streams are resumable, not retryable
"Just retry" is the cheap answer and it's fine for a chat reply. It isn't fine when the response is a thousand-page generated document. A retry is minutes of compute and a user who now doesn't trust the system to finish anything.
Everything is declarative, including the parts that seemed like overkill at four people
This cost us real velocity in month one and I'd make the same call twice. The moment a national lab is a dependency, "who changed what on the cluster" needs an answer that isn't someone's memory. And when we later moved clouds, the codified platform is what turned a migration into a merge.
Stack
Python, TypeScript, FastAPI, Next.js, LangGraph, LangChain, LangSmith, OpenSearch, MongoDB, PostgreSQL, Neo4j, Redis, Airflow, Marker, Docker, Kubernetes, Terraform, ArgoCD, GitHub Actions, OpenTelemetry, Prometheus, Grafana, Azure, GCP.