How openai/openai-support-agent-demo works
Project type and purpose
• This is a full-stack Next.js demo application called “Customer Support Agent with Human in the Loop.”
• It provides two UIs (customer and agent), a set of REST-style API endpoints, business logic for orchestrating AI calls, and integrations with OpenAI’s Responses API and vector store (file search).
File structure
• Top-level directories:
– app/ – Next.js App Router: React pages (UI) and serverless API routes under app/api
– components/ – Reusable React components for chat, panels, tool calls, etc.
– config/ – Configuration for prompts, demo data, function definitions, tool listings
– lib/ – Core logic for the AI assistant, tool invocation, utilities
– stores/ – Client-side state management (Zustand hooks)
– public/ – Static assets: FAQ and knowledge base markdown, images
• Key patterns:
– API layer: each resource (orders, tickets, users, vector_stores, etc.) lives under app/api
– Business logic separated into config/functions.ts and lib/tools
– Frontend UI split between app pages and components/ui sub-folder
• Configuration and build files: next.config.mjs, tsconfig.json, tailwind.config.ts, package.json
README for additional insights
• Describes AI-enabled features: multi-turn chat, function calling, streaming, suggested actions, vector store file search
• Specifies “Human in the Loop” flow: AI proposes responses/actions, human agent confirms
• Notes customization points: config/constants.ts, config/tools-list.ts, config/functions.ts, config/demoData.ts, and own backend endpoints