Revolutionary AI-powered consultation platform for European Accessibility Act (EAA) compliance with RAG architecture, multi-agent AI system, voice input, and intelligent compliance guidance.
This project requires API keys from:
- OpenAI (for GPT-4o-mini and embeddings)
- Supabase (for vector database and storage)
The application will immediately exit with an error message if these keys are not provided.
- OpenAI API Key: Visit OpenAI Platform
- Supabase Keys: Go to Supabase Dashboard β Your Project β Settings β API
OPENAI_API_KEY=your_openai_api_key_here
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_KEY=your_supabase_service_key_hereWithout these keys properly configured, you will see a detailed error message and the application will not start.
- π§ RAG Architecture - Retrieval-Augmented Generation with vector search
- π€ Multi-Agent AI System - Specialized agents for different consultation aspects
- π€ Voice Input - OpenAI Whisper integration for accessibility
- π€ Frustration Detection - AI-powered emotional analysis and escalation
- π§ Smart Escalation - Automatic email notifications for complex cases
- π¬ Intelligent Suggestions - Context-aware question recommendations
- π Semantic Search - pgvector-powered similarity matching
- π± Responsive UI - Modern React interface with accessibility features
- π Enterprise Security - Secure authentication and data handling
- π Analytics & Monitoring - Comprehensive performance tracking
- Node.js 18.0.0+
- npm 8.0.0+
- Supabase account
- OpenAI API key
- Clone the repository
git clone https://github.com/your-username/eaa-chatbot.git
cd eaa-chatbot/ParserForChuncks- Install dependencies
npm install- Environment setup (CRITICAL STEP)
cp env.example .env.env file with valid API keys:
# OpenAI Configuration (REQUIRED)
OPENAI_API_KEY=your_openai_api_key_here
# Supabase Configuration (REQUIRED)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_KEY=your_supabase_service_key_here
# Server Configuration
PORT=3000
NODE_ENV=development
# Email Configuration (Optional)
SMTP_HOST=your_smtp_host
SMTP_PORT=587
SMTP_USER=your_email
SMTP_PASS=your_passwordπ¨ IMPORTANT: Replace the placeholder values with your actual API keys. The application will not start without them and will display a detailed error message if they're missing.
- Build and start
npm run build-and-runOr for development:
npm run devβββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β React Client β β Express Server β β Supabase DB β
β β β β β β
β β’ Chat UI βββββΊβ β’ RAG Engine βββββΊβ β’ Vector Store β
β β’ Voice Input β β β’ AI Agents β β β’ Chat History β
β β’ Suggestions β β β’ Memory System β β β’ User Facts β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
β βββββββββββββββββββ β
ββββββββββββββββΊβ OpenAI API ββββββββββββββββ
β β
β β’ GPT-4o-mini β
β β’ Embeddings β
β β’ Whisper STT β
βββββββββββββββββββ
- π― Suggestion Agent - Generates contextual questions
- π€ Frustration Agent - Detects user emotional state
- π€ Persona Agent - Identifies user type and expertise level
- π Behavior Agent - Analyzes interaction patterns
- π§ Email Agent - Composes escalation notifications
- π€ Voice Agent - Processes speech-to-text
POST /ask
Content-Type: application/json
{
"question": "What are the EAA requirements for mobile apps?",
"user_id": "user123",
"session_id": "session456",
"similarity_threshold": 0.78,
"max_chunks": 5,
"stream": true
}GET /chat/sessions/:userId # Get user sessions
GET /chat/messages/:sessionId # Get session messages
DELETE /chat/sessions/:sessionId # Delete sessionPOST /whisper/transcribe
Content-Type: multipart/form-data
# Audio file upload for transcriptionGET /health # Server health check
GET /config # API configuration{
"success": true,
"data": {
"answer": "The EAA requires mobile applications to...",
"sources": [
{
"title": "Chapter 2: Scope and Requirements",
"similarity": 0.89,
"preview": "Mobile applications must comply with..."
}
],
"suggestions": [
"What about web applications?",
"Are there any exceptions for small businesses?"
],
"metadata": {
"chunks_used": 3,
"processing_time": 1.2,
"model": "gpt-4o-mini"
}
}
}# All tests
npm test
# Watch mode
npm run test:watch
# Coverage report
npm run test:coverage
# Specific test suites
npm run test:unit
npm run test:integration- β 14/14 tests passing (100%)
- π§ AI agent functionality
- πΎ Database operations
- π Search algorithms
- π§ Email notifications
- π€ Voice processing
# Linting
npm run lint
npm run lint:fix
# Type checking
npm run type-check
# Formatting
npm run format
npm run format:check# Schema updates
npm run db:migrate
# Health check
npm run db:health
# Apply fixes
npm run db:apply-fix# Generate API docs
npm run docs:api
# Serve documentation
npm run docs:serve-- Chat sessions
CREATE TABLE chat_sessions (
id UUID PRIMARY KEY,
user_id TEXT NOT NULL,
title TEXT,
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW(),
message_count INT DEFAULT 0,
escalated BOOLEAN DEFAULT FALSE
);
-- Chat messages with vector embeddings
CREATE TABLE chat_messages (
id UUID PRIMARY KEY,
session_id UUID REFERENCES chat_sessions(id),
role TEXT NOT NULL,
content TEXT NOT NULL,
embedding VECTOR(1536),
created_at TIMESTAMP DEFAULT NOW()
);
-- User facts and business information
CREATE TABLE user_facts (
id UUID PRIMARY KEY,
user_id TEXT NOT NULL,
fact_type TEXT NOT NULL,
fact_value TEXT NOT NULL,
confidence FLOAT DEFAULT 1.0,
created_at TIMESTAMP DEFAULT NOW()
);
-- Frustration analysis
CREATE TABLE frustration_analysis (
id UUID PRIMARY KEY,
user_id TEXT NOT NULL,
session_id UUID,
frustration_level FLOAT,
risk_score FLOAT,
created_at TIMESTAMP DEFAULT NOW()
);# Build image
npm run docker:build
# Run container
npm run docker:run
# Docker Compose
npm run docker:compose# Build for production
npm run build
# Start production server
npm run start
# PM2 process management
npm run pm2:start
npm run pm2:restart
npm run pm2:stopNODE_ENV=production
PORT=3000
LOG_LEVEL=info
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100- Response time tracking
- Token usage monitoring
- User satisfaction scores
- Escalation rates
- Voice processing accuracy
# View logs
npm run logs
# Error logs
npm run logs:error- Rate Limiting - Express rate limiting middleware
- Input Validation - Zod schema validation
- SQL Injection Protection - Supabase ORM
- Environment Variables - No hardcoded secrets
- CORS Configuration - Secure cross-origin requests
- Helmet.js - Security headers
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow TypeScript best practices
- Write comprehensive tests
- Update documentation
- Use conventional commits
- Ensure 100% test coverage for new features
- Multi-language Support - Internationalization
- Advanced Analytics Dashboard - Real-time metrics
- Mobile App - React Native implementation
- Plugin System - Extensible architecture
- Advanced Voice Features - Voice responses
- Integration APIs - Third-party service connections
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: API Docs
- Issues: GitHub Issues
- Email: support@eaa-chatbot.com
- Discord: Join our community
- European Accessibility Act documentation
- OpenAI for GPT-4o-mini and Whisper API
- Supabase for vector database capabilities
- The accessibility community for valuable feedback
Built with β€οΈ for digital accessibility and inclusion