Back to Case Studies
Flagship Project

AI Assistant Sandbox Architecture

A production-ready AI deployment system that moves beyond simple "chatbots" to handle complex business state, knowledge retrieval, and action execution.

AI Assistant Sandbox - Main Chat Interface

Knowledge Ingestion

Automated scraping and chunking of website content into vector embeddings.

Supabase Backend

Stateful session management, logging, and rigid data structure enforcement.

n8n Orchestration

Complex logic routing, email drafting, and third-party API integration.

The Problem

Most "AI Agents" are just wrappers around ChatGPT.

They lack context, cannot remember users, and fail at real actions.

✗No persistent memory across sessions
✗Cannot execute real-world actions
✗No knowledge of the client's business
✗Generic responses with no personality
01

Knowledge Pipeline

Automated Ingestion & Embedding

The AI doesn't guess. It retrieves.

Every response is grounded in the client's actual business content.

Website Scraping & Chunking

User inputs their website URL. The system automatically scrapes all pages, extracts meaningful text, and splits it into semantically coherent chunks optimised for retrieval.

URL → Scraper → Text Extraction → Chunking → Embedding → Supabase Vector Store

Vector Embedding & Retrieval

Each chunk is embedded via OpenAI and stored in Supabase's pgvector extension. At query time, the system performs similarity search to retrieve only the most relevant context.

OpenAI EmbeddingspgvectorCosine SimilarityContext Window Management
Document splitter workflow showing automated knowledge ingestion and embedding pipeline
n8n workflow — Document splitting & vector embedding pipeline
02

Orchestration Layer

n8n Routing & Action Execution

The orchestration layer determines what the AI should do, not just what it should say.

Chat Mode vs Action Mode

The system routes between conversational responses and discrete action execution. When the AI detects booking intent, email requests, or data queries, it switches to action mode.

Chat Mode

  • Contextual conversation
  • Knowledge retrieval
  • Personality-aware responses

Action Mode

  • Booking execution
  • Email drafting & sending
  • Data capture & logging

Intent Detection & Routing

n8n workflows handle the decision tree: detect intent, validate required fields, format payloads, and execute API calls — all without exposing complexity to the user.

Booking IntentEmail DraftingData CollectionFAQ RoutingEscalation Logic
Main chat assistant n8n workflow with intent routing, action execution, and knowledge retrieval
n8n workflow — Main chat assistant with intent routing & action execution
03

State Management

Session Persistence & Memory

The AI remembers who you are, what you asked, and what happened.

Sessions are persistent, not throwaway.

Supabase Session Architecture

Every conversation is backed by a structured Supabase record. Chat history, user metadata, collected form data, and action logs are all stored and retrievable across sessions.

  • ›Session-scoped chat history
  • ›User metadata persistence
  • ›Action audit trail
  • ›Cross-session context recall

Data Structure Enforcement

Rigid schemas ensure that collected data (names, emails, phone numbers, booking preferences) is always structured and query-ready — never dumped as raw text.

Row-level security ensures each client can only access their own data. No cross-contamination between deployments.

04

Deployment & Results

Production Outcomes

48 Hours
Deployment Time
100%
Client Data Ownership
✓Full white-label deployment
✓Client-specific personality & tone
✓Automated knowledge refresh
✓Zero vendor lock-in
FAQ submission workflow showing automated question handling and response generation
FAQ submission workflow
Link generator workflow for creating shareable deployment links
Link generator workflow

Summary

This isn't a chatbot widget.
It's a deployable AI employee with memory, knowledge, and the ability to act.

Scrape. Embed. Retrieve.

Route. Execute. Log.

Deploy in 48 hours.

Snedker Automations Assistant