Skip to content
←Back to projects

Project

Subleet - Document-Based Support Assistants

A customer-support assistant platform combining document retrieval, an assistant configuration wizard, and streamed responses through the OpenAI Assistants API.

View on GitHub
Team
2
Role
AI Engineer
Duration
07/2024–08/2025

Stack

  • Next.js
  • TypeScript
  • OpenAI API
  • Supabase
  • RAG
  • Clerk Auth
  • TailwindCSS
  • Python

Gallery

Subleet - Document-Based Support Assistants 1

Overview

Subleet is a two-person project for creating customer-support assistants from websites, PDFs, and documents. It combines document retrieval with the OpenAI Assistants API to generate responses based on an uploaded knowledge base.

I worked on the project as an AI Engineer. The application includes an assistant configuration wizard, streamed responses, and separate interfaces for end-users and administrators.

Application Features

  • Assistant configuration – Four-step setup: basics, advanced settings, custom instructions, and live preview.
  • Document retrieval – Vector search over uploaded content to provide context for responses.
  • Response streaming – Server-Sent Events for displaying responses as they arrive.
  • Content processing – A Python pipeline for scraping websites and splitting documents for model processing.
  • Access control – Separate interfaces for end-users and administrators, with tenant-level data isolation.
  • Version history – Assistant configuration history and rollback.

Technical Architecture

  • Frontend Stack

    • Next.js with App Router for the web application
    • TypeScript for application code
    • TailwindCSS for styling
    • Clerk authentication with multi-tenant support
  • AI & Vector Processing

    • OpenAI Assistants API for conversation management
    • Vector stores with file_search capabilities for document retrieval
    • Custom prompt compilation engine with preset configurations
    • Multi-model support (GPT-4o-mini, GPT-4.1-nano, GPT-4.1-mini)
  • Backend Infrastructure

    • Supabase for database and real-time subscriptions
    • Edge Functions for serverless AI processing
    • Encrypted API key management with AES-256
    • REST API for application operations
  • Content Pipeline

    • Python scraper with Selenium for dynamic content extraction
    • GPT-4o content analysis with token optimization
    • Automatic content chunking for large documents
    • Content preprocessing to reduce the amount of text sent to the model

Engineering Decisions

Assistant Builder System

The configuration wizard collects tone, use case, language preferences, and custom instructions. A prompt compilation system turns these settings into instructions for the OpenAI API.

Content Analysis Pipeline

Documents that exceed model token limits are split into chunks for processing. The pipeline uses GPT-4o to analyse the content and carries context across parts.

Data Isolation and Streaming

Supabase row-level security and Clerk authentication separate each tenant's data. Responses are streamed through Server-Sent Events, without requiring a WebSocket connection.

Outcome

The project brought document ingestion, assistant configuration, retrieval, and response streaming into one application. It also included tenant-level data isolation and version history for assistant settings.

The main engineering challenges were handling model token limits, isolating each tenant's data, and keeping assistant configurations consistent across versions.