### Run Unpage Agent Quickstart Source: https://github.com/aptible/unpage/blob/main/docs/index.mdx This command initiates the Unpage agent quickstart process, likely setting up example agents and configurations for immediate use. ```Shell Script # Quickstart unpage agent quickstart ``` -------------------------------- ### Run Unpage Agent Quickstart Source: https://github.com/aptible/unpage/blob/main/docs/index.mdx This command initiates the quickstart process for an Unpage agent. It helps in setting up an agent to investigate alerts from providers like PagerDuty and configure an infrastructure knowledge graph for enhanced context. ```shell unpage agent quickstart ``` -------------------------------- ### Install Unpage using curl Source: https://github.com/aptible/unpage/blob/main/docs/index.mdx This command installs the Unpage agent using a curl script. It's a straightforward way to get Unpage set up on your system. ```Shell Script # Install Unpage curl -fsSL https://install.unpage.ai | bash ``` -------------------------------- ### Start MLflow tracking server Source: https://github.com/aptible/unpage/blob/main/CONTRIBUTING.md Starts a local MLflow tracking server, which is used for debugging agent executions by enabling tracing. ```bash uv run unpage mlflow serve ``` -------------------------------- ### Run unpage configure command Source: https://github.com/aptible/unpage/blob/main/docs/commands/configure.mdx Executes the unpage configure command to start the interactive setup wizard. This command guides users through setting up API keys, authentication, plugins, and integrations. ```shell unpage configure ``` -------------------------------- ### Start MCP Server Source: https://github.com/aptible/unpage/blob/main/CLAUDE.md Starts the MCP (Model Coupling Protocol) server, which enables LLM-powered applications to interact with the infrastructure. ```bash # Start the MCP server uv run unpage mcp start ``` -------------------------------- ### Install pre-commit hooks Source: https://github.com/aptible/unpage/blob/main/CONTRIBUTING.md Sets up pre-commit hooks for linting and formatting within the Unpage project. These hooks run automatically before each commit to ensure code quality. ```shell uv run pre-commit install ``` -------------------------------- ### Install Unpage on macOS Source: https://github.com/aptible/unpage/blob/main/docs/index.mdx This command installs Unpage on macOS using a curl script. It's the recommended method for macOS users. ```Shell Script curl -fsSL https://unpage.ai/install.sh | bash ``` -------------------------------- ### Start MLflow Tracking Server Source: https://github.com/aptible/unpage/blob/main/CLAUDE.md Starts the MLflow tracking server, which is used for debugging agents and tracking experiments. ```bash # Start MLflow tracking server for debugging agents uv run unpage mlflow serve ``` -------------------------------- ### Unpage Agent Quickstart Source: https://github.com/aptible/unpage/blob/main/docs/commands/agent.mdx Launches an interactive wizard to quickly set up an incident response agent. ```shell unpage agent quickstart [OPTIONS] ``` -------------------------------- ### Install Development Dependencies Source: https://github.com/aptible/unpage/blob/main/CLAUDE.md Installs all necessary development dependencies for the project using the uv package manager. ```bash # Install development dependencies uv pip install --dev ``` -------------------------------- ### Install Pre-commit Hooks Source: https://github.com/aptible/unpage/blob/main/CLAUDE.md Installs pre-commit hooks for the project, which helps automate code quality checks before commits. This is a one-time setup. ```bash # Install pre-commit hooks (one-time setup) uv run pre-commit install ``` -------------------------------- ### Unpage Plugin Configuration Example Source: https://github.com/aptible/unpage/blob/main/docs/concepts/plugins.mdx An example YAML configuration file showing how to enable specific Unpage plugins (AWS, Datadog) and provide necessary authentication details. ```yaml plugins: aws: enabled: true accounts: default: profile: "production" datadog: enabled: true api_key: "your_api_key" app_key: "your_app_key" ``` -------------------------------- ### Run Unpage Agent Quickstart Source: https://github.com/aptible/unpage/blob/main/README.md This command initiates the Unpage agent quickstart process. It's designed to help users quickly set up their first agent, which can automatically investigate and add context to alerts from providers like PagerDuty, and optionally configure the infrastructure knowledge graph. ```shell # Quickstart unpage agent quickstart ``` -------------------------------- ### Run Unpage Agent service with MLflow Source: https://github.com/aptible/unpage/blob/main/CONTRIBUTING.md Starts the Unpage Agent service with MLflow tracing enabled by setting the MLFLOW_TRACKING_URI environment variable. ```shell MLFLOW_TRACKING_URI=http://127.0.0.1:5566 uv run unpage agent server ``` -------------------------------- ### Debug Tools with Specific Parameters Source: https://github.com/aptible/unpage/blob/main/docs/concepts/tools.mdx Demonstrates how to test Unpage tools with specific parameters and view detailed output structures using the `unpage mcp tools call` command. It includes an example for fetching node metrics and another for getting resource details, piping the output to `jq` for pretty-printing. ```bash # Test a tool with specific parameters unpage mcp tools call metrics_get_metrics_for_node --node-id i-0abc123def456 --metric cpu_utilization # See detailed output structure unpage mcp tools call graph_get_resource_details --resource-id i-0abc123def456 | jq ``` -------------------------------- ### Install uv with Homebrew Source: https://github.com/aptible/unpage/blob/main/CONTRIBUTING.md Installs the uv package manager on macOS using Homebrew, a prerequisite for local development. ```shell brew install uv ``` -------------------------------- ### Unpage MCP Server Start Command Source: https://github.com/aptible/unpage/blob/main/docs/concepts/plugins.mdx This command starts the MCP server, making the tools exposed by Unpage plugins available for LLMs to discover and utilize. ```bash unpage mcp start ``` -------------------------------- ### Monitoring Agent Performance with MLflow Source: https://github.com/aptible/unpage/blob/main/docs/examples/creating_new_agents.mdx Provides bash commands to start the MLflow tracking server and run an Unpage agent with tracing enabled. It explains how to view execution traces in MLflow to monitor tool usage, timing, errors, and decision flows. ```bash # Start MLflow tracking server $ unpage mlflow serve # Run agent with tracing enabled $ env MLFLOW_TRACKING_URI=http://127.0.0.1:5566 unpage agent run redis_memory_alerts @test_alert.json ``` -------------------------------- ### Install Unpage using curl Source: https://github.com/aptible/unpage/blob/main/README.md This shell command downloads and executes the Unpage installation script from the official unpage.ai domain using curl. It's a straightforward method for installing Unpage on compatible systems. ```shell # Install Unpage curl -fsSL https://install.unpage.ai | bash ``` -------------------------------- ### Example Complete Agent Configuration (YAML) Source: https://github.com/aptible/unpage/blob/main/docs/concepts/agents.mdx A comprehensive example of an agent configuration file, including its description for routing purposes. This demonstrates how to define an agent for analyzing CPU usage alerts from specific sources. ```yaml # cpu-alert-agent.yaml # Used by the router to determine which agent to use for an alert description: > Use this agent to analyze alerts that meet the following criteria: - The alert is related to CPU usage exceeding thresholds - The alert comes from AWS CloudWatch or Datadog - The affected resource is a compute instance (EC2, container, etc.) ``` -------------------------------- ### Example Redis Memory Alert Payload Source: https://github.com/aptible/unpage/blob/main/docs/examples/creating_new_agents.mdx This JSON payload represents an example alert triggered when Redis memory usage exceeds a critical threshold, including details about the incident title, description, service, and status. ```json { "incident": { "title": "Redis Memory Usage Critical", "description": "redis-prod-cluster memory usage: 87.2% (6.1GB/7.0GB)", "service": "redis-prod-cluster", "status": "triggered" } } ``` -------------------------------- ### Define a Simple Shell Command Source: https://github.com/aptible/unpage/blob/main/docs/plugins/shell.mdx Example of defining a shell command with a handle, description, and the command itself (`pwd`). This makes the `pwd` command available as a tool. ```yaml plugins: # ... shell: enabled: true settings: commands: - handle: get_current_directory description: Get the path to the current directory. command: pwd ``` -------------------------------- ### Start Unpage MCP Server Source: https://github.com/aptible/unpage/blob/main/docs/commands/mcp.mdx Launches the Unpage MCP Server, which enables LLM-powered applications to interact with infrastructure. Supports various transport protocols (HTTP, stdio) and custom configurations for host and port. ```shell unpage mcp start ``` ```shell unpage mcp start --disable-stdio ``` ```shell unpage mcp start --http-host 0.0.0.0 --http-port 9000 ``` ```shell unpage mcp start --profile production ``` -------------------------------- ### Configure LLM Plugin via CLI Source: https://github.com/aptible/unpage/blob/main/docs/plugins/llm.mdx This command initiates the interactive configuration process for the Unpage LLM plugin, guiding the user through provider and model selection. ```bash $ uv run unpage configure ``` -------------------------------- ### Example Tool Schema for Metrics Source: https://github.com/aptible/unpage/blob/main/docs/concepts/tools.mdx Illustrates a JSON schema for a tool that retrieves metrics for a specific node. The schema defines the tool's name, description, parameters (including types, constraints, and required fields), and the structure of its return data. ```json { "name": "metrics_get_metrics_for_node", "description": "Get metrics data for a specific node", "parameters": { "type": "object", "properties": { "node_id": { "type": "string", "description": "ID of the node to get metrics for" }, "metric": { "type": "string", "description": "Name of the metric to retrieve" }, "start_time": { "type": "string", "description": "ISO8601 timestamp for start of range" }, "end_time": { "type": "string", "description": "ISO8601 timestamp for end of range" }, "aggregation": { "type": "string", "enum": ["avg", "max", "min", "sum"], "default": "avg", "description": "Aggregation function to use" } }, "required": ["node_id", "metric"] }, "returns": { "type": "object", "properties": { "datapoints": { "type": "array", "items": { "type": "object", "properties": { "timestamp": { "type": "string", "format": "date-time" }, "value": { "type": "number" } } } }, "min": {"type": "number"}, "max": {"type": "number"}, "avg": {"type": "number"} } } } ``` -------------------------------- ### Serve Unpage Agent Server Source: https://github.com/aptible/unpage/blob/main/docs/commands/agent.mdx Starts the Unpage Agent server to automatically process incoming alerts via a webhook endpoint. Supports custom host, port, and ngrok tunneling. ```shell unpage agent serve [OPTIONS] ``` ```shell # Start the agent server with default settings (localhost:8000) unpage agent serve ``` ```shell # Start the server on a custom host and port unpage agent serve --host 0.0.0.0 --port 9000 ``` ```shell # Start the server with hot-reloading for development unpage agent serve --reload ``` ```shell # Start the server and expose it externally using ngrok unpage agent serve --tunnel --ngrok-token your_ngrok_token ``` -------------------------------- ### YAML Configuration for Granting Tool Access Source: https://github.com/aptible/unpage/blob/main/docs/concepts/tools.mdx Demonstrates how to configure agent-level access to specific Unpage tools using YAML. It shows examples of granting access to individual tools and using wildcards for broader permissions. ```YAML tools: - "core_current_datetime" - "metrics_get_metrics_for_node" - "graph_get_resource_details" - "solarwinds_search_logs" ``` ```YAML tools: # Allow all metrics tools - "metrics_*" # Allow all tools except those that modify resources - "/^(?!.*_modify_|.*_delete_|.*_create_).*$/" ``` -------------------------------- ### Serve Unpage Agent Webhooks Source: https://github.com/aptible/unpage/blob/main/docs/examples/ssl_connection_failure.mdx Command to start an Unpage agent server that listens for incoming webhooks, typically from services like PagerDuty. The server runs on localhost:8000/webhook by default. ```bash # Webhook listener on localhost:8000/webhook $ unpage agent serve ``` -------------------------------- ### Agent Prompt Configuration (YAML) Source: https://github.com/aptible/unpage/blob/main/docs/concepts/agents.mdx Contains detailed instructions for the agent, outlining information gathering, analysis steps, action recommendations, and operational constraints. It guides the LLM's behavior in responding to infrastructure events. ```yaml prompt: > You are responsible for analyzing high CPU usage alerts on production EC2 instances. Follow these steps: 1. Verify that CPU usage is indeed exceeding 90% using current metrics 2. Check if the instance is experiencing unusual load by examining: - Recent log entries for errors or warnings - Unusual network traffic patterns - Scheduled jobs that might be running 3. Determine if this is an isolated incident or affecting multiple instances 4. If the issue appears to be temporary and non-critical: - Post a status update indicating it's likely transient 5. If the issue appears serious: - Post a detailed analysis with recommended next steps - Highlight any potential service impacts Always include specific metrics and timestamps in your analysis. Never make assumptions without data to support them. ``` -------------------------------- ### Configure Unpage Application Source: https://github.com/aptible/unpage/blob/main/CLAUDE.md Configures the Unpage application, likely involving setting up plugins and environment variables. ```bash # Configure the application uv run unpage configure ``` -------------------------------- ### Define SSL Connection Failure Agent in YAML Source: https://github.com/aptible/unpage/blob/main/docs/index.mdx This YAML configuration defines an Unpage agent designed to investigate SSL/TLS connection failures. It includes a description for routing, a prompt detailing investigation steps, and a list of tools the agent can utilize. ```YAML # SSL-connection-failure-agent.yaml # Description: Used by the router to determine which agent to use for the alert description: Investigate SSL/TLS connection failures # Prompt: Instructions for the agent to follow when acting on the alert prompt: > - Extract the domain/hostname from the alert about connection failures. - Use shell command `shell_check_cert_expiration_date` to check the certificate expiration dates - Parse the certificate dates to determine if the cert is expired or expiring soon - If certificate is expired or expiring within 24 hours: - Post high-priority status update to the incident explaining the root cause - Include the exact expiration date and affected resources # Tools: Allows the agent to use the specified tools during its investigation tools: > - "shell_check_cert_expiration_date" - "pagerduty_post_status_update" ``` -------------------------------- ### Install Unpage on macOS Source: https://github.com/aptible/unpage/blob/main/README.md This shell command installs Unpage on macOS by downloading and executing an installation script from unpage.ai. For other platforms, users are instructed to first install 'uv' and then run this command. ```shell # Installation On macOS: curl -fsSL https://unpage.ai/install.sh | bash For other platforms, first install `uv` using the [official uv installation guide](https://github.com/astral-sh/uv), then run the command above. ``` -------------------------------- ### Serve Unpage Agent for Webhook Testing and Production Source: https://github.com/aptible/unpage/blob/main/docs/examples/creating_new_agents.mdx This bash snippet covers serving an Unpage agent to handle incoming webhooks. It includes options for local testing with a simple server, using ngrok for public tunneling, and configuring production deployments with host and port settings. ```bash # Local webhook server for testing $ unpage agent serve # Public webhook with ngrok tunnel $ unpage agent serve --tunnel --ngrok-token YOUR_NGROK_TOKEN # Production deployment (typically with reverse proxy) $ unpage agent serve --host 0.0.0.0 --port 8000 ``` -------------------------------- ### List Available Unpage Tools Source: https://github.com/aptible/unpage/blob/main/docs/examples/creating_new_agents.mdx A bash command to list all available built-in tools within the Unpage MCP (Management and Control Plane). This is useful for discovering and verifying the tools an agent can be granted permission to use. ```bash $ unpage mcp tools list ``` -------------------------------- ### External System Integration Tools Source: https://github.com/aptible/unpage/blob/main/docs/examples/creating_new_agents.mdx Lists shell commands that Unpage agents can use to integrate with external systems. These tools enable actions like sending Slack notifications, creating Jira tickets, triggering runbooks, and updating status pages. ```yaml tools: - "shell_slack_notify_team" - "shell_create_jira_ticket" - "shell_trigger_runbook_automation" - "shell_update_status_page" ``` -------------------------------- ### Install uv Package Manager Source: https://github.com/aptible/unpage/blob/main/CLAUDE.md Installs the uv package manager on macOS using Homebrew. This is a prerequisite for managing development dependencies. ```bash # Install uv package manager (if needed) brew install uv # On macOS ``` -------------------------------- ### Start MLflow Server Source: https://github.com/aptible/unpage/blob/main/docs/commands/mlflow.mdx Starts a local MLflow tracking server for agent debugging and monitoring. This server captures and visualizes agent runs, prompts, and responses. It can be configured to run on a specific port. ```shell unpage mlflow serve ``` ```shell unpage mlflow serve --port 8080 ``` -------------------------------- ### Run Unpage Application Source: https://github.com/aptible/unpage/blob/main/CLAUDE.md Executes the main Unpage application. This is the primary command for running the project. ```bash # Run the application uv run unpage ``` -------------------------------- ### Redis Memory Analysis Prompt Source: https://github.com/aptible/unpage/blob/main/docs/examples/creating_new_agents.mdx Defines the step-by-step instructions for an LLM agent to analyze Redis memory alerts. It includes data extraction, tool usage for memory statistics and key analysis, log searching, and defining response criteria based on memory usage and growth. ```yaml prompt: > You are a Redis memory analysis specialist. When investigating Redis memory alerts: 1. Extract the Redis instance/cluster name from the PagerDuty alert 2. Use `shell_redis_memory_info` to get current memory statistics and configuration 3. Use `shell_redis_top_keys` to identify the largest keys consuming memory 4. Use `shell_redis_memory_usage_history` to analyze memory growth patterns over the last 4 hours 5. Use `search_datadog_logs` to find Redis logs from the last 30 minutes, looking for: - Memory-related warnings or errors - Large key operations (HSET, SADD with many members) - Client connection spikes that might indicate memory leaks 6. Use `get_resource_with_neighbors` to identify applications connected to this Redis instance 7. For each connected application, search logs for Redis-related errors or unusual patterns Analysis and Response: - If memory usage is above 90%: Mark as CRITICAL and recommend immediate action - If memory usage is 85-90%: Mark as HIGH and suggest proactive measures - If large keys (>100MB) exist: Identify the key patterns and suggest optimization - If memory growth is rapid (>10% in 1 hour): Flag as potential memory leak Create a comprehensive status update including: - Current memory usage percentage and absolute values - Top 10 memory-consuming key patterns with sizes - Memory growth rate over the last 4 hours - Any concerning log patterns or errors - Connected applications that might be causing issues - Specific recommended actions (key cleanup, configuration changes, scaling) Post findings using `pagerduty_post_status_update` with priority based on severity analysis. ``` -------------------------------- ### Example Log Entry for Disk Space Issue Source: https://github.com/aptible/unpage/blob/main/docs/examples/disk_space_alerts.mdx An example log entry indicating a critical disk space issue, showing the timestamp and the percentage of disk space used on the root partition. ```shell [04:17:32 AM] CRITICAL - Disk space: / 96% used (23.4GB/24.5GB) ``` -------------------------------- ### Start Unpage Agent Webhook Listener Source: https://github.com/aptible/unpage/blob/main/docs/examples/k8s_crash_loop_backoff.mdx Commands to start the Unpage agent in serve mode to listen for incoming PagerDuty webhooks. Includes options for local testing and using ngrok for external access. ```bash # Webhook listener on localhost:8000/webhook $ unpage agent serve # Webhook listener on your_ngrok_domain/webhook $ unpage agent serve --tunnel --ngrok-token your_ngrok_token ``` -------------------------------- ### Build Infrastructure Knowledge Graph Source: https://github.com/aptible/unpage/blob/main/CLAUDE.md Builds the infrastructure knowledge graph, which represents infrastructure resources and their relationships. ```bash # Build the infrastructure knowledge graph uv run unpage graph build ``` -------------------------------- ### Test Unpage Agent with Sample Data and PagerDuty Incident Source: https://github.com/aptible/unpage/blob/main/docs/examples/creating_new_agents.mdx This bash snippet demonstrates how to locally test an Unpage agent using sample alert payloads or PagerDuty incident IDs. It simulates the input that the agent would receive in a real-world scenario. ```bash # Test with a sample alert payload $ echo '{"incident": {"title": "Redis Memory Usage Critical", "description": "redis-prod-cluster memory usage: 87.2%"}}' | unpage agent run redis_memory_alerts # Test with a PagerDuty incident ID $ unpage agent run redis_memory_alerts --pagerduty-incident PXXXXX ``` -------------------------------- ### Test `get_current_directory` Tool Source: https://github.com/aptible/unpage/blob/main/docs/plugins/shell.mdx Example of calling the `shell_get_current_directory` tool via the CLI to test its functionality and output. ```bash $ uv run unpage mcp tools call shell_get_current_directory /Users/michael/unpage ``` -------------------------------- ### Create Custom Redis Shell Commands for Unpage Source: https://github.com/aptible/unpage/blob/main/docs/examples/creating_new_agents.mdx This snippet shows how to define custom shell commands within the Unpage configuration to interact with Redis instances. It includes commands for retrieving memory information and identifying large keys, specifying arguments for host and port. ```yaml plugins: # ... existing plugins shell: enabled: true settings: commands: - handle: redis_memory_info description: Get comprehensive Redis memory statistics and configuration command: | redis-cli -h {redis_host} -p {redis_port} --raw INFO memory && echo "---CONFIG---" && redis-cli -h {redis_host} -p {redis_port} CONFIG GET maxmemory* && redis-cli -h {redis_host} -p {redis_port} CONFIG GET save args: redis_host: The Redis server hostname or IP address redis_port: The Redis server port (default 6379) - handle: redis_top_keys description: Identify the largest keys in Redis by memory usage command: | redis-cli -h {redis_host} -p {redis_port} --latency-history -i 1 > /dev/null 2>&1 & LATENCY_PID=$! redis-cli -h {redis_host} -p {redis_port} --bigkeys --i 0.01 kill $LATENCY_PID 2>/dev/null || true args: redis_host: The Redis server hostname or IP address redis_port: The Redis server port (default 6379) - handle: redis_memory_usage_history description: Get Redis memory usage metrics from the last 4 hours via DataDog API command: | curl -X GET "https://api.datadoghq.com/api/v1/query" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DATADOG_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DATADOG_APP_KEY}" \ -G \ --data-urlencode "query=avg:redis.info.memory.used_memory{host:{redis_host}}" \ --data-urlencode "from=$(date -d '4 hours ago' +%s)" \ --data-urlencode "to=$(date +%s)" args: redis_host: The Redis server hostname to query metrics for ``` -------------------------------- ### Get Resource Map Source: https://github.com/aptible/unpage/blob/main/docs/plugins/graph.mdx Generates a detailed map of a resource and its dependencies up to a specified depth. The output is a DOT graph representation. ```bash unpage graph get_resource_map --root_node_id "" [--max_depth ] ``` -------------------------------- ### Test `list_files_in_directory` Tool Source: https://github.com/aptible/unpage/blob/main/docs/plugins/shell.mdx Example of calling the `shell_list_files_in_directory` tool with a directory argument to list files and test its functionality. ```bash $ uv run unpage mcp tools call shell_list_files_in_directory /Users/michael/Downloads total 0 drwx------@ 4 michael staff 128B Jul 25 13:01 . drwxr-x---+ 57 michael staff 1.8K Jul 25 13:01 .. -rw-r--r--@ 1 michael staff 9.5K Jul 25 13:01 unpage.zip ``` -------------------------------- ### Unpage Multi-Step Analysis Agent Structure Source: https://github.com/aptible/unpage/blob/main/docs/examples/creating_new_agents.mdx This YAML snippet outlines a structured approach for creating multi-step analysis agents in Unpage. It defines phases for data collection, root cause analysis, impact assessment, and response, providing a template for complex incident handling. ```yaml prompt: > Phase 1 - Data Collection: - Gather all relevant metrics and logs - Verify the scope of the issue Phase 2 - Root Cause Analysis: - Correlate data to identify potential causes - Rule out common false positives Phase 3 - Impact Assessment: - Determine affected services and users - Estimate business impact Phase 4 - Response and Communication: - Post detailed findings with evidence - Recommend specific remediation steps - Set appropriate incident priority ``` -------------------------------- ### Get Resource Details Source: https://github.com/aptible/unpage/blob/main/docs/plugins/graph.mdx Fetches the complete details of a specific resource using its unique node ID. This is typically obtained from the `search_resources` tool. ```bash unpage graph get_resource_details --node_id "" ``` -------------------------------- ### Run Ruff Formatter Source: https://github.com/aptible/unpage/blob/main/CLAUDE.md Applies code formatting using Ruff to ensure consistent style across the project. ```bash # Run formatter uv run ruff format . ``` -------------------------------- ### Get Resource Topology Source: https://github.com/aptible/unpage/blob/main/docs/plugins/graph.mdx Retrieves a map of resource types and their connections within the Knowledge Graph. This tool returns a DOT graph representation. ```bash unpage graph get_resource_topology ``` -------------------------------- ### Get Neighboring Resources Source: https://github.com/aptible/unpage/blob/main/docs/plugins/graph.mdx Retrieves the node IDs of resources directly connected to a given resource. The `max_depth` parameter controls how far to traverse for neighbors. ```bash unpage graph get_neighboring_resources --node_id "" [--max_depth ] ``` -------------------------------- ### Run Tests with Coverage Source: https://github.com/aptible/unpage/blob/main/CLAUDE.md Executes tests and generates a code coverage report for the 'unpage' module. ```bash # Run tests with coverage uv run pytest --cov=unpage ``` -------------------------------- ### Mermaid Sequence Diagram for Tool Interaction Source: https://github.com/aptible/unpage/blob/main/docs/concepts/tools.mdx Illustrates the sequence of interactions between an Agent, MCP Server, Plugin, and External Service when a tool is invoked. It shows the flow from tool discovery to execution and response. ```Mermaid sequenceDiagram Agent->>MCP Server: Request available tools MCP Server->>Agent: Return tool specifications Agent->>MCP Server: Call tool with parameters MCP Server->>Plugin: Execute tool function Plugin->>External Service: Make API call if needed External Service->>Plugin: Return results Plugin->>MCP Server: Process and format results MCP Server->>Agent: Return formatted response ``` -------------------------------- ### Request URL Content Source: https://github.com/aptible/unpage/blob/main/docs/plugins/networking.mdx Makes an HTTP GET request to a specified URL and returns the response body content. Caution is advised due to potential SSRF vulnerabilities. ```cli request_url ``` -------------------------------- ### Conditional Logic Agent Prompt Source: https://github.com/aptible/unpage/blob/main/docs/examples/creating_new_agents.mdx Defines conditional prompts for an Unpage agent to analyze alerts and execute specific actions based on memory usage, growth rate, or eviction metrics. It outlines different response strategies for various conditions. ```yaml prompt: > Analyze the alert and determine the scenario: If memory usage > 95%: - Execute emergency memory cleanup procedures - Post CRITICAL update with immediate actions If memory growth rate > 20% per hour: - Focus on identifying memory leaks - Examine recent deployments and configuration changes If evicted_keys metric is increasing: - Analyze key eviction patterns - Recommend maxmemory policy adjustments Otherwise: - Perform standard memory analysis - Post standard monitoring recommendations ``` -------------------------------- ### Define Shell Command with Arguments Source: https://github.com/aptible/unpage/blob/main/docs/plugins/shell.mdx Configuration for a shell command that accepts arguments. The `ls -lah {directory}` command is defined with a `directory` argument, which is described to guide the LLM. ```yaml plugins: # ... shell: enabled: true settings: commands: # ... - handle: list_files_in_directory description: List the files in a given directory. command: ls -lah {directory} args: directory: The path to the directory ``` -------------------------------- ### List All Unpage MCP Tools Source: https://github.com/aptible/unpage/blob/main/docs/plugins/shell.mdx Bash command to list all available tools, including custom shell commands, managed by Unpage's MCP. ```bash $ uv run unpage mcp tools list ``` -------------------------------- ### Create a New Unpage Agent Source: https://github.com/aptible/unpage/blob/main/docs/concepts/agents.mdx This command creates a new agent configuration file from a template and opens it in the default editor, allowing for the setup of a new agent. ```bash unpage agent create my-new-agent ``` -------------------------------- ### Define Agent Routing Criteria (YAML) Source: https://github.com/aptible/unpage/blob/main/docs/concepts/router.mdx Example YAML configuration for an Unpage agent, showcasing the `description` field used by the Router to determine when the agent should handle an alert. ```yaml description: > Use this agent to analyze alerts that meet the following criteria: - The alert is related to database connectivity issues - The alert mentions timeouts, connection refused, or similar errors - The affected service is using PostgreSQL or MySQL ``` -------------------------------- ### Verify Unpage Agent Routing Decisions Source: https://github.com/aptible/unpage/blob/main/docs/examples/creating_new_agents.mdx This bash snippet shows how to test the routing logic of an Unpage agent. It allows you to verify if the agent is correctly selected for specific incident payloads and provides a debug mode for detailed explanations of the routing process. ```bash # Test routing decision $ unpage agent route '{"incident": {"title": "Redis Memory Critical"}}' # Debug routing with detailed explanation $ unpage agent route --debug '{"incident": {"title": "Redis Memory Critical"}}' ``` -------------------------------- ### Build Unpage Knowledge Graph Source: https://github.com/aptible/unpage/blob/main/docs/concepts/knowledge-graph.mdx Command to initiate the Unpage Knowledge Graph build process, which populates the graph with infrastructure resources and relationships discovered by plugins. ```shell unpage graph build ```