The problem

Staff needed a practical way to use AI with company information. A consumer chat account did not provide the company sign-in, access controls, document handling, and shared knowledge the organization needed.

What I built

I built an internal chat application that connects staff to approved AI providers through one interface. It combines company sign-in, encrypted conversation storage, document processing, and department-specific knowledge bases.

The core decision was to build a shared application around the organization’s access and data requirements. Keeping AI providers behind that application made it possible to add models without asking users to switch tools.

The result

User growth in the first six months
147%
Estimated equivalent annual vendor subscription cost
$85K to $200K

Staff gained a single place to use AI with documents and department knowledge. The platform supports multiple providers, conversation history, and exports within the company’s access controls.

Based on 350+ active users, publicly available ChatGPT Business pricing, and estimated ChatGPT Enterprise pricing. Internal development, infrastructure, support, and AI usage costs are excluded.

Under the hood

The architecture, integrations, and implementation behind the application.

Architecture and security

Backend Infrastructure

  • Node.js/Express server with enterprise middleware chain
  • Azure AD/Entra ID authentication with role-based access control
  • Azure Cosmos DB for encrypted data persistence
  • AES-256-GCM encryption for stored data
  • Azure Cognitive Search for intelligent document indexing
  • Multi-AI provider integration with automatic load balancing

Frontend Experience

  • Vanilla JavaScript with modern ES6+ features
  • Responsive design supporting dark/light themes
  • Real-time chat interface with markdown and code highlighting
  • Document management system with drag-and-drop uploads
  • Export capabilities in multiple formats (PDF, DOCX, HTML, MD, TXT)
  • Personal prompt library for productivity enhancement

Security Implementation

  • Stored-data encryption using AES-256-GCM
  • CORS protection and secure middleware chain
  • Input sanitization and request validation
  • Rate limiting and comprehensive error handling
  • Encrypted session management
  • Department-specific access controls
Features and workflows

AI Model Integration

Multiple AI Providers: Azure OpenAI (GPT-4o, GPT-4o mini), Anthropic Claude (3.5 Haiku, 3.5 Sonnet, 3.7 Sonnet, 4.0 Sonnet, 4.0 Opus), Mistral AI

Intelligent Fallback: Automatic model switching for optimal performance

Department-Specific GPTs: Tailored interfaces for different organizational units

Context-Aware Processing: Smart integration of document content with conversations

Document Processing Engine

Multi-Format Support: PDF, Word, Excel, CSV, HTML, and plain text

Semantic Chunking: Intelligent document segmentation for better context

Automatic Summarization: AI-powered document analysis

Encrypted Storage: Secure document persistence with Azure integration

Enterprise Data Management

Conversation Persistence: Complete chat history

User Settings Sync: Personalized configurations across sessions

Analytics Dashboard: Usage tracking and performance metrics

Backup & Export: Comprehensive data export in multiple formats

Implementation details

Core Services Architecture

  • EncryptionService → AES-256-GCM encryption/decryption
  • DocumentSearchService → Azure Search index operations
  • ConversationService → Chat persistence and retrieval
  • DocumentProcessingUtils → Multi-format file processing
  • AnalyticsService → Usage metrics and performance tracking
  • OpenAISearchService → Web search integration
  • PromptLibraryService → Personal prompt management

Security & Middleware Layer

  • AuthMiddleware: Session management and user authentication
  • DocumentCleanupMiddleware: Automated file lifecycle management
  • Rate Limiting: API protection and resource management
  • Input Validation: Comprehensive request sanitization

API Design

  • RESTful Architecture: Clean, scalable endpoint design
  • Conversation Management: Full CRUD operations with encryption
  • Document Management: Secure upload, processing, and retrieval
  • Search Integration: Both internal knowledge base and web search
  • Analytics & Reporting: Usage statistics and performance monitoring
Technology stack

Backend

  • Node.js
  • Express.js
  • Azure Cosmos DB
  • Azure OpenAI
  • Azure Cognitive Search

Frontend

  • Vanilla JavaScript
  • CSS3
  • HTML5
  • Marked.js
  • Prism.js

Security

  • AES-256-GCM
  • Azure AD/Entra ID
  • CORS
  • Rate Limiting

AI Services

  • Azure OpenAI
  • Anthropic Claude API
  • Mistral AI API

Working through something similar?

Start with a free 30-minute introduction.

Discuss a project