# prasad4455/uptimeengine-eos architecture

> Architecture diagram of the GitHub repository prasad4455/uptimeengine-eos, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prasad4455/uptimeengine-eos
- Repository: https://github.com/prasad4455/uptimeengine-eos

## Overview

#### Purpose and entry points
UpTimeEngine is a Python AI SRE agent for interactive and automated production-incident investigation. It drives an LLM through live, permission-scoped diagnostic tools, then returns findings or writes them to incident destinations. Primary entry points are the CLI (`UpTimeEngine_cli.py`), API/server (`server.py`, `UpTimeEngine/main.py`), interactive flow (`UpTimeEngine/interactive.py`), and Kubernetes operator (`UpTimeEngine_operator/operator.py`).

#### Configuration and runtime assembly
Configuration selects LLM providers, toolsets, credentials, sources, and operational behavior. `UpTimeEngine/config.py` is the main application configuration boundary; `config.example.yaml` illustrates deployment-level configuration. `UpTimeEngine/core/config.py` and `UpTimeEngine/core/llm.py` construct model-facing runtime behavior, supporting providers such as OpenAI, Anthropic, Azure, Bedrock, Gemini, and compatible endpoints.

#### Investigation agent loop
The central control flow is conversation-driven: incoming question/alert context becomes a prompted LLM request, the model emits tool calls, tool results are incorporated, and the loop continues to a diagnosis. Core orchestration lives in `UpTimeEngine/core/conversations.py`, `UpTimeEngine/core/tool_calling_llm.py`, and `UpTimeEngine/core/tools.py`. Prompt composition combines base templates, issue/resource context, tool instructions, and skills through `UpTimeEngine/core/prompt.py` and `UpTimeEngine/plugins/prompts/`.

#### Durable asynchronous conversations
For API-backed interaction, conversations are processed by a worker subsystem rather than solely inline. `UpTimeEngine/core/conversations_worker/worker.py` coordinates lifecycle and retries; `tool_call_worker.py` executes requested actions; `event_publisher.py` and `realtime_manager.py` distribute progress/results. Persistence and transport are separated behind `UpTimeEngine/core/supabase_dal.py`, indicating Supabase is a material backend for conversation state, usage, and realtime coordination.

#### Toolset registry and execution boundary
Toolsets are pluggable integrations exposed to the LLM as constrained schemas. `UpTimeEngine/core/toolset_manager.py` discovers/enables configured toolsets; `UpTimeEngine/core/tools_utils/tool_executor.py` is the execution boundary; `UpTimeEngine/core/tools_utils/oauth_tool_connector.py` supports authenticated connectors. Built-ins span direct Python/API implementations and declarative YAML toolsets under `UpTimeEngine/plugins/toolsets/`, including Kubernetes, Prometheus, Grafana, Datadog, databases, and internet access. Remote MCP tools are bridged by `UpTimeEngine/plugins/toolsets/mcp/toolset_mcp.py`.

#### Safety, scale, and context management
The repository treats untrusted model output and large observability payloads as first-class boundaries. `UpTimeEngine/core/safeguards.py` governs safety policy, while tool-specific validation exists in paths such as `UpTimeEngine/plugins/toolsets/bash/validation.py`. Tool result storage, memory controls, token budgeting, transformation, and truncation are handled by `UpTimeEngine/core/tools_utils/filesystem_result_storage.py`, `UpTimeEngine/core/transformers/`, and `UpTimeEngine/core/truncation/`. This preserves agent usefulness against large logs/metrics without overflowing process memory or LLM context.

#### Knowledge, alerts, and outcome delivery
Skills/runbooks supplement tool evidence and can be loaded from built-in or external sources via `UpTimeEngine/plugins/skills/skill_loader.py`. Incoming incident context and feedback are modeled in `UpTimeEngine/core/issue.py` and `UpTimeEngine/core/feedback.py`. Source connectors include PagerDuty, Jira, OpsGenie, GitHub, and Prometheus under `UpTimeEngine/plugins/sources/`; findings can be delivered through Slack or PagerDuty plugins in `UpTimeEngine/plugins/destinations/`.

#### Kubernetes operator mode and deployment
A separate Python operator continuously executes health checks in Kubernetes. `UpTimeEngine_operator/operator.py` reconciles CRD-driven checks; `UpTimeEngine_operator/scheduler/manager.py` schedules them; `UpTimeEngine_operator/trigger_executor.py` handles triggered execution. Helm packages application, RBAC, CRDs, optional MCP server deployments, and operator deployment in `helm/UpTimeEngine/`. Containerized deployment is supported by `Dockerfile`, `Dockerfile.operator`, and `docker-compose.yaml`.

