How prasad4455/uptimeengine-eos works
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: conversations.py Investigation loop · worker.py Conversation worker · toolset_manager.py Toolset registry · tool_executor.py Tool executor
Components 22
Entry points
- CLI
UpTimeEngine_cli.py - API server
server.py - Application main
UpTimeEngine/main.py - Interactive flow
UpTimeEngine/interactive.py
Agent runtime
- Application config · Selects providers, credentials, sources, and toolsets.
UpTimeEngine/config.py - LLM runtime · Builds configured model clients and behavior.
UpTimeEngine/core/llm.py - Investigation loop · Iterates model requests, tool calls, evidence, and diagnosis.
UpTimeEngine/core/conversations.py - Prompt composition
UpTimeEngine/core/prompt.py - Safety policy
UpTimeEngine/core/safeguards.py - Result and context controls · Stores, transforms, and truncates large tool payloads.
UpTimeEngine/core/tools_utils/filesystem_result_storage.py
Tool boundary
- Toolset registry · Discovers and enables configured integrations.
UpTimeEngine/core/toolset_manager.py - Tool executor · Executes constrained tool calls.
UpTimeEngine/core/tools_utils/tool_executor.py - Toolset plugins · Includes observability, Kubernetes, databases, internet, and MCP tools.
Async conversations
- Conversation worker · Coordinates processing and retries.
UpTimeEngine/core/conversations_worker/worker.py - Tool-call worker
UpTimeEngine/core/conversations_worker/tool_call_worker.py - Supabase DAL · Persists conversations and usage and coordinates realtime updates.
UpTimeEngine/core/supabase_dal.py
Kubernetes operator
- Kubernetes operator · Runs continuous Kubernetes health checks.
UpTimeEngine_operator/operator.py - Check scheduler
UpTimeEngine_operator/scheduler/manager.py - Helm deployment · Packages app, RBAC, CRDs, MCP deployments, and operator.
Incident integrations
- Skills and runbooks
UpTimeEngine/plugins/skills/skill_loader.py - Incident sources · Receives context from PagerDuty, Jira, OpsGenie, GitHub, and Prometheus.
- Outcome destinations · Delivers findings to Slack or PagerDuty.
Connections 22
- 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