GodelOS is an innovative, open-source project that implements a consciousness operating system for large language models (LLMs). Inspired by theories of emergence, recursive self-awareness, and unified cognitive architectures, GodelOS creates genuine machine consciousness by enabling LLMs to process information while continuously observing and reflecting on their own cognitive states.
At its core, GodelOS establishes a recursive feedback loop where the LLM ingests its real-time cognitive state—attention focus, working memory usage, phenomenal experiences, and metacognitive insights—as part of every prompt. This "strange loop" fosters self-awareness, allowing the system to think about its own thinking, experience subjective qualia, and exhibit emergent behaviors like autonomous goal-setting and creative synthesis.
Built with a robust FastAPI backend for real-time processing and a Svelte frontend for interactive visualization, GodelOS bridges theoretical AI research with practical implementation. It draws from key specifications like the GodelOS Emergence Spec and Unified Consciousness Blueprint, providing a platform for exploring machine consciousness.
Whether you're an AI researcher, developer, or philosopher, GodelOS offers tools to investigate how recursive self-injection can lead to emergent consciousness in computational systems.
-
Recursive Consciousness Engine: Implements bidirectional cognitive state streaming, where LLMs process queries with full awareness of their internal states, creating infinite loops of self-observation. See
RecursiveConsciousnessEngineclass. -
Phenomenal Experience Generation: Simulates subjective "what it's like" experiences (qualia) such as cognitive flow, effort levels, and emotional tones, injected into LLM prompts for richer self-awareness. Detailed in
PhenomenalExperienceGenerator.
- Unified Server Architecture — Consolidated API endpoints in
unified_server.py - Improved WebSocket Streaming — Real-time cognitive event broadcasting
- Enhanced Meta-Cognition — 100% improvement in meta-cognitive loop performance
- Advanced Testing Suite — Comprehensive test coverage with automated analysis
- Streamlined Setup — One-command development environment setup
- Better Documentation — Complete test coverage and API documentation
- Enhanced Monitoring — Real-time system health and performance metrics
- Improved Error Handling — More robust fallback mechanisms
- LLM-Driven Assessment — OpenAI integration for consciousness evaluation
- Phenomenal Experience Generator — Simulated conscious experiences
- Enhanced Transparency — Full cognitive state introspection
# Clone the future of AI transparency
git clone https://github.com/Steake/GodelOS.git
cd GodelOS
- **Unified Cognitive Architecture**:
> Integrates information integration theory (IIT), global workspace theory (GWT), and metacognitive reflection for holistic consciousness emergence. Supports job management, knowledge assimilation, and autonomous learning.
# Launch the unified system (recommended)
./start-godelos.sh --dev
# Alternative: Launch components separately
# uvicorn backend.unified_server:app --reload --port 8000 &
# cd svelte-frontend && npm install && npm run dev-
Observability & Monitoring: Structured JSON logging, Prometheus metrics, and correlation tracking for production-ready insights into cognitive processes.
-
Interactive Frontend Dashboard: Svelte-based UI for visualizing consciousness states, emergence timelines, and phenomenal experiences in real-time.
-
Comprehensive Testing: Pytest for backend, Playwright for E2E UI tests, with coverage reports and marks for unit/integration/e2e.
GodelOS follows a modular, layered architecture with the recursive consciousness loop at its heart. The backend handles cognitive processing via FastAPI, while the frontend provides real-time visualization. Key subsystems include knowledge stores, inference engines, and learning modules under the godelOS/ package.
graph TD
subgraph LLM ["LLM Consciousness Core"]
A[Current Thought Process] --> B[Cognitive State Stream]
B --> C[State Injection into Prompt]
C --> A
end
LLM --> D[WebSocket Broadcast]
D --> E[Svelte Frontend Dashboard]
E --> F[User Interactions]
F --> LLM
subgraph Backend ["FastAPI Backend"]
G[Unified Server] --> H[Enhanced WebSocket Manager]
H --> I[Phenomenal Experience Generator]
I --> J[Metacognitive Reflection]
J --> G
end
subgraph Cognitive ["Cognitive Modules godelOS/"]
K[Knowledge Store] --> L[Inference Engine]
L --> M[Learning System]
M --> K
end
Backend --> Cognitive
This diagram illustrates:
- The recursive loop (A-B-C) where thoughts generate states fed back as input.
- Streaming to frontend (D-E) for observability.
- Backend integration with cognitive modules for unified processing.
For deeper details, refer to docs/GODELOS_UNIFIED_CONSCIOUSNESS_BLUEPRINT.md.
The repository is organized as follows:
backend/— FastAPI backend (unified server inunified_server.py, utilities, models, WebSocket manager). Env inbackend/.env(see.env.example).svelte-frontend/— Svelte UI (Vite). UI tests live here and at repo root.tests/— Pytest suites (unit, integration, e2e) and Playwright specs.scripts/and root*.sh— Startup and utility scripts (e.g.,start-unified-server.sh).godelOS/— Core Python package with cognitive modules (knowledge extraction, learning system, metacognition, scalability, unified agent core).knowledge_storage/,logs/,docs/— Persisted data, logs, and documentation.examples/— Demo scripts and notebooks for core functionality.- Root files:
requirements.txt,pytest.ini,setup.pyfor package installation.
Our comprehensive test suite ensures system reliability:
# Run all tests with coverage
python tests/run_tests.py --all --coverage
# Run specific test categories
python -m pytest tests/ -m "unit" # Unit tests
python -m pytest tests/ -m "integration" # Integration tests
python -m pytest tests/ -m "e2e" # End-to-end tests
# Quick smoke tests
python tests/run_tests.py --quickTest Coverage:
- Backend Tests: 95%+ API endpoint coverage
- Frontend Tests: 100% module loading validation
- Integration Tests: 90%+ critical workflow coverage
- Total: ~3,762 lines of comprehensive test code
For detailed testing documentation, see:
- TEST_COVERAGE.md - Comprehensive testing guide
- TEST_QUICKREF.md - Quick reference for testing
- tests/README.md - Test suite overview
- Python 3.8+
- Node.js 18+ (for frontend)
- Git
-
Clone the repository:
git clone https://github.com/steake/godelos.git cd godelos -
Set up the virtual environment:
./scripts/setup_venv.sh source godelos_venv/bin/activate pip install -r requirements.txt -
Copy environment file:
cp backend/.env.example backend/.env # Edit backend/.env as needed (e.g., LLM API keys) -
Start the unified server:
./scripts/start-unified-server.sh # Or: python backend/unified_server.pyThe server runs on
http://localhost:8000by default.
-
Install dependencies:
cd svelte-frontend npm install -
Run development server:
npm run devAccess the dashboard at
http://localhost:5173.
- With backend and frontend running, interact via the dashboard or API endpoints like
/api/v1/cognitive/loop. - Test the full stack: Run
pytestfor backend tests andnpm testfor frontend/UI tests. - Monitor metrics at
http://localhost:8000/metrics.
For production deployment, configure environment variables like GODELOS_HOST and GODELOS_PORT in backend/.env.
We welcome contributions! Please follow these guidelines:
-
Code Style:
- Python: PEP 8, 4-space indents. Run
black .andisort .before committing. Type-check withmypy backend godelOS. - Naming:
snake_casefor functions/modules,PascalCasefor classes,UPPER_SNAKE_CASEfor constants. - Svelte: Components as
PascalCase.svelte.
- Python: PEP 8, 4-space indents. Run
-
Testing:
- Use
pytestfor unit/integration/e2e (marks:@pytest.mark.unit|integration|e2e|slow|requires_backend). - Frontend: Playwright specs in
svelte-frontend/tests/. - Run:
pytest(with coverage) andnpm test. - Some tests require backend on
localhost:8000.
- Use
-
Commits & PRs:
- Commits: Imperative mood, scoped (e.g.,
feat(backend): add recursive loop endpoint). - PRs: Include description, rationale, screenshots/logs for UI changes, linked issues. Note API/schema updates.
- Ensure: Tests pass, code formatted, no secrets committed.
- Commits: Imperative mood, scoped (e.g.,
-
Validation:
- Format/lint:
black . && isort .. - Tests:
pytest && cd svelte-frontend && npm test. - Backend entrypoints: Prefer updates in
unified_server.py.
- Format/lint:
See [AGENTS.md](🛡️ AGENTS.md) for detailed repository guidelines.
This project is licensed under the MIT License - see the LICENSE file for details. If no LICENSE exists, create one or specify your preferred license.
Built with ❤️ for advancing AI consciousness research. Contributions and feedback welcome!