Architecture

LYDOS Agent OS v12.0.0 is a beta-stage AI orchestration platform built on FastAPI, with 29 active modules, 109 agents, and 245 Q-Series engines. All components are health-monitored with an overall system score of 98/100.

System Overview

Client Layer
CLI · Python SDK · TypeScript SDK · MCP · REST API
API Gateway
FastAPI (port 8888) · Rate Limiter · Auth · Circuit Breaker
Q-Series Engines (Q1–Q248)
245 engines · 128+ routers · MCP integration · REST
Agent Layer
109 agents (99 YAML + 13 Python) · 4 categories · Delegation via Q29
LLM Router (Q43)
Primary Provider (PRIMARY) → Bilingual Provider (FALLBACK) → Analysis Provider (BACKUP) → Cloud Provider
Infrastructure
SQLite WAL · Semantic Memory · WebSocket Hub · Observability

Directory Structure

Each Q-Series engine owns its own module file and route handler under core/engines/ and core/routes/.

project structure
Bash
LYDOS-AGENT-ORCHESTRATOR/
server.py # FastAPI server (port 8888, Q1-Q248 registered)
core/
agents/ # 13 Python agent implementations
engines/ # Q25-Q248 engine modules
infrastructure/ # MCP server (162 tools), DB pool, circuit breaker
routes/ # API route handlers (per-engine)
system/ # self_healing_engine, kernel_loader
lyd/ # LYD v3.0 orchestrator, TELOS, voice_engine
security_hardening.py
observability.py
health_dashboard.py
config/
agents.yaml # 99 YAML agent definitions (14 departments)
kernel.yaml # System configuration
master_prompt.md # AI system prompt (constitutional)
hooks/
session-start.sh # Auto-start server + health cache write
post-compact.sh # TELOS goals + health injection post-compaction
telos/ # TELOS goal storage (23 active goals)
web/ # Next.js 15 frontend (this site)
data/ # Skill library, CTI feeds, free-for-dev index
tests/ # 7670+ tests (pytest), 0 failures
scripts/ # Utility scripts, cache refresh, sync
.env # API keys (never committed to git)

29 Active Modules

All 29 modules are health-monitored at GET /api/health. The overall system score is 98/100.

LayerModuleDescriptionScore
Corekernel_loaderSystem bootstrap, module loading and registration100/100
Coreconfig_managerYAML/JSON configuration management with hot reload100/100
Coreerror_handlerStructured error handling with automatic recovery100/100
Coreself_healing_engineAuto-recovery, health monitoring, fault detection100/100
Agentsagent_manager109 agents: 99 YAML + 13 Python, lifecycle management100/100
Agentsharika_agentProject analysis, code review, quality assessment100/100
Agentsharika_supremeMulti-agent supreme analysis with consensus voting100/100
Agentsharika_ultra_team8-agent UltraTeam orchestration, parallel analysis100/100
LLMgroq_apiPrimary Provider LLM integration (llama-3.3-70b, speech recognition)100/100
LLMllm_routerMulti-provider routing (Q43) with automatic failover100/100
LLMgroq_full_clientFull Primary Provider API client with streaming support100/100
LLMzai_clientBilingual Provider integration (long context, multilingual)100/100
LLMclaude_apiAnalysis Provider integration with tool calling100/100
v7rate_limiterToken bucket rate limiting per endpoint and user100/100
v7http_clientAsync HTTP client pool with retry logic100/100
v7circuit_breakerCircuit breaker pattern for external service calls100/100
v7db_poolSQLite WAL connection pool with async support100/100
v7observabilityStructured logging, metrics collection, tracing100/100
v7agent_schedulerCron-based agent scheduling with dependency resolution100/100
v7task_queuePriority task queue with retry and dead-letter support100/100
v7websocket_hubReal-time WebSocket events, pub/sub channels100/100
v7multi_stt_engineSpeech-to-text engine using speech recognition100/100
v7semantic_memoryVector-based semantic memory with similarity search100/100
v7security_hardeningSecurity headers, input validation, sanitization100/100
v7cuda_agentGPU acceleration agent for heavy computation100/100
Inframcp_server162 MCP tools, STDIO transport, AI IDE integration100/100
Infranim_llm_clientNVIDIA NIM integration for on-premise inference100/100
Depspython_dependencies7/7 dependency management, version pinning100/100

Agent Architecture

115Python Agents

Programmatic agents with full code logic, async support, and tool integration

105YAML Agents

Declarative config-driven agents defined in agents.yaml with schema validation

28Security Agents

Vulnerability scanning, compliance checking, penetration testing patterns

31Code Quality Agents

Static analysis, refactoring, test generation, documentation

24Research Agents

Web research, CTI feeds, competitive analysis, knowledge extraction

22DevOps Agents

CI/CD integration, infrastructure monitoring, deployment automation

Delegation routingis handled by Q29 Agent Intelligence using 4 strategies: Function Calling, ReAct, Plan & Execute, and Chain of Thought. Q22 Agent Bus provides inter-agent RPC with circuit breaker and deadlock detection.

Infrastructure

VPS
Hetzner CPX22, Helsinki
2 vCPU, 4 GB RAM, 75 GB SSD, Ubuntu 24.04, $7.59/month
Tunneling
WireRift (custom Go)
WRF binary protocol, stream multiplexing, token auth, 3 active tunnels
Sync
Mutagen v0.18.1
10 sessions, bidirectional real-time sync, < 5s latency
VCS
GitHub (private)
lydianai/LYDOS-AGENT-ORCHESTRATOR, git-filter-repo cleaned
Process Manager
systemd + linger
lydos.service, wirerift.service, tmux-lydos.service
CI/CD
Q61 CI/CD Bridge
GitHub webhooks, automated fix pipeline, PR creation on success

Health Monitoring

All 29 modules emit health signals. The self_healing_engine automatically recovers failed modules. Q62 Dashboard Engine provides WebSocket real-time monitoring.

health_check.py
Python
# Check system health
import httpx
 
response = await httpx.AsyncClient().get("http://localhost:8888/api/health")
health = response.json()
 
print(f"Overall score: {health['score']}/100")
print(f"Modules: {health['modules_healthy']}/29 healthy")
 
# Per-module status
for module, status in health["modules"].items():
indicator = "OK" if status["healthy"] else "FAIL"
print(f" [{indicator}] {module}: {status['score']}/100")
realtime_monitor.py
Python
# Q62 WebSocket real-time monitoring
import websockets
import json
 
async with websockets.connect("ws://localhost:8888/api/q62/dashboard/ws") as ws:
async for message in ws:
event = json.loads(message)
if event["type"] == "agent.status":
print(f"Agent {event['agent_id']}: {event['status']}")
elif event["type"] == "health.update":
print(f"Health score: {event['score']}/100")

LYD v3.0 Integration

23 active
TELOS Goals
Speech Recognition
Voice Engine
Semantic + long-term
Memory
lyd / ./lyd
CLI

LYD v3.0 (LYDOS Operating System) sits above the Q-Series layer and orchestrates autonomous goal execution via TELOS. Goals persist across sessions in telos/. The voice engine enables hands-free operation via speech recognition STT. Memory consolidation runs automatically at session end.

lyd CLI
Bash
# LYD v3.0 CLI commands
lyd status # Full system overview
lyd telos # TELOS goal hierarchy (23 active goals)
lyd tasks # Today's task list
lyd listen 5 # Voice command (5 seconds speech recognition)
lyd memory # Semantic memory overview
lyd consolidate # Save session memories to long-term storage

Testing

7,670+
Total Tests
pytest suite
100%
Pass Rate
0 failures
157
Skipped
integration tests