A Next.js teaching site that follows the presentation flow directly:
- Build a minimal LangChain RAG path.
- Port the same retrieval core into a LangGraph-style workflow.
- Apply
InputGuardandOutputGuard, including a canary leak drill. - Track per-node cost and export CSV.
- Close with a six-section Architecture Decision Document.
The example product is a developer support assistant. It answers grounded product questions, blocks unsafe requests, and logs the reasoning trail so the audience can see why the system answered, reviewed, or blocked.
/is the guide and presentation map./workbenchis the live demo./addis the final Architecture Decision Document.
pnpm install
pnpm devOpen http://localhost:3000.
Create a local env file and add your key:
cp .env.example .env.localThen fill in:
OPENAI_API_KEY=your_key_here
OPENAI_MODEL=gpt-4.1-miniIf OPENAI_API_KEY is missing, the site falls back to the local workflow automatically.
If PINECONE_API_KEY and PINECONE_INDEX are missing, live mode still works by using a real in-memory vector index.
- The questions, source notes, and architecture copy all match the presentation phases.
- The same source corpus powers both the chain and graph flows, so the comparison stays fair.
- The workbench includes a built-in 10-question evaluation suite.
- Guardrails are visible as
InputGuardandOutputGuard, including a canary leak test. - Cost is tracked per node and can be exported as CSV from the UI.
- The ADD already follows a six-section structure with a chosen and rejected architecture.
app/page.tsxexplains the five presentation phases.components/demo-shell.tsxis the main phase-based workbench UI.app/api/demo/route.tsserves the live result, evaluation overview, and audit history.lib/demo-engine.tsruns the local LangChain-style and LangGraph-style flows.lib/live-runtime.tsruns the real LangChain and LangGraph workflows, live evaluation suite, and retrieval backends.lib/demo-data.tscontains the source notes, phase content, evaluation suite, and ADD text.docs/architecture-decision-document.mdcontains the written ADD.