Building a SaaS-Orchestrated GPT with Plugin Intelligence and Domain Awareness
Overview
As AI assistants evolve beyond general-purpose chatbots, the ability to orchestrate APIs, detect user intent, and deliver structured output becomes essential. This guide outlines the architecture and implementation of a SaaS-Orchestrated GPT system — a modular, extensible GPT tailored to route user prompts to the correct SaaS plugin (like Canva, Notion, or Stripe), adapt to user domains (such as marketing or finance), and return rich, localized responses.
Why We Built This
General-purpose AI tools are not designed to interface directly with SaaS platforms or understand nuanced user context. We needed a GPT that could:
Parse vague or specific natural language (e.g., "Make a flyer for my launch")
Detect intent and classify the domain (marketing, finance, education, etc.)
Choose the correct plugin for the task (Canva for visual, Stripe for financial, etc.)
Return visual or structured responses, such as rendered markdown tables or dynamic summaries
Adapt language and spelling to locale (US vs UK English)
Architecture
The project is organized with modular responsibility across folders:
saas-orchestrator-gpt/
├── config/ → System instructions and mappings
├── knowledge/ → Domains, plugins, tone, spelling rules
├── src/ → Orchestration engine: input → classify → plugin → render
├── plugin-manifest/ → OpenAI-compatible plugin interface files
├── tests/ → Mocks, test scenarios, and test utilitiesEach folder plays a critical role in separating business logic, domain knowledge, plugin handling, and test coverage.
Plugin Integrations
This GPT orchestrator supports routing requests to various SaaS APIs based on prompt intent:
Canva: Used for design generation, including social media posts, flyers, resumes, and infographics.
Notion: Generates structured content such as proposals, reports, or educational documents.
Stripe: Handles queries involving invoices, balances, and financial summaries.
Plugin schemas are defined in plugin-schema.ts, and loaded via pluginLoader.ts.
Domain Classification and Behavior
The system classifies user prompts into specific domains using domainClassifier.ts, guided by:
domains.json: Defines supported domains like marketing, business, finance, etc.domain-guidelines.yaml: Maps domains to plugins, tone, and clarification logic
Example classification flow:
Input PromptDetected DomainRouted Plugin"Design a flyer for my coffee shop"marketingcanva"Generate a client proposal for our project"businessnotion"List unpaid invoices for November"financestripe
Locale and Tone Adaptation
Locale and tone are dynamically applied using:
spellings.yamlandlocale-helpers.ts: Apply regional spelling rules (e.g., "color" vs "colour")tone-guidelines.yaml: Adapts tone for each domain (e.g., formal for business, friendly for personal use)locale-settings.json: Establishes default language settings
This allows the same GPT to adapt to British or American English while also changing tone based on audience or domain.
Markdown Output Rendering
All plugin responses are converted to markdown using resultFormatter.ts and markdownBuilder.ts, enabling:
Rendered design previews from Canva
Structured financial summaries from Stripe
Cleanly formatted Notion-style documents
Markdown responses are optimized for chat UIs, with dynamic layouts that change based on the number of results (e.g., side-by-side, single column, grid).
Testing Framework
Testing is built into the project from the start using:
test-scenarios.yaml: Real user-like prompts with expected domain, plugin, and type outcomesmock-api-responses.json: Simulated payloads from Canva, Stripe, and Notiontest-setup.ts: Initializes mocks, environment, and plugin modescaffold.ts: Auto-generates the full file structure usingfolder-structure.json
This ensures test coverage for classification, plugin responses, fallback logic, and formatting.
CLI and Project Scaffold
To streamline onboarding, we created:
scaffold.ts: A generator that builds the full folder and file structure fromfolder-structure.jsonproject-tree.yaml: A human-readable project maptsconfig.template.jsonandpackage.template.json: TypeScript starter configurations
Future enhancement: npx create-saas-gpt to scaffold the project with one command.
Key Features
Modular GPT architecture with clearly defined responsibilities
Plugin orchestration for Canva, Notion, Stripe (with easy extensibility)
Domain and design-type classification based on user language
Locale-specific tone, spelling, and formatting
Clarification prompts for vague input
Markdown UI rendering for rich output
Mock-driven tests and integration safety
What’s Included
Getting Started
To initialize the project locally:
Install dependencies:
npm installGenerate folders and stubs:
npx ts-node scaffold.tsStart development:
npm run devYou can now pass prompts into your GPT system and simulate plugin responses locally using mocks or connect to real APIs.
Next Steps
In future iterations, we plan to:
Add support for more SaaS plugins (e.g., Google Docs, Trello)
Generate full prompt histories for analytics
Create a live dashboard to inspect routing and plugin usage
Introduce automatic fallback suggestions for unsupported domains or missing data
Conclusion
This GPT orchestration framework turns a language model into a powerful interface for multiple SaaS platforms — intelligently routing, formatting, and responding to user needs with real, actionable output.
It is modular, testable, and extensible — designed to evolve with your business use cases.