Stride

Engineering case study / CAT / EnergyETA

An energy model people can inspect.

Organization-scoped graph modelling, AMPL optimization and AI assistance with approval and recovery boundaries.

Energy modellingOptimizationDurable AI worker
Complex energy decisions need more than a generated answer. They need a model with visible assumptions, a solver run with a recorded status, and an operator who can control consequential changes. This case study follows the CAT backend and frontend sources to explain how those responsibilities connect across an application delivered by Stride, Ahmedabad. Examples are synthetic. Architecture status is labelled per diagram; no live demo, downloadable report or measured business outcome is represented.

The business problem

Energy planning often starts with a collection of assets, equations and operating assumptions that only the author fully understands. As the model grows, a change to a bound or connection can alter a result without making the reason obvious. Copying a spreadsheet for each scenario adds another problem: the organization no longer has a clear record of which version produced a decision.

CAT represents the problem as an editable graph with nodes, edges, parameters, equations and optimization setups. The business objective is a workspace where an analyst can construct a model, review its assumptions and inspect results within the correct organization and project. AI assistance adds value only if it respects those same boundaries. A helpful suggestion must remain distinguishable from a confirmed mutation or an executed optimization.

Application scope: organization to canvas

The inspected application combines a Next.js frontend with graph state and API services, a FastAPI backend and MongoDB documents accessed through Beanie. Organization management, users, projects and graph resources establish the workspace context. The organization controller requires privileged roles for administrative operations and rejects conflicting membership. Scope checks belong in the server even when a frontend has already selected an organization.

On the canvas, the delivery scope includes graph editing, equation and parameter handling, templates, optimization configuration and the agent interaction. The frontend has separate organization, graph and agent API clients. This separation makes the product understandable: one surface defines the engineering model, another records the optimization request, and an assistant can help operate supported tools without becoming an independent source of permission.

Backend implementation: model, solve, record

The optimization controller builds a problem from graph entities and setup data. Variables carry types, bounds and fixed values; equations supply objectives and constraints. Time-series configuration adds another dimension that must survive conversion into a solver problem. Project-scoped lookup is used for setups and runs, so knowing a run identifier is insufficient to establish access.

The AMPL integration converts the problem into model syntax, invokes a configured solver and records objective values, variable values, status, messages and logs in an optimization run. The integration documentation discusses alternative solvers and licensing-dependent availability. A solver returning a status is not automatically evidence of a feasible or useful plan. The result needs interpretation against constraints, units and the scenario that generated it.

The documented mock fallback is an important qualification. A demonstration must establish that AMPL and the selected solver are available; a mock response cannot be labelled a solved energy model. This case study describes the integration and its explicit boundary, not a measured optimization improvement. Solver availability, configuration and licensing remain acceptance prerequisites for an actual delivery.

Source-backed runtime & a proposed AWS reference

The first diagram groups the application responsibilities visible in the repositories. MongoDB is the implemented persistence technology. There is no basis here to relabel that store as PostgreSQL or to claim that the application runs on a particular AWS service. AMPL execution and the durable agent worker are separate responsibilities even when both can be initiated from the same canvas.

CAT / EnergyETA — source architectureImplemented responsibilities visible in source; deployment is not independently verified.CAT / EnergyETA — source architectureSOURCE-BACKED • Repository snapshot, not live infrastructure verificationNext.js canvasOrganization + graph clientsModel editing + agent UIFastAPI scope checksOrganization / project accessGraph revision boundariesMongoDB / BeanieModels, runs and eventsDurable application stateLease-based AI workerClaim + heartbeat + retryGraph locks and recoveryApproval + tool executionRisk policy + expiry checksRevision-aware mutationsAMPL optimizationModel → solver → run recordStatus, values and logsArrows show the narrated workflow; boxes group responsibilities, not network boundaries.
Implemented responsibilities visible in source; deployment is not independently verified. Open editable SVG

