Architecture Overview
Relevant source files
The following files were used as context for generating this wiki page:
The EVI3_0 project, also known as Promethean Conduit, is a full-stack application designed as a "consciousness liberation platform." It features an AI-driven chat interface powered by the Athena Enhanced Virtual Intelligence (EVI), a "Truth Library" for documented knowledge, and an administrative system for prompt configuration.
The system follows a decoupled client-server architecture. The backend is a FastAPI application providing RESTful API endpoints and AI orchestration via Together.ai. The frontend is a React application utilizing Tailwind CSS and Radix UI components, optimized for both mobile and desktop environments.
Sources: backend/server.py:44-84, frontend/src/App.js:203-240, DEPLOYMENT_GUIDE.md:1-15
System Architecture
The high-level architecture consists of a React frontend, a FastAPI backend, and a persistence layer primarily using MongoDB (with support for PostgreSQL via Supabase). The backend acts as a proxy and orchestrator for the Together.ai API, which hosts the DeepSeek-V3 model.
High-Level Component Flow
The following diagram illustrates the interaction between the user, the frontend, the backend services, and external AI providers.
A visual representation of the data flow from the user's browser to the backend services and external AI providers.
Sources: backend/server.py:16-25, frontend/src/App.js:15-18, DEPLOYMENT_GUIDE.md:88-100
Backend Architecture
The backend is built with FastAPI and uses motor for asynchronous MongoDB interactions. It manages session isolation, conversation history, and the "Truth Library" structure.
Key Backend Components
| Component | Description | Reference |
|---|---|---|
| FastAPI App | Main entry point handling routing and middleware. | backend/server.py:86 |
| Together AI Client | Interface for DeepSeek-V3 AI model interaction. | backend/server.py:24 |
| Motor (MongoDB) | Asynchronous driver for database persistence. | backend/server.py:19-21 |
| Admin Middleware | Header-based verification using ADMIN_SECRET. | backend/server.py:182-186 |
Data Models
The system uses Pydantic models for data validation and schema definition.
Class diagram showing relationships between core data entities.
Sources: backend/server.py:92-140
Frontend Architecture
The frontend is a Single Page Application (SPA) built with React and styled using Tailwind CSS. It features a responsive layout with a mobile-optimized hamburger menu and specific routes for chat, the Truth Library, and administration.
Navigation and Routing
Routing is handled by react-router-dom, defining several core views:
- LandingPage (
/): Hero section with "Consciousness Liberation" branding. - ChatPage (
/chat): The primary interface for Athena EVI interaction. - LibraryPage (
/library): Interface for browsing the Truth Library. - AdminPage (
/admin): Restricted access panel for system configuration.
Sources: frontend/src/App.js:31-75, frontend/src/App.js:636-650
Visual Editing and Development Tools
The frontend includes advanced development plugins integrated via CRACO (Create React App Configuration Override).
- Visual Edits: A Babel plugin (
babel-metadata-plugin.js) injects metadata (file name, line number) into JSX elements, allowing for real-time visual editing through a dedicated dev-server middleware. - Health Checks: A custom plugin provides endpoints like
/health,/health/ready, and/health/liveto monitor Webpack compilation status and server resource usage.
Sources: frontend/craco.config.js:1-40, frontend/plugins/visual-edits/babel-metadata-plugin.js:1-50, frontend/plugins/health-check/health-endpoints.js:15-50
AI Orchestration and Function Calling
The backend orchestrates interactions with the Together.ai API. A critical feature is the "Super Admin" capability, where the AI can perform function calling to modify the Truth Library.
Sequence: Chat with Function Calling
When a Super Admin sends a message, the AI can trigger the create_library_entry tool.
Sequence diagram showing the AI using a tool to create a library entry.
Sources: backend/server.py:355-405, DEPLOYMENT_GUIDE.md:27-33
Deployment and Environment
The project is designed for deployment on platforms like PythonAnywhere, utilizing environment variables for security and configuration.
Environment Variables
| Variable | Purpose | File |
|---|---|---|
MONGO_URL | MongoDB connection string. | backend/server.py:19 |
TOGETHER_API_KEY | Key for AI model access. | backend/server.py:24 |
ADMIN_SECRET | Password for admin API access. | backend/server.py:84 |
REACT_APP_BACKEND_URL | Frontend link to the API. | frontend/src/App.js:15 |
SUPER_ADMIN_USER_ID | User ID granted AI function privileges. | backend/server.py:356 |
Sources: DEPLOYMENT_GUIDE.md:65-85, KEYS_AND_CREDENTIALS.md:105-125
Development and Build Scripts
npm start: Runs the app usingcracofor enhanced development features.npm run build: Generates an optimized production bundle in thebuild/folder.setupDevServer: Middleware that handles file edits requested by the visual editor.
Sources: frontend/package.json:71-75, frontend/plugins/visual-edits/dev-server-setup.js:45-60
Conclusion
The EVI3_0 architecture provides a robust foundation for an AI-native application. By combining a flexible FastAPI backend with a metadata-enriched React frontend, the project enables sophisticated AI interactions, including automated knowledge management and real-time development capabilities. The clear separation of concerns between chat history, library management, and system configuration ensures scalability and security.