Main entry points: [`UpTimeEngine/core/conversations.py`](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/conversations.py) (Investigation loop), [`UpTimeEngine/core/conversations_worker/worker.py`](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/conversations_worker/worker.py) (Conversation worker), [`UpTimeEngine/core/toolset_manager.py`](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/toolset_manager.py) (Toolset registry), [`UpTimeEngine/core/tools_utils/tool_executor.py`](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/tools_utils/tool_executor.py) (Tool executor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_cli["CLI<br/>Python entry point"]
  node_server["API server<br/>Python server<br/>[server.py]"]
  node_app_main["Application main<br/>Python entry point<br/>[main.py]"]
  node_interactive["Interactive flow<br/>conversation UI<br/>[interactive.py]"]
end

subgraph group_agent["Agent runtime"]
  node_app_config["Application config<br/>configuration boundary<br/>[config.py]"]
  node_llm_runtime["LLM runtime<br/>provider assembly<br/>[llm.py]"]
  node_conversation_loop["Investigation loop<br/>agent orchestrator<br/>[conversations.py]"]
  node_prompting["Prompt composition<br/>prompt builder<br/>[prompt.py]"]
  node_safeguards["Safety policy<br/>policy boundary<br/>[safeguards.py]"]
  node_context_controls["Result and context controls<br/>storage and truncation"]
end

subgraph group_tools["Tool boundary"]
  node_toolset_manager["Toolset registry<br/>plugin registry<br/>[toolset_manager.py]"]
  node_tool_executor["Tool executor<br/>execution boundary<br/>[tool_executor.py]"]
  node_tool_plugins["Toolset plugins<br/>Python and YAML integrations"]
end

subgraph group_async["Async conversations"]
  node_worker["Conversation worker<br/>async lifecycle coordinator<br/>[worker.py]"]
  node_tool_call_worker["Tool-call worker<br/>async executor"]
  node_supabase[("Supabase DAL<br/>state and realtime backend<br/>[supabase_dal.py]")]
end

subgraph group_operator["Kubernetes operator"]
  node_operator{{"Kubernetes operator<br/>CRD reconciler<br/>[operator.py]"}}
  node_scheduler["Check scheduler<br/>operator scheduler<br/>[manager.py]"]
  node_helm["Helm deployment<br/>Kubernetes package"]
end

subgraph group_integrations["Incident integrations"]
  node_skills["Skills and runbooks<br/>knowledge loader<br/>[skill_loader.py]"]
  node_sources["Incident sources<br/>source plugins"]
  node_destinations["Outcome destinations<br/>delivery plugins"]
end

node_cli -->|"starts"| node_app_main
node_server -->|"queues conversations"| node_worker
node_app_main -->|"runs"| node_conversation_loop
node_interactive -->|"drives"| node_conversation_loop
node_app_config -->|"configures"| node_llm_runtime
node_app_config -->|"enables"| node_toolset_manager
node_conversation_loop -->|"builds request"| node_prompting
node_prompting -->|"includes runbooks"| node_skills
node_conversation_loop -->|"queries model"| node_llm_runtime
node_conversation_loop -->|"applies policy"| node_safeguards
node_conversation_loop -->|"requests tools"| node_toolset_manager
node_toolset_manager -->|"loads"| node_tool_plugins
node_tool_plugins -->|"invokes through"| node_tool_executor
node_tool_executor -->|"stores and bounds results"| node_context_controls
node_context_controls -->|"returns evidence"| node_conversation_loop
node_worker -->|"dispatches actions"| node_tool_call_worker
node_tool_call_worker -->|"executes"| node_tool_executor
node_worker -->|"persists lifecycle"| node_supabase
node_sources -->|"supplies incident context"| node_server
node_conversation_loop -->|"delivers findings"| node_destinations
node_operator -->|"schedules checks"| node_scheduler
node_helm -->|"deploys"| node_operator

click node_cli "https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine_cli.py"
click node_server "https://github.com/prasad4455/uptimeengine-eos/blob/main/server.py"
click node_app_main "https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/main.py"
click node_interactive "https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/interactive.py"
click node_app_config "https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/config.py"
click node_llm_runtime "https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/llm.py"
click node_conversation_loop "https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/conversations.py"
click node_prompting "https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/prompt.py"
click node_safeguards "https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/safeguards.py"
click node_context_controls "https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/tools_utils/filesystem_result_storage.py"
click node_toolset_manager "https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/toolset_manager.py"
click node_tool_executor "https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/tools_utils/tool_executor.py"
click node_skills "https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/plugins/skills/skill_loader.py"
click node_worker "https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/conversations_worker/worker.py"
click node_tool_call_worker "https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/conversations_worker/tool_call_worker.py"
click node_supabase "https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/supabase_dal.py"
click node_operator "https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine_operator/operator.py"
click node_scheduler "https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine_operator/scheduler/manager.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_server,node_app_main,node_interactive toneBlue
class node_app_config,node_llm_runtime,node_conversation_loop,node_prompting,node_safeguards,node_context_controls toneAmber
class node_toolset_manager,node_tool_executor,node_tool_plugins toneMint
class node_worker,node_tool_call_worker,node_supabase toneRose
class node_operator,node_scheduler,node_helm toneIndigo
class node_skills,node_sources,node_destinations toneTeal
```

## Components

### Entry points

- [CLI](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine_cli.py): Python entry point · `UpTimeEngine_cli.py`
- [API server](https://github.com/prasad4455/uptimeengine-eos/blob/main/server.py): Python server · `server.py`
- [Application main](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/main.py): Python entry point · `UpTimeEngine/main.py`
- [Interactive flow](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/interactive.py): conversation UI · `UpTimeEngine/interactive.py`

### Agent runtime

- [Application config](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/config.py): configuration boundary · Selects providers, credentials, sources, and toolsets. · `UpTimeEngine/config.py`
- [LLM runtime](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/llm.py): provider assembly · Builds configured model clients and behavior. · `UpTimeEngine/core/llm.py`
- [Investigation loop](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/conversations.py): agent orchestrator · Iterates model requests, tool calls, evidence, and diagnosis. · `UpTimeEngine/core/conversations.py`
- [Prompt composition](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/prompt.py): prompt builder · `UpTimeEngine/core/prompt.py`
- [Safety policy](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/safeguards.py): policy boundary · `UpTimeEngine/core/safeguards.py`
- [Result and context controls](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/tools_utils/filesystem_result_storage.py): storage and truncation · Stores, transforms, and truncates large tool payloads. · `UpTimeEngine/core/tools_utils/filesystem_result_storage.py`

### Tool boundary

- [Toolset registry](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/toolset_manager.py): plugin registry · Discovers and enables configured integrations. · `UpTimeEngine/core/toolset_manager.py`
- [Tool executor](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/tools_utils/tool_executor.py): execution boundary · Executes constrained tool calls. · `UpTimeEngine/core/tools_utils/tool_executor.py`
- **Toolset plugins**: Python and YAML integrations · Includes observability, Kubernetes, databases, internet, and MCP tools.

### Async conversations

- [Conversation worker](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/conversations_worker/worker.py): async lifecycle coordinator · Coordinates processing and retries. · `UpTimeEngine/core/conversations_worker/worker.py`
- [Tool-call worker](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/conversations_worker/tool_call_worker.py): async executor · `UpTimeEngine/core/conversations_worker/tool_call_worker.py`
- [Supabase DAL](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/core/supabase_dal.py): state and realtime backend · Persists conversations and usage and coordinates realtime updates. · `UpTimeEngine/core/supabase_dal.py`

### Kubernetes operator

- [Kubernetes operator](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine_operator/operator.py): CRD reconciler · Runs continuous Kubernetes health checks. · `UpTimeEngine_operator/operator.py`
- [Check scheduler](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine_operator/scheduler/manager.py): operator scheduler · `UpTimeEngine_operator/scheduler/manager.py`
- **Helm deployment**: Kubernetes package · Packages app, RBAC, CRDs, MCP deployments, and operator.

### Incident integrations

- [Skills and runbooks](https://github.com/prasad4455/uptimeengine-eos/blob/main/UpTimeEngine/plugins/skills/skill_loader.py): knowledge loader · `UpTimeEngine/plugins/skills/skill_loader.py`
- **Incident sources**: source plugins · Receives context from PagerDuty, Jira, OpsGenie, GitHub, and Prometheus.
- **Outcome destinations**: delivery plugins · Delivers findings to Slack or PagerDuty.

## Connections

- CLI → Application main: starts
- API server → Conversation worker: queues conversations
- Application main → Investigation loop: runs
- Interactive flow → Investigation loop: drives
- Application config → LLM runtime: configures
- Application config → Toolset registry: enables
- Investigation loop → Prompt composition: builds request
- Prompt composition → Skills and runbooks: includes runbooks
- Investigation loop → LLM runtime: queries model
- Investigation loop → Safety policy: applies policy
- Investigation loop → Toolset registry: requests tools
- Toolset registry → Toolset plugins: loads
- Toolset plugins → Tool executor: invokes through
- Tool executor → Result and context controls: stores and bounds results
- Result and context controls → Investigation loop: returns evidence
- Conversation worker → Tool-call worker: dispatches actions
- Tool-call worker → Tool executor: executes
- Conversation worker → Supabase DAL: persists lifecycle
- Incident sources → API server: supplies incident context
- Investigation loop → Outcome destinations: delivers findings
- Kubernetes operator → Check scheduler: schedules checks
- Helm deployment → Kubernetes operator: deploys