The second diagram is a proposed AWS hosting reference. It retains MongoDB compatibility rather than treating a database substitution as trivial. A managed MongoDB deployment reachable from AWS would need its own selection and connectivity decision. ECS services could host the API, lease-based worker and solver processes, with appropriate isolation for solver dependencies. Those hosting choices are proposals, not facts about the inspected deployment.

CAT / EnergyETA — proposed AWS referenceProposed hosting or migration design, separate from the source-backed architecture.CAT / EnergyETA — proposed AWS referencePROPOSED REFERENCE • Not a deployed-system claimWeb delivery on AWSStatic / Next.js hostingAuthenticated applicationECS API serviceFastAPI application runtimeOrganization-scoped APIsMongoDB deploymentCompatible durable storeHosting choice still requiredECS worker servicePreserve claims + heartbeatsProvider access by policyApproval + audit boundaryPersist decisions and eventsCloudWatch for operationsIsolated solver runtimeAMPL dependencies + licenceExplicit availability checksArrows show the narrated workflow; boxes group responsibilities, not network boundaries.
Proposed hosting or migration design, separate from the source-backed architecture. Open editable SVG

POC walkthrough: build, approve, interrupt

The following uses a fabricated organization and a small energy-balance example. It is a proposed local acceptance walkthrough, not a live demo or a promise of commercial savings. All sample capacities, demand and costs are synthetic.

  1. Model a bounded scenario. Create a fictional project with two supply nodes and one demand node. Use sample capacities of 40 and 60 units and demand of 70 units. Add a balance equation and a cost-minimization objective, stating units and bounds before running anything.
  2. Check scope and revision. Load the graph through an authorized organization member. Attempt the same access from another organization and expect rejection. Capture the graph revision used for the scenario; later results should be interpreted against that model state.
  3. Ask for a controlled action. Request an optimization through the assistant. The risky-tool policy includes run_optimization, template application and destructive graph operations. Inspect the proposed tool call and approve or reject it through the supported decision flow.
  4. Prove recovery boundaries. In a disposable test environment, stop the worker during a run and allow its lease to expire. Reclaim the run and inspect attempt counts, persisted events and mutation state. Repeat with an intervening graph edit; unsafe recovery must stop rather than silently apply an outdated mutation.

A durable worker with human control

Agent runs are persisted rather than being owned only by an open browser request. The worker claims queued or expired runs atomically, increments an attempt count and attaches a worker identifier, claim token and lease expiry. A heartbeat refreshes ownership. Before continuing, control checks can detect cancellation or a replaced claim. This prevents an old process from assuming it still has authority after another worker takes over.

Mutation recovery is deliberately conservative. The worker checks the recorded mutation state and graph revision. An applied mutation has an applied revision to recover from; a pending mutation whose base revision no longer matches the graph is rejected as unsafe. Graph locking complements these revision checks. Durable events with sequence information give the application a record to inspect after interruption, rather than relying on a transient chat transcript.

Approval is also server state. The service checks expiry when recording an approval decision; control is restricted to the creator or permitted administrative roles. The risky-tool list includes deleting graph entities, applying templates, replacing a graph, deleting optimization setups and running optimization. This makes approval specific to a tool action, with a recoverable record. It should not be reduced to a decorative confirmation dialog in the frontend.

Evidence, limits & delivery acceptance

Evidence comes from organization access controllers, the optimization controller and AMPL notes, agent policy and service code, worker recovery logic, and frontend API clients. These sources demonstrate substantial implementation boundaries, while leaving deployment status and current solver readiness unverified. No energy reduction, accuracy percentage, customer outcome or throughput number is asserted.

A delivery acceptance pack should distinguish a valid model from an infeasible one, a rejected approval from an expired one, and a failed provider request from a lost worker lease. It should also show which graph revision a run used. The result is an application where AI assistance can accelerate supported work while the organization retains control over the model and its consequential operations.

Stride / Ahmedabad

Bring the workflow into focus.

Discuss the business process, integration boundaries and acceptance evidence for your next application.

Talk to Stride →