Skip to main content

Flowise vs OpenAI Separation

MOOD MNKY implements a clear architectural separation between chatflow/chatbot workflows (Flowise) and server-side AI processing (OpenAI).

Architecture

Environment Variables

Flowise

VariablePurpose
FLOWISE_BASE_URLFlowise instance root (e.g. https://flowise-dev.moodmnky.com)
FLOWISE_API_KEYBearer token for Flowise API
NEXT_PUBLIC_FLOWISE_HOSTClient-side (embed)
NEXT_PUBLIC_FLOWISE_CHATFLOW_IDDefault Dojo chatflow

Flowise S3/MinIO (hosted instance)

Set in Flowise .env, not in app. App proxies document store via FLOWISE_BASE_URL.
VariablePurpose
STORAGE_TYPEs3
S3_STORAGE_BUCKET_NAMEBucket name
S3_STORAGE_ACCESS_KEY_IDMinIO/S3 access key
S3_STORAGE_SECRET_ACCESS_KEYMinIO/S3 secret
S3_STORAGE_REGIONe.g. us-east-1
S3_ENDPOINT_URLe.g. https://s3-api-data.moodmnky.com
S3_FORCE_PATH_STYLEtrue for MinIO

OpenAI

VariablePurpose
OPENAI_API_KEYServer-side AI, fallback chat

Document Store

Flowise document store uses S3/MinIO for blob storage. The app proxies document store API requests to Flowise.

MNKY LABZ Storage Control Panel

Admins can manage MinIO/S3 buckets and objects at Platform → Storage (/platform/storage). Uses the same S3 env vars. See docs/PLATFORM-STORAGE.md for API overview and credential behavior.

App Proxy Routes

App RouteMethodPurpose
/api/flowise/document-store/storesGETList document stores
/api/flowise/document-store/stores/[id]GETGet store by ID
/api/flowise/document-store/upsert/[id]POSTUpsert documents (multipart)
/api/flowise/document-store/refresh/[id]POSTRe-process all documents
/api/flowise/document-store/vectorstore/queryPOSTRetrieval query
/api/flowise/document-store/loader/[storeId]/[loaderId]DELETEDelete loader

MNKY LABZ Document Store

App RoutePurpose
/api/labz/document-store/storesList stores (MNKY LABZ context)
/api/labz/document-store/upsert/[id]Upsert files (formula docs, knowledge base)

Flowise-MNKY Components

The components/flowise-mnky/ library provides Flowise-specific UI for the Dojo and MNKY LABZ:
  • FlowiseChatflowControlPanel — Chatflow selector, override config editor, document store upload
  • FlowiseOverrideConfigEditor — Structured + raw JSON editor for overrideConfig (documentStoreId, supabaseMetadataFilter, topK, systemMessage)
  • FlowiseDocumentUpload — Upload with profile_id metadata for Supabase vector store filtering
  • FlowiseStoreSelector — Document store picker
  • FlowiseChatUI — Wrapper around DojoFlowiseChatbot (Elements AI SDK)
See docs/FLOWISE-MNKY-COMPONENTS.md in the repo.

Packages

PackagePurpose
aiVercel AI SDK (streamText, useChat)
@ai-sdk/reactReact hooks for chat
@ai-sdk/openaiOpenAI provider
flowise-sdkFlowiseClient, createPrediction
flowise-embed-reactFlowise embed widget
@openai/agentsMulti-agent workflows (stub; requires Zod v4)

References

  • docs/AI-SEPARATION-REPORT.md — full report (repo)
  • docs/FLOWISE-SDK-INTEGRATION-NOTES.md — Flowise SDK notes (repo)