Edge Intelligence: Building a Local AI RCA Agent for JIRA
In high-security enterprise environments, Jira Server is the gold standard for keeping your data safely in-house. But strict data privacy usually comes with a frustrating trade-off: manual Root Cause Analysis (RCA). Because sensitive system logs can’t be sent to cloud-based AI providers like OpenAI without breaking compliance rules, Site Reliability Engineers (SREs) are often stuck in a bottleneck, manually combing through endless lines of errors.
We are changing that. We are going to build a Edge AI RCA Agent that monitors Jira, reads through error logs, ticket summaries, and comments, and automatically identifies the root cause. The best part? It uses the DeepSeek-R1 model and runs completely offline on a standard i7 laptop with 32GB of RAM.
The Architecture — A Privacy-First Approach
Our design guarantees zero data exfiltration. The entire process forms a closed loop safely inside your corporate VPN.
Here is how the components work together:
- Jira Server: This is the source of truth where your incident tickets and log attachments live.
- The Python Agent: This script continuously polls the Jira REST API, gathers the relevant ticket data, and packages it into a prompt.
- Local Inference (Ollama): Ollama runs a quantized version of the DeepSeek-R1 model directly on your local CPU to analyze the data and generate the final RCA report — no cloud required.
System Flow Diagram
Prerequisites & Dependencies
Before we write any code, let’s gather our tools. We don’t need a massive server for this, a solid workstation will solve our purpose.
Get Digvijay Singh’s stories in your inbox
Join Medium for free to get updates from this writer.
Hardware:
- A standard computer or laptop (An Intel i7 or equivalent with 32GB of RAM is perfect).
Software & Access:
- Python 3.11: Installed on your machine.
- Ollama: A free, open-source tool that lets you run large language models locally.
- Jira Access: A Personal Access Token (PAT) from your Jira Server to authenticate the script safely.
Python Dependencies:
- We only need one external library to handle the API calls. Open your command prompt and run:
pip install requestsStep-by-Step Guide to Building the AI Agent
Step 1: Spin Up Your Local AI (Zero Cloud Required)
First, we need to get our AI model running locally.
- Download and install Ollama.
- Open your terminal or command prompt.
- Run the following command to download and start a quantized (compressed) version of DeepSeek-R1:
ollama run deepseek-r1:7bNote: It will take few mins to download the model. Once you see a chat prompt in your terminal, the AI is running in the background at
http://localhost:11434.
Step 2: The Python Agent (jira_agent.py)
This script is the bridge. It connects to Jira, grabs the ticket’s summary, description (logs), and comments, and feeds them to your local Ollama model.
import requests
import sys
# ==========================================
# Configuration (Replace with your details)
# ==========================================
JIRA_DOMAIN = "<YOUR JIRA SERVER>"
JIRA_TOKEN = "<YOUR JIRA PAT>"
OLLAMA_URL = "http://localhost:11434/api/generate"
def get_jira_ticket_data(ticket_id):
"""Fetches the ticket summary, description, and comments from Jira."""
url = f"{JIRA_DOMAIN}/rest/api/2/issue/{ticket_id}"
headers = {
"Authorization": f"Bearer {JIRA_TOKEN}",
"Accept": "application/json"
}
print(f"[*] Fetching data for {ticket_id} from Jira...")
response = requests.get(url, headers=headers)
response.raise_for_status()
issue = response.json()
summary = issue['fields'].get('summary', '')
description = issue['fields'].get('description', '')
comments = []
if 'comment' in issue['fields']:
for comment in issue['fields']['comment']['comments']:
comments.append(comment['body'])
return summary, description, "\n".join(comments)
def generate_rca(summary, description, comments):
"""Sends the Jira data to local DeepSeek-R1 via Ollama."""
prompt = f"""
You are an expert Site Reliability Engineer (SRE). Analyze the following incident details and generate a Root Cause Analysis (RCA).
Identify the likely cause of the failure, the systems impacted, and suggest remediation steps. Keep it concise.
Ticket Summary: {summary}
Description/Logs: {description}
Engineer Comments: {comments}
"""
payload = {
"model": "deepseek-r1:8b",
"prompt": prompt,
"stream": False
}
print("[*] Analyzing logs locally with DeepSeek-R1. This may take a minute...")
response = requests.post(OLLAMA_URL, json=payload)
response.raise_for_status()
return response.json().get('response', 'No response generated.')
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: python jira_agent.py <TICKET-ID>")
sys.exit(1)
ticket_id = sys.argv[1]
try:
summary, description, comments = get_jira_ticket_data(ticket_id)
rca_report = generate_rca(summary, description, comments)
print("\n" + "="*40)
print(" AI-GENERATED ROOT CAUSE ANALYSIS ")
print("="*40)
print(rca_report)
print("="*40 + "\n")
except Exception as e:
print(f"[!] An error occurred: {e}")Step 3: The Orchestrator Batch File (run_agent.bat)
We need a robust way to start the Ollama background service and launch our agent with clear visual feedback. We created a Batch script.
@echo off
title Local AI RCA Agent Orchestrator
color 0A
echo ==================================================
echo PRIVATE JIRA RCA AGENT
echo ==================================================
echo.
:: Step 2: Ask the user for the Jira Ticket ID
set /p TICKET_ID="Enter Jira Ticket ID : "
:: Step 3: Check if a ticket was entered
if "%TICKET_ID%"=="" (
echo [!] No ticket ID entered. Exiting...
pause
exit /b
)
:: Step 4: Run the Python Agent
echo.
echo [*] Starting Orchestration for %TICKET_ID%...
python jira_agent.py %TICKET_ID%
echo.
echo [*] RCA Process Complete.
pauseHow to Use It
- Ensure Ollama is running in the background.
- Double-click
run_agent.bat. - Type in the ticket number (e.g.,
PROD-505). - Sit back. The script will securely fetch the logs, process them entirely on your local CPU/RAM, and spit out an intelligent Root Cause Analysis right on your screen.
Conclusion: Smarter Workflows Without Compromise
In the past, enterprises had to choose between efficiency and compliance. You either manually analyzed logs to stay safe, or you risked data exposure by using cloud AI.
With this Local AI RCA Agent, that trade-off is over.
- Total Privacy: Your logs never leave your network.
- Faster Resolution: “Log-combing” takes seconds, not hours.
- Zero Cost: No subscriptions — just the hardware you already have.
The future is Private AI. Stop wasting time on manual logs and keep your data where it belongs: under your control.









