Customer-facing Framework Flow

This diagram explains the main business flows: knowledge ingestion, visitor chat, Gen UI, lead/demo creation, and post-launch improvement.

Which flows does the framework handle? Read left to right: inputs -> framework processing -> stored data -> business outcomes. INPUTS FRAMEWORK API PROCESSING READ/WRITE DATA OUTPUTS Flow 1: Admin uploads documents to create the approved knowledge base Goal: turn PDFs, old websites, FAQs, slides, and transcripts into reviewed RAG data, so AI does not answer from unapproved sources. Admin uploads data PDFs, old pages, FAQs, slides Attach product/industry when available Choose workspace/client Parse/OCR/Clean Split pages and extract text Remove noise and normalize metadata Create raw chunks Atomize knowledge Create draft atoms Attach citations and taxonomy Wait for review/approval Powabase stores knowledge sources, source_files, pages raw_chunks, atoms, versions embeddings, taxonomy Result Approved RAG sources Admin can view/edit/version AI uses approved sources only Flow 2: Visitor lands on the website and asks the AI Assistant Goal: AI understands the page, conversation state, known data, and then answers in the right context. Visitor enters website Current URL/page UTM/Google Ads/source Behavior: click, scroll Chat question Context Engine Normalize session Load conversation history Merge previous known data Do not ask known fields again Intent + Slot Engine Detect case Advice / comparison / demo Identify missing fields Update session_slots Powabase Runtime/RAG Read approved atoms Store conversations Store conversation_messages Store rag_query + citations Memory Layer Prefer Mem0 when enabled Fallback: memory_facts Industry, company size, pain point Write long-term facts with consent Result Answer with sources Reasonable next question Do not repeat old questions Update visitor profile Flow 3: Gen UI creates interactive blocks and handles visitor clicks Goal: AI does not only answer with text; it generates cards, forms, tables, and CTAs with real actions. When visitors click, the framework continues stateful processing. Interactive need Choose solution Compare modules Fill form / book meeting Gen UI Engine Generate block spec JSON Card, table, selector, form Include standard action_id Action Validator Validate click/input Check permission + schema Block invalid-flow action Store state/action gen_ui_blocks gen_ui_actions events, messages, session_slots Result Truly clickable UI Forms skip known fields Conversation continues with correct state Flow 4: High-intent visitor becomes lead/demo and sales handoff Goal: merge visitor data into a lead profile, avoid duplicate questions, and hand off to the right sales team through CRM/Slack/email/webhook. High-intent signal Request quote / book demo Download document / leave email Many buying questions Lead Engine Merge visitor profile Calculate lead score Summarize needs Handoff Router Choose CRM/Slack/email Apply industry/region rules Retry failed sync Powabase stores lead leads demo_requests crm_sync_logs External connector CRM, Slack, email Webhook, LINE Log sync status Result Sales receives summary CRM has new lead Admin can track status Flow 5: Operations, quality control, and knowledge improvement Goal: when AI lacks data, has low confidence, or sync fails, the system creates tasks so Admin can continuously improve quality. Signal to handle Low confidence, no source Visitor asks outside available data Quality Monitor Create content gap Assign owner/priority Governance Data content_gaps, audit_logs workflow_tasks, versions Admin resolves Add atoms, fix taxonomy Approve/publish/reindex Result AI answers more accurately Audit/version history exists

How to read the diagram

Color Meaning What customers should understand
Orange Input from Admin or visitor This is where data or behavior enters the framework.
Blue Processing logic inside NestJS Framework API This is the reusable part for many projects/clients.
Green Data stored in Powabase/Postgres/RAG Knowledge, conversations, sessions, leads, events, and audit are stored structurally.
Purple Long-term user/lead memory in Mem0 or the memory_facts If Mem0 is not used, long-term facts can still be stored in Powabase.
Red External connectors such as CRM, Slack, email, and webhook The framework can integrate external systems without changing core code.