Skip to content

Repository files navigation

OpsFlow AI

An AI-powered operations triage assistant. Paste an unstructured operational note — a voicemail summary, an email, a shift handoff — and OpsFlow AI returns a validated, structured triage record: summary, category, priority, recommended owner, next action, and concrete action items.

It's a small, focused demo of turning messy operational input into data an internal tool can route and act on.

Features

  • Single-screen internal-tool UI with skeleton loading, error, and reset states
  • Server-side LLM call — the API key never reaches the browser
  • Native OpenAI Structured Outputs constrained to a JSON schema
  • Zod re-validation of every model response before it's trusted or returned
  • Typed request/response contract shared between API route and client
  • Result rendered as a triage record, with one-click copy of the validated JSON
  • Three example inputs and a ⌘/Ctrl+Enter shortcut for a quick walkthrough
  • Input guards (length bounds, JSON validation) and human-readable error messages

Tech stack

Layer Choice
Framework Next.js (App Router) + React + TypeScript
Styling Tailwind CSS
LLM OpenAI Responses API (gpt-5.4-mini), low reasoning effort
Validation Zod
API Next.js Route Handler (POST /api/analyze)

How structured output is validated

  1. The /api/analyze route validates the incoming note (type, length bounds).
  2. lib/analyze.ts sends it to the OpenAI Responses API with zodTextFormat(OpsAnalysisSchema, …), so the model is constrained to the schema via native Structured Outputs. Reasoning effort and output tokens are kept low — this is a bounded extraction task.
  3. The response is parsed back through the same Zod schema on the server. If it doesn't conform, the request fails with a 502 rather than returning unverified data.
  4. The client receives a discriminated-union response ({ ok: true, data } | { ok: false, error }) and renders accordingly.

The Zod schema in lib/schema.ts is the single source of truth — it shapes the model request, guards the server boundary, and types the client.

Local setup

npm install
cp .env.example .env.local   # then add your OpenAI API key
npm run dev

Open http://localhost:3000.

Required environment variable

Variable Required Notes
OPENAI_API_KEY Yes Server-side only. Used by the /api/analyze route.
OPENAI_MODEL No Overrides the default model.

Privacy & demo limitations

This is a synthetic demo, not a production system. It has no authentication, no database, and no persistence — each request is stateless. It is intended for non-sensitive, illustrative operational data only. Do not paste real personal, patient, or confidential information. No compliance claims (HIPAA or otherwise) are made, and it is not built for or affiliated with any employer or client.

About

AI-powered operations workflow assistant that turns unstructured requests into structured, actionable tasks.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages