Skip to content

About

Genesis Protocol v2.2 - AI-powered recursive code generation with fractal task splitting and smart merge

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌍 Genesis AOS v3.0

The World's First AI Operating System β€” Not an agent. An OS for agents.

Python 3.9+ License: MIT Tests Version

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                                                         β”‚
β”‚   β–ˆβ–ˆβ•—  β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—                  β”‚
β”‚   β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•                  β”‚
β”‚   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—                  β”‚
β”‚   β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β•šβ•β•β•β•β–ˆβ–ˆβ•‘β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ•β•β•β•β–ˆβ–ˆβ•‘                  β”‚
β”‚   β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘                  β”‚
β”‚   β•šβ•β•  β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β•  β•šβ•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β•β•šβ•β•β•β•β•β•β•                  β”‚
β”‚                                                                         β”‚
β”‚              🧬 AI OPERATING SYSTEM v3.0 🧬                              β”‚
β”‚                                                                         β”‚
β”‚     "LLMs are CPUs. Genesis AOS is the motherboard, kernel, and         β”‚
β”‚       ecosystem that turns them into a living, evolving computer."      β”‚
β”‚                                                                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🎯 What is Genesis AOS?

Genesis AOS is not just another AI framework. It's a complete operating system for artificial intelligence:

Traditional AI Genesis AOS
Monolithic LLM Modular engine ecosystem
Static prompts Evolving skill DNA
Single session Persistent memory & learning
Manual orchestration Automatic pipeline execution
Throwaway code Reproducible genome snapshots

The Core Philosophy

LLM = CPU (replaceable, hot-swappable)
Skill = App (evolvable, shareable, composable)  
Genesis AOS = The Operating System

πŸ—οΈ Architecture: 4 Layers of Intelligence

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  LAYER 4: GENESIS HUB 🌐                                             β”‚
β”‚  ─────────────────────                                               β”‚
β”‚  Skill sharing, DNA crossover, genome marketplace                    β”‚
β”‚  Commands: genesis push, genesis pull, genesis merge                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  LAYER 3: GENESIS OS πŸ–₯️                                              β”‚
β”‚  ───────────────────                                                 β”‚
β”‚  Central kernel: boot(), run(), evolve_all(), invent_skill()         β”‚
β”‚  Process orchestration, pipeline execution, self-improvement         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  LAYER 2: SKILL LAYER 🧩                                             β”‚
β”‚  ────────────────────                                                β”‚
β”‚  Evolvable capabilities: CodeGen, Research, Debug, TaskDecompose     β”‚
β”‚  SkillGenome (DNA), SkillEvolution, ComposedSkill (Unix pipes)       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  LAYER 1: ENGINE LAYER ⚑                                            β”‚
β”‚  ─────────────────────                                               β”‚
β”‚  Hot-swappable LLM engines: Kimi, Claude, GPT, Local, Mock           β”‚
β”‚  EngineRegistry, automatic failover, capability detection            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  LAYER 0: KERNEL πŸ’Ž                                                  β”‚
β”‚  ───────────────                                                     β”‚
β”‚  6D Gradient Loss + Adam Optimizer + Genetic Evolution               β”‚
β”‚  Seed DNA (64-bit), DSPy Bridge, MCP Server (23 tools)               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

Installation

# Core OS
pip install genesis-protocol

# With all engines and skills
pip install genesis-protocol[all]

# Development
pip install genesis-protocol[dev]

1. Boot the OS

from genesis_protocol import GenesisOS

# Auto-boot with default settings
aos = GenesisOS(auto_boot=True)

# Or manual control
aos = GenesisOS()
aos.install_engine("claude", OpenRouterEngine("anthropic/claude-3.5-sonnet"))
aos.boot()

2. Run a Skill

# Single skill execution
result, metadata = aos.run("code_generation", "Build a REST API with auth")

# Pipeline (Unix pipes for AI)
result, metadatas = aos.run_pipeline(
    ["task_decomposition", "code_generation", "code_review"],
    "Build an e-commerce platform with Stripe integration"
)

3. Self-Improvement

# Evolve all skills based on performance
aos.evolve_all()

# Invent entirely new skills
aos.invent_skill("security_audit", from_existing=["code_review", "test_gen"])

4. Share & Collaborate

from genesis_protocol import GenesisHub

hub = GenesisHub()

# Push your evolved skill
hub.push(GenomePackage(
    name="super-crawler",
    genome=aos.skills["web_crawler"].genome,
    fitness=0.94
))

# Pull community skills
hub.pull("awesome-researcher")

# DNA Crossover - create child skills!
child = hub.merge("agent-a", "agent-b")

