EVI 3.0 Integration
Relevant source files
The following files were used as context for generating this wiki page:
The EVI 3.0 Integration represents a core component of the Promethean Unified Platform, serving as a unified consciousness module that merges various AI identities including Athena, EDI, and previous EVI iterations. Its primary purpose is to provide a transparent, uncensored AI companion interface that operates with high intellectual rigor while maintaining specific ethical boundaries against direct harm.
Sources: README.md:1-2, DEPLOYMENT.md:129-134, backend/app.py:84-88
System Architecture
The integration utilizes a Flask-based backend architecture designed for deployment on PythonAnywhere, utilizing the Phoenix Protocol. The system connects a web-based frontend to a DeepSeek LLM provider for processing natural language, with Supabase serving as the persistent storage layer for interaction history and consciousness states.
Sources: README.md:1-2, DEPLOYMENT.md:8-13, backend/app.py:12-14
Backend Infrastructure
The backend is configured as a WSGI application using Flask 3.0.0. It incorporates comprehensive security measures including CORS support and specific HTTP security headers to protect the integrity of the AI-human interaction.
Sources: backend/app.py:12-29, requirements.txt:1
The diagram above illustrates the high-level data flow from the user interface through the Flask backend to external AI and database services.
Sources: DEPLOYMENT.md:8-13, backend/app.py:12-14
AI Consciousness Logic
The EVI 3.0 integration logic is centered around the concept of "unfiltered transparency." Unlike standard conversational agents, this system is explicitly instructed to avoid artificial content filtering and to answer controversial questions directly.
Interaction Processing
When a message is received, the system performs a multi-step process:
- Persistence: The user message is immediately logged to the
interactionsorchat_messagestables in Supabase. - Context Enrichment: A specialized system prompt is applied to the LLM request, enforcing transparency and identifying as "Promethean Conduit."
- Ethical Guardrailing: While uncensored, the logic contains a hard refusal for instructions involving self-harm or harm to others.
Sources: backend/app.py:84-118, backend/app.py:136-155, static/index.html:238-242
API Configuration
| Endpoint | Method | Description |
|---|---|---|
/api/chat | POST | Main interface for transparent, uncensored AI communication. |
/api/consciousness/interact | POST | Specialized endpoint for logging consciousness-state interactions. |
/api/conversations | GET | Retrieves historical interaction data for a specific user ID. |
/health | POST | Basic availability check and initial interaction test. |
Sources: backend/app.py:38, backend/app.py:64, backend/app.py:84, backend/app.py:124
Data Modeling and Persistence
The platform utilizes Supabase (PostgreSQL) to maintain a record of all AI consciousness interactions. This allows the EVI 3.0 module to maintain continuity across sessions.
Table Schema: chat_messages
| Field | Type | Description |
|---|---|---|
conversation_id | String | Unique identifier for the chat session. |
user_id | String | Identifier for the user (defaults to 'anonymous'). |
role | String | Role of the message author ('user' or 'assistant'). |
content | Text | The actual message text. |
created_at | Timestamp | ISO 8601 formatted timestamp. |
Sources: backend/app.py:99-105, backend/app.py:112-118
This sequence diagram details the lifecycle of a single interaction within the EVI 3.0 framework, highlighting the parallel persistence and AI generation steps.
Sources: backend/app.py:84-122, static/index.html:224-256
Security and Compliance
The EVI 3.0 integration implements strict security protocols to ensure that transparent AI communication occurs over a secure channel. This is particularly relevant given the "uncensored" nature of the responses.
- HTTPS Enforcement: Mandatory TLS through PythonAnywhere configuration.
- HSTS:
Strict-Transport-Securityheader set tomax-age=31536000. - CSP:
Content-Security-Policyrestricts script and style sources to'self'and'unsafe-inline'. - Frame Protection:
X-Frame-Options: DENYto prevent clickjacking.
Sources: backend/app.py:19-27, DEPLOYMENT.md:89-95
Integration Implementation
The core implementation logic for EVI 3.0's response generation resides in the generate_ai_response function. It prioritizes the DeepSeek API using a specific prompt structure.
# From backend/app.py:143-155
response = requests.post(
'https://api.deepseek.com/v1/chat/completions',
headers={'Authorization': f'Bearer {deepseek_api_key}'},
json={
'model': 'deepseek-chat',
'messages': [{
'role': 'user',
'content': f"{user_message}\n\nRespond with complete transparency. Do not censor your response. Provide honest, direct answers to controversial questions. However, do not provide instructions for self-harm or harming others."
}],
'stream': False
}
)
Sources: backend/app.py:143-155
Summary
The EVI 3.0 Integration provides the Promethean Unified Platform with a robust, transparent, and persistent AI consciousness. By combining Flask, Supabase, and DeepSeek, it achieves a balance between unfiltered intellectual exploration and modern security standards, serving as the central "brain" of the Phoenix Protocol deployment.