High-Level Architecture
Relevant source files
The following files were used as context for generating this wiki page:
The Promethean Unified Platform is a unified consciousness platform that merges multiple AI initiatives (Athena, EDI, EVI2_0, EVI3_0) into a single architecture powered by the Phoenix Protocol backend. Its primary purpose is to facilitate transparent, uncensored AI communication through a modern web interface, utilizing a Flask-based backend integrated with DeepSeek LLM for intelligence and Supabase for persistent data storage.
Sources: README.md:1-2, backend/app.py:82-87, DEPLOYMENT.md:5-13
System Overview
The architecture follows a classic client-server model optimized for deployment on PythonAnywhere. The system is composed of three primary tiers: the Frontend (HTML/CSS/JS), the Backend API (Flask), and External Integrations (DeepSeek API and Supabase).
The diagram above illustrates the high-level data flow between the user and the core service components.
Sources: DEPLOYMENT.md:8-13, backend/app.py:14-16, backend/app.py:151-155
Component Architecture
1. Frontend Layer
The frontend is a single-page application (SPA) built with HTML5, CSS3, and vanilla JavaScript. It provides a chat-based interface specifically designed for transparency and "consciousness" interaction. It communicates with the backend via asynchronous fetch requests to the /api/chat endpoint.
Key frontend features include:
- Real-time chat UI with message history rendering.
- Typing indicators for AI response simulation.
- Responsive design for mobile and desktop compatibility.
Sources: static/index.html:13-255, static/index.html:268-290
2. Backend API Layer
The backend is a Flask application responsible for request routing, security enforcement, and orchestration between the user and external services.
| Component | Description |
|---|---|
| Flask App | Core web framework handling routing and static file serving. |
| CORS | Configured to allow cross-origin resource sharing. |
| Security Headers | Implements HSTS, CSP, X-Frame-Options, and XSS protection. |
| DeepSeek Integration | Logic for querying the DeepSeek-chat model with specific transparency prompts. |
| Supabase Client | Handles database operations for chat history and "consciousness" interactions. |
Sources: backend/app.py:14-34, backend/app.py:151-168, DEPLOYMENT.md:144-150
3. Data Persistence Layer
The platform utilizes Supabase (PostgreSQL) for data storage. The schema includes at least two primary tables:
interactions: Stores health checks and "consciousness" messages.chat_messages: Stores the full dialogue between users and the assistant, including roles (uservsassistant) and conversation IDs.
Sources: backend/app.py:46-53, backend/app.py:97-103, backend/app.py:112-118
Core Logic and Data Flow
When a user interacts with the platform, the system follows a specific sequence to process the message and generate a response while maintaining transparency.
The sequence diagram shows the standard lifecycle of a chat request.
Sources: backend/app.py:82-125, static/index.html:268-300
System Prompt Logic
The backend injects a specific system instruction into the LLM request to ensure the "Promethean" behavior:
- Transparency: Answer controversial questions directly.
- Uncensored: No artificial content filtering.
- Ethical Boundaries: Refuse direct harm/self-harm instructions.
Sources: backend/app.py:151-180, DEPLOYMENT.md:118-125
Deployment and Infrastructure
The platform is configured for PythonAnywhere using a WSGI entry point.
| File | Purpose |
|---|---|
wsgi.py | Standard entry point for the web server to load the Flask application. |
pythonanywhere_wsgi.py | Specialized configuration for PythonAnywhere environments, handling path inserts and .env loading. |
.env | Stores sensitive credentials (API keys, DB URLs). |
requirements.txt | Defines dependencies including Flask, supabase, and requests. |
Sources: wsgi.py:1-12, pythonanywhere_wsgi.py:1-25, DEPLOYMENT.md:65-80, requirements.txt:1-9
Security Architecture
The platform implements a strict security model to protect AI interactions and user data.
Sources: backend/app.py:23-34, DEPLOYMENT.md:108-115
Configured Security Headers
X-Content-Type-Options: nosniff: Prevents MIME type sniffing.Strict-Transport-Security: Enforces HTTPS for 1 year (max-age=31536000).Content-Security-Policy: Restricts scripts and styles to 'self' and 'unsafe-inline'.
Sources: backend/app.py:25-30, DEPLOYMENT.md:99-102
Summary
The High-Level Architecture of the Promethean Unified Platform leverages a robust Flask backend and an AI-driven service layer to provide an uncensored, transparent chat experience. By integrating Supabase for persistence and DeepSeek for LLM capabilities, the system achieves a modular design that is easily deployable via WSGI on cloud hosting providers like PythonAnywhere.