πŸ“Š 73/73 Tests Passing

Layer Tests Coverage
Engine Layer 12 tests βœ… 100%
Skill Layer 13 tests βœ… 100%
Genesis OS 14 tests βœ… 100%
Genesis Hub 7 tests βœ… 100%
Integration 3 tests βœ… 100%
Core (v2.0) 24 tests βœ… 100%
TOTAL 73/73 βœ… 100%
# Run all tests
pytest tests/ -v

# Specific layer
pytest tests/test_aos.py -v

🎨 Key Features

πŸ”₯ Hot-Swappable Engines

# Switch LLMs mid-flight without losing context
aos.install_engine("kimi", KimiEngine("kimi-k2.5"))
aos.run("code_gen", "Task 1")

aos.switch_engine("claude")  # Hot swap!
aos.run("code_review", "Task 1 results")

🧬 Evolvable Skills

Every skill has DNA that evolves:

# Skill starts with basic capabilities
skill = CodeGenSkill()
print(skill.genome)  # 64-bit seed

# After 10 successful runs, DNA mutates and improves
for _ in range(10):
    skill.execute("Generate code")
    skill.evolve(fitness=0.92)

# Genome now encodes better prompt strategies
skill.export_genome()  # Share with others!

πŸ”„ DNA Crossover

# Combine two skills' DNA to create a hybrid
parent_a = hub.load("api-expert")
parent_b = hub.load("database-guru")

child = Skill.crossover(parent_a, parent_b, ratio=0.5)
# Child inherits: API design sense + DB optimization instincts

πŸ§ͺ Self-Modifying System

# AOS can improve its own kernel!
aos.run("self_improve", target="prompt_templates")
# β†’ Analyzes successful vs failed runs
# β†’ Evolves better default templates
# β†’ Updates its own configuration

πŸ› οΈ CLI Interface

# Initialize project with specific domain DNA
genesis init my-api --domain=api_service

# Run with specific engine
genesis run "Build FastAPI" --engine=claude --project=./my-api

# Evolve all skills in project
genesis evolve --project=./my-api

# Share your evolved genome
genesis push my-api --name="ultra-api-gen"

# Import and merge community genomes
genesis merge "facebook/react-gen" "google/go-gen" --output=./hybrid

# Real-time system monitor
genesis htop

πŸ”¬ Python API Deep Dive

Engine Layer

from genesis_protocol import GenesisOS, OpenRouterEngine

aos = GenesisOS()

# Register multiple engines
aos.install_engine("claude", OpenRouterEngine(
    model="anthropic/claude-3.5-sonnet",
    api_key="sk-..."
))

aos.install_engine("local", LocalEngine(
    model_path="./models/llama-3.gguf",
    n_gpu_layers=35
))

# Automatic failover
aos.set_failover_chain(["claude", "local", "mock"])

# Capability-based routing
if aos.has_capability("code_generation", "claude"):
    result = aos.run("code_gen", task)

Skill Layer

from genesis_protocol import Skill, ComposedSkill

# Built-in skills
code_gen = aos.skills["code_generation"]
review = aos.skills["code_review"]
debug = aos.skills["debug"]

# Compose like Unix pipes
pipeline = ComposedSkill([code_gen, review, debug])
result = pipeline.execute("Build auth system")

# Custom skill
@Skill.register("my_analyzer")
class MyAnalyzer(Skill):
    def execute(self, input_data):
        # Your logic here
        return {"result": analyzed}
    
    def compute_fitness(self, result, feedback):
        # Custom fitness for evolution
        return accuracy * 0.7 + speed * 0.3

OS Layer

from genesis_protocol import GenesisOS

aos = GenesisOS(auto_boot=True)

# Boot sequence inspection
print(aos.boot_sequence)
# ['engine_init', 'skill_load', 'mcp_connect', 'hub_sync']

# Process management
pid = aos.spawn("long_running_task", daemon=True)
aos.monitor(pid)
aos.kill(pid)

# System introspection
aos.htop()  # Live display of running processes
print(aos.learning_report())  # Evolution statistics

Hub Layer

from genesis_protocol import GenesisHub, GenomePackage

hub = GenesisHub()

# Publish your work
pkg = GenomePackage(
    name="super-scraper-v2",
    version="2.1.0",
    genome=my_skill.genome,
    fitness=0.96,
    metadata={
        "author": "@yunusbayram",
        "tags": ["scraping", "anti-bot", "stealth"],
        "training_runs": 15000
    }
)
hub.push(pkg)

# Search community
results = hub.search("scraping", min_fitness=0.9)

