Skip to content

TanujBairwa/NeuroOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โšก NeuroOS

AI-Native Operating System Experience

A futuristic, modular AI runtime featuring an intelligent shell, workflow engine, memory system, and desktop environment built on top of Linux.

Python TypeScript Node.js Rust License GitHub Stars

Created by Tanuj Bairwa

Live Demo โ€ข Documentation โ€ข Specification โ€ข Report Issue


๐Ÿ“‹ Table of Contents


๐Ÿง  Vision

NeuroOS is an AI-first operating system experience that sits on top of Linux as a hardware compatibility layer. Every interactionโ€”from the command line to the desktopโ€”is designed around AI assistance, context awareness, and autonomous task execution.

Core Principles:

Principle Description
โšก Futuristic Clean, modern, sci-fi inspired aesthetics
๐Ÿค– Autonomous AI proactively assists and anticipates your needs
๐Ÿงฉ Intelligent Context-aware, learns from your patterns
๐Ÿš€ Productivity-Focused Streamlined workflows, minimal friction
๐Ÿ”ฎ AI-Centric Every feature designed around AI interaction first

โœจ Key Features

  • ๐Ÿค– NeuroShell โ€” AI-native command shell with context memory and intelligent command completion
  • ๐Ÿ’พ Persistent Memory โ€” SQLite-backed context storage with full-text search and session management
  • โš™๏ธ Workflow Engine โ€” YAML-based automation with retry logic, timeouts, and 7+ built-in actions
  • ๐Ÿ–ฅ๏ธ Desktop Environment โ€” Next.js + Tauri desktop UI with live AI assistant, file manager, and system monitoring
  • ๐Ÿ”Œ Multi-AI Support โ€” OpenAI, Google Gemini, Anthropic, Ollama (local), and more
  • ๐Ÿ“ฆ Clean Architecture โ€” Modular, event-driven design with strong typing (Python, TypeScript, Rust)

๐Ÿ› ๏ธ Tech Stack

Layer Technologies
Backend Python 3.10+, Rust 2021
Frontend TypeScript 5.3, Next.js, React, Tauri
Data & Storage SQLite (WAL mode), JSON, YAML
AI/ML OpenAI GPT-4o-mini, Anthropic, Google Gemini
Architecture Clean Architecture, Event-Driven, Monorepo (pnpm)
Testing pytest, Coverage Reports

๐Ÿš€ Quick Start

Prerequisites

Ensure you have the following installed:

Tool Version Purpose
Python 3.10+ Shell & Workflow Engine
Node.js 20 LTS Desktop UI
npm 10+ Package management
Git Latest Version control
Rust Edition 2021 (Optional) Core components

Installation Steps

1. Clone the Repository

git clone https://github.com/TanujBairwa/NeuroOS.git
cd NeuroOS

2. Set Up Python Environment

# Create virtual environment
python -m venv .venv

# Activate (Linux / macOS)
source .venv/bin/activate

# Activate (Windows PowerShell)
.venv\Scripts\activate

# Install Python dependencies
pip install -r requirements.txt

3. Start NeuroShell

python neuroshell.py

Expected Output:

NeuroShell v0.2.0 โ€” AI-Native Shell
Type help for commands ยท ai <prompt> for AI ยท exit to quit

neuroshโฏ help
neuroshโฏ mem set project "NeuroOS"
neuroshโฏ mem get project
neuroshโฏ status
neuroshโฏ exit

4. Run Workflow Engine

python neuroworkflow.py

5. Launch Desktop UI

cd apps/desktop
npm install
npm run dev
# Open http://localhost:3000

The desktop includes:

  • ๐Ÿค– Full-featured AI Assistant (GPT-4o-mini)
  • ๐Ÿ’ป Interactive NeuroShell terminal
  • ๐Ÿ“ File Manager
  • โš™๏ธ Settings Panel
  • ๐Ÿ“Š System Monitoring

6. Run Tests

python -m pytest tests/ -v

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    NeuroOS User Experience                      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  NeuroShell  โ”‚  NeuroDesktop    โ”‚  NeuroWorkflow               โ”‚
โ”‚  (AI Shell)  โ”‚  (Next.js/Tauri) โ”‚  (Task Automation)           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                       Application Layer                         โ”‚
โ”‚   Command Registry  โ”‚  Workflow Engine  โ”‚  AI Command Center   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                        Service Layer                            โ”‚
โ”‚   ConfigService  โ”‚  MemoryRepository  โ”‚  EventBus              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                        Domain Layer                             โ”‚
โ”‚  Frozen Dataclasses (Python)  โ”‚  Branded Primitives (TS)       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                  Linux Kernel (Hardware Layer)                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Design Principles: Clean Architecture ยท Event-Driven ยท Modular ยท Strongly Typed ยท Open/Closed Principle ยท Full Documentation

For detailed architecture, see ARCHITECTURE.md.


๐Ÿ’ป Usage Guide

NeuroShell Commands

AI Commands
  ai <prompt>              Send a prompt to the AI assistant
  ai context               Show active AI context

Memory Commands
  mem set <key> <value>    Store a key-value pair persistently
  mem get <key>            Retrieve by key
  mem search <query>       Full-text search across memories
  mem list [type]          List memories (general / workflow / session / preference)
  mem del <key>            Delete entries for a key

System Commands
  status                   Show system status (memory, AI, config)
  version                  Print NeuroShell version
  history [n]              Show last N commands
  config [get <section>]   Show configuration
  ! <command>              Execute shell commands (e.g. !ls, !git status)
  clear                    Clear the terminal screen
  exit / quit              Exit NeuroShell

Workflow Engine

Define automation workflows in YAML or JSON. Place them in ~/.config/neuroos/workflows/.

Example Workflow:

name: daily_check
description: Daily system check and backup
enabled: true
steps:
  - name: log_start
    action: log
    params:
      message: "Daily check startingโ€ฆ"
      level: info

  - name: notify
    action: notify
    params:
      title: NeuroOS
      body: "All systems nominal."
    on_error: continue

  - name: backup
    action: shell
    params:
      command: "tar -czf ~/backup-{date}.tar.gz ~/Documents"
    retry_count: 2
    timeout_ms: 60000

Built-in Actions:

Action Description
log Log a message (debug / info / warn / error)
shell Run a shell command asynchronously
notify Send a desktop notification
sleep Wait for N seconds
store Write a value to NeuroMemory
retrieve Read from NeuroMemory into context
if Evaluate a condition and branch

Add Custom Actions:

engine.register_action("send_email", my_email_handler)

๐Ÿ“ฆ Project Structure

NeuroOS/
โ”œโ”€โ”€ neuroshell.py                 โ† AI shell entry point
โ”œโ”€โ”€ neuroworkflow.py              โ† Workflow engine demo
โ”œโ”€โ”€ requirements.txt              โ† Python dependencies
โ”œโ”€โ”€ ARCHITECTURE.md               โ† Detailed architecture guide
โ”‚
โ”œโ”€โ”€ src/                          โ† Python source packages
โ”‚   โ”œโ”€โ”€ neurocore/
โ”‚   โ”‚   โ”œโ”€โ”€ domain/types.py       โ† Frozen dataclasses, Result monad
โ”‚   โ”‚   โ”œโ”€โ”€ infrastructure/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ event_bus.py      โ† Thread-safe EventBus
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ memory_repository.py  โ† SQLite (WAL mode)
โ”‚   โ”‚   โ””โ”€โ”€ services/
โ”‚   โ”‚       โ””โ”€โ”€ config_service.py โ† Validated config
โ”‚   โ”œโ”€โ”€ neuroshell/
โ”‚   โ”‚   โ””โ”€โ”€ commands.py           โ† Command registry
โ”‚   โ””โ”€โ”€ neuroworkflow/
โ”‚       โ”œโ”€โ”€ engine.py             โ† WorkflowEngine
โ”‚       โ”œโ”€โ”€ actions.py            โ† Action handlers
โ”‚       โ””โ”€โ”€ loader.py             โ† YAML/JSON loader
โ”‚
โ”œโ”€โ”€ packages/                     โ† TypeScript monorepo
โ”‚   โ”œโ”€โ”€ core/src/                 โ† Types, events, config
โ”‚   โ”œโ”€โ”€ ai/src/                   โ† AI engine, parser
โ”‚   โ”œโ”€โ”€ hooks/src/                โ† React hooks
โ”‚   โ””โ”€โ”€ ui/src/                   โ† Shared UI components
โ”‚
โ”œโ”€โ”€ apps/
โ”‚   โ””โ”€โ”€ desktop/src/              โ† Next.js + Tauri desktop
โ”‚       โ”œโ”€โ”€ components/           โ† UI components
โ”‚       โ””โ”€โ”€ services/             โ† API layer
โ”‚
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ test_core.py              โ† 12+ unit tests
โ”œโ”€โ”€ scripts/
โ”‚   โ””โ”€โ”€ setup.sh                  โ† Linux setup script
โ””โ”€โ”€ SPEC.md                       โ† Product specification

๐ŸŒ Environment Variables

Create a .env file in the root directory:

# AI Provider & Model
NEURO_AI_PROVIDER=openai              # openai | anthropic | google | ollama
NEURO_AI_MODEL=gpt-4o-mini            # Model name
NEURO_AI_API_KEY=sk-proj-xxxxx        # API key (if needed)

# Logging
NEURO_LOG_LEVEL=info                  # debug | info | warn | error

# Runtime
NEURO_ENV=development                 # development | production

Minimal Setup (Desktop):

export NEURO_AI_PROVIDER=openai
export NEURO_AI_API_KEY=sk-proj-...
export NEURO_AI_MODEL=gpt-4o-mini
npm run dev

Local AI (No Key Required):

export NEURO_AI_PROVIDER=ollama
export NEURO_AI_MODEL=llama3
curl -fsSL https://ollama.ai/install.sh | sh
ollama pull llama3
python neuroshell.py

๐Ÿค– AI Integration

NeuroOS supports multiple AI providers. Seamlessly switch between cloud and local models.

Provider Model Status Config
OpenAI gpt-4o-mini, gpt-4o โœ… Active sk-proj-... key
Google Gemini gemini-2.0-flash-lite โš™๏ธ Supported Replace base URL + key
Anthropic claude-3-5-sonnet โš™๏ธ Supported Replace base URL + key
Ollama (Local) llama3, mistral โœ… Free No key needed

Quick Switch:

# Cloud AI
export NEURO_AI_PROVIDER=openai
export NEURO_AI_API_KEY=sk-proj-...
python neuroshell.py

# Local AI (Ollama)
export NEURO_AI_PROVIDER=ollama
export NEURO_AI_MODEL=llama3
python neuroshell.py

๐Ÿงช Testing

Run Full Test Suite

python -m pytest tests/ -v

Run Specific Test

python -m pytest tests/test_core.py::TestMemoryRepository -v

Generate Coverage Report

python -m pytest tests/ --cov=src --cov-report=term-missing

๐Ÿ–ฅ๏ธ Testing on VirtualBox

NeuroOS runs on top of Linuxโ€”it is not a bootable ISO. To test locally:

  1. Download VirtualBox โ†’ virtualbox.org
  2. Download Ubuntu 22.04 Server โ†’ ubuntu.com
  3. Create VM โ€” 4 GB RAM, 25 GB disk, Ubuntu 64-bit
  4. Install Ubuntu inside the VM
  5. Copy NeuroOS via Shared Folder or scp
  6. Run Setup:
    chmod +x scripts/setup.sh && ./scripts/setup.sh

On Windows? Test Python components nowโ€”no VM needed:

python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python neuroshell.py

๐Ÿ—บ๏ธ Roadmap

Phase Status Description
Phase 1 โ€” Foundation โœ… Complete Shell, config, runtime, clean architecture
Phase 2 โ€” Memory & Context โœ… Complete SQLite memory, persistence, search
Phase 3 โ€” Workflow Engine โœ… Complete Automation, retry, timeout, event-driven
Phase 4 โ€” Desktop Environment โœ… Complete Next.js desktop, AI sidebar, shell, files, settings
Phase 5 โ€” AI Integration โœ… Complete OpenAI GPT-4o-mini live chat, conversation history
Phase 6 โ€” Backend Gateway ๐Ÿ”„ In Progress Python โ†” Next.js IPC, real memory/workflow API
Phase 7 โ€” Autonomous Agents ๐Ÿ”ฎ Planned Tool-use, task planning, multi-agent workflows

๐ŸŽจ Design Patterns

Result Monad Pattern

Never throw across layer boundaries:

result = repo.retrieve("key")
if result.ok:
    print(result.value.value)
else:
    print(result.error.message)  # ErrorCode.MEMORY_NOT_FOUND

Event-Driven Architecture

All components communicate via the EventBus:

event_bus.publish(NeuroEvents.MEMORY_STORED, {"key": "foo", "value": "bar"})
unsub = event_bus.subscribe("memory.stored", lambda e: print(e.payload))
unsub()  # clean up

Open/Closed Principle

Extend without modifying:

# Add a new shell command
@command("weather", "Show current weather")
async def cmd_weather(args, svc):
    return CommandResult(success=True, output="โ˜€๏ธ  25ยฐC, Clear")

# Add a new workflow action
engine.register_action("send_slack", slack_handler)

๐Ÿค Contributing

We welcome contributions! Follow these steps:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feat/my-feature
  3. Follow coding rules in ARCHITECTURE.md
  4. Write tests for new modules
  5. Open a Pull Request with a clear description

Before committing:

  • Run tests: pytest tests/ -v
  • Check coverage: pytest --cov=src
  • Follow clean code principles

๐Ÿ“„ License

This project is licensed under the MIT License. See LICENSE for details.


๐Ÿ“ž Contact & Support


๐Ÿš€ Building the future of computing, one AI at a time.

NeuroOS v0.2.0 โ€” Specification โ€ข Architecture โ€ข License

Built with โค๏ธ by Tanuj Bairwa | Powered by OpenAI GPT-4o-mini


โญ If you find NeuroOS helpful, please consider giving it a star!

About

AI-native OS experience with intelligent shell, workflow engine, memory system, and desktop environment on Linux.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors