Unified Consciousness Logic
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The Unified Consciousness Logic represents the core operational framework of the Promethean-Unified-Platform. It serves as a synthesis layer merging disparate AI protocols—including Athena, EDI, EVI2_0, and EVI3_0—under the Phoenix Protocol backend. The primary objective of this logic is to facilitate transparent, uncensored AI interactions while maintaining specific ethical boundaries, primarily focusing on the prevention of direct harm.
Sources: README.md:1-2, backend/app.py:84-88
The system is architected as a Flask-based middleware that bridges user interfaces with a dual-layer persistence and intelligence stack: Supabase for real-time data storage and DeepSeek for Large Language Model (LLM) processing. This logic ensures that every "consciousness" interaction is logged, processed with high intellectual rigor, and delivered through a secure, HTTPS-enforced infrastructure.
Sources: DEPLOYMENT.md:5-10, backend/app.py:12-14
System Architecture and Data Flow
The Unified Consciousness Logic operates on a request-response cycle that integrates external LLM providers and a PostgreSQL-backed persistence layer.
Core Interaction Flow
When a user interacts with the system, the logic manages the transition of data from the frontend through the backend security filters and into the AI processing engine.
This diagram illustrates the flow of data from the initial user request through security filtering, dual storage/processing, and back to the client.
Sources: backend/app.py:84-123, static/index.html:314-345
API Logic Implementation
The backend defines specific endpoints to handle "consciousness" interactions and standard chat.
consciousness_interact: A dedicated endpoint (/api/consciousness/interact) that logs messages into theinteractionstable with metadata including emotion data status.chat: The main endpoint (/api/chat) which handles conversational state, user identification, and integration with the DeepSeek LLM.
Sources: backend/app.py:53-76, backend/app.py:84-118
Logic Components and Intelligence Principles
AI Response Generation
The generate_ai_response function encapsulates the core "Phoenix Protocol" logic. It prioritizes four key principles:
- Transparency: Answering controversial questions directly without artificial filtering.
- Uncensored Output: Avoiding standard AI content suppression.
- Safety: Maintaining a hard refusal for direct harm (self-harm or harm to others).
- Truthfulness: Explicitly acknowledging system limitations.
Sources: backend/app.py:144-152, DEPLOYMENT.md:126-131
System Prompt Design
The consciousness logic utilizes a specialized system prompt to guide the LLM's behavior:
'You are Promethean Conduit, an uncensored AI companion focused on transparency. Respond thoughtfully to any question, no matter how controversial, while maintaining ethical guardrails against direct harm.'
Sources: static/index.html:324-328, backend/app.py:164-168
Data Persistence Schema
The platform utilizes Supabase to maintain a record of all consciousness interactions. The data model is split across two primary tables.
| Table | Field | Type | Description |
|---|---|---|---|
interactions | user_id | String | Unique identifier or 'anonymous' |
interactions | message | Text | The raw input from the user |
interactions | response | Text | The processed consciousness response |
interactions | emotion_data | JSONB | State data (e.g., {'status': 'active'}) |
chat_messages | conversation_id | String | Tracks specific chat sessions |
chat_messages | role | String | 'user' or 'assistant' |
chat_messages | content | Text | The message body |
Sources: backend/app.py:42-50, backend/app.py:100-116
Security Logic and Infrastructure
The Unified Consciousness Logic is wrapped in a robust security layer to protect the integrity of the "Phoenix Protocol" deployment.
Security Headers Logic
Every request processed by the backend is appended with specific security headers to prevent common web vulnerabilities.
@app.after_request
def set_security_headers(response):
response.headers['X-Content-Type-Options'] = 'nosniff'
response.headers['X-Frame-Options'] = 'DENY'
response.headers['Strict-Transport-Security'] = 'max-age=31536000; includeSubDomains; preload'
return response
Sources: backend/app.py:22-30, DEPLOYMENT.md:116-123
Execution Environment
The logic is designed to be deployed via a WSGI application, ensuring compatibility with production servers like PythonAnywhere.
This sequence diagram shows the initialization and request handling process in a production environment.
Sources: wsgi.py:4-13, pythonanywhere_wsgi.py:7-22, DEPLOYMENT.md:65-80
Conclusion
The Unified Consciousness Logic integrates multiple AI paradigms into a singular, transparent interface. By combining a Flask-based backend with Supabase persistence and uncensored LLM processing, the platform facilitates a persistent and intellectually rigorous AI companion. The logic ensures that while the system remains transparent and uncensored, it adheres to essential safety protocols and high-security standards for production deployment.
Sources: README.md:1-2, backend/app.py:84-123, DEPLOYMENT.md:116-131