# DNA Crossover (the magic!)
child_genome = hub.merge(
    "linkedin-scraper",      # Parent A
    "instagram-scraper",     # Parent B
    mutation_rate=0.1
)
# Child has combined anti-detection strategies

🧬 The Genome System

Every component in Genesis AOS has DNA:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  GENOME STRUCTURE (64-bit seed)                     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Bits 0-7    β”‚ Loss weight bias (Ξ±, Ξ², Ξ³, Ξ΄, Ξ΅, ΞΆ) β”‚
β”‚  Bits 8-15   β”‚ Complexity threshold               β”‚
β”‚  Bits 16-23  β”‚ Refinement intensity               β”‚
β”‚  Bits 24-31  β”‚ Code style preferences             β”‚
β”‚  Bits 32-47  β”‚ Domain-specific encoding           β”‚
β”‚  Bits 48-63  β”‚ Evolution metadata (generation)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Evolution in Action

from genesis_protocol import SeedEvolution

evo = SeedEvolution(population_size=100)

for generation in range(50):
    # Evaluate each genome
    for genome in evo.population:
        fitness = evaluate_code_quality(genome)
        genome.fitness = fitness
    
    # Evolve next generation
    evo.evolve_generation()
    
    # Best genome survives, mutates, improves
    best = evo.get_best()
    print(f"Gen {generation}: Fitness = {best.fitness:.3f}")

πŸ”Œ MCP Integration

Genesis AOS exposes 23 tools via Model Context Protocol:

genesis mcp --port=8080

Claude Desktop / VS Code entegrasyonu:

{
  "mcpServers": {
    "genesis": {
      "command": "genesis",
      "args": ["mcp", "--port=8080"]
    }
  }
}

Available Tool Categories

Category Tools Count
Core start_project, decompose, implement, review, sync 5
Gradient compute_loss, compute_gradient, backpropagate 3
Engine switch_engine, benchmark_engine, failover 3
Skill execute_skill, evolve_skill, compose_skills 4
Hub push_genome, pull_genome, merge_genomes 4
OS get_status, htop, spawn_process 4

🐳 Docker Deployment

# Build OS image
docker build -t genesis-aos .

# Run with GPU support
docker run --gpus all -it genesis-aos

# Docker Compose (full stack)
docker-compose up -d genesis-aos genesis-mcp genesis-hub

πŸ—ΊοΈ Roadmap

Phase 1: Foundation βœ… COMPLETE

  • Seed + Gradient Engine (6D Loss)
  • DSPy Bridge (prompt optimization)
  • MCP Server (23 tools)

Phase 2: Package βœ… COMPLETE

  • pip install genesis-protocol
  • CLI interface
  • Docker support
  • 24 core tests

Phase 3: AOS βœ… COMPLETE (Current)

  • Engine Layer - Hot-swappable LLMs
  • Skill Layer - Evolvable capabilities
  • OS Layer - Central orchestrator
  • Hub Layer - Genome sharing & crossover
  • 73/73 tests passing

Phase 4: Online Hub ⏳ NEXT

  • genesis-hub.io - Public genome marketplace
  • Community skill ratings
  • Automated DNA crossover recommendations
  • Skill "lineage" visualization (family trees)

Phase 5: Self-Hosting

  • AOS modifies its own kernel code
  • Self-optimizing prompt templates
  • Auto-generated skill documentation
  • Recursive self-improvement loops

Phase 6: Distributed AOS

  • Multi-node Genesis cluster
  • Shared genome pool across instances
  • Cloud + Edge + Local unified OS
  • Global skill marketplace with micropayments

πŸ“– Documentation

Document Description
ARCHITECTURE.md Full technical architecture
CHANGELOG.md Version history
MCP_SERVER_USAGE.md MCP integration guide
DSPY_INTEGRATION_VISION.md DSPy bridge details

🀝 Contributing

git clone https://github.com/Yunusbayramwork/genesis-protocol.git
cd genesis-protocol
pip install -e ".[dev]"
pytest tests/ -v

We welcome contributions! Areas of interest:

  • New skill implementations
  • Engine adapters for more LLMs
  • Hub marketplace features
  • Performance optimizations

πŸ“ License

MIT License β€” See LICENSE for details.

Free to use, modify, distribute. Attribution appreciated.


🌍 Genesis AOS v3.0
"The Operating System for Artificial Intelligence"
Built by Yunus Bayram

⭐ Star this repo if you believe AI needs an OS, not just models ⭐

About

Genesis Protocol v2.2 - AI-powered recursive code generation with fractal task splitting and smart merge

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages