← Back
H-KFX: Hybrid Knowledge Fixer: Autonomous Bug-Fixing Agent
A fully autonomous tool-using agent: reads a task description, retrieves context (RAG), reasons, generates and validates a solution, and acts, 60–90s ticket-to-PR. A working instance of the autonomous investigator architecture that underlies agents for automating interpretability.
GPT-4o MCP MongoDB RAG Tavily AI Jira API GitHub API Python 86% / TypeScript 13%
H-KFX pipeline visualization
90%
Reduction in debugging time
60–90s
Ticket to merged PR
3×
Self-correction retries before escalation
MUG 2025
Hackathon project

What It Does

H-KFX (Hybrid Knowledge Fixer) is a fully autonomous bug-fixing agent. A developer creates a Jira ticket describing a bug and pointing to the relevant file. H-KFX takes it from there: it analyzes the problem with GPT-4o, searches a RAG knowledge base of past fixes stored in MongoDB, augments this with external best practices via Tavily AI, generates a code fix, runs the relevant test suite in isolation to validate the fix, and: if approved: opens and merges a GitHub pull request. The Jira ticket is then automatically marked Done.

End-to-End Pipeline

1

Webhook Trigger

A new Jira ticket is created → webhook fires to the Flask backend (exposed via ngrok). Ticket metadata (summary, description, repo URL, branch, file) is parsed.

2

AI Analysis (GPT-4o)

GPT-4o reads the ticket and the relevant source file to understand the root cause and formulate a fix strategy.

3

RAG Search (MongoDB Atlas)

Vector search over a knowledge base of past bug fixes. Similar historical fixes are retrieved and injected as context into the code generation prompt.

4

External Knowledge (Tavily AI)

Tavily searches the web for external best practices, library documentation, and community solutions relevant to the bug type.

5

Code Generation & Validation

GPT-4o generates the fix. The agent derives and runs only the relevant tests in an isolated environment. If validation fails, the agent self-corrects (up to 3 retries).

6

Human Approval & Auto-Merge

A review link is posted on the Jira ticket. The developer inspects the diff in the React frontend and approves. H-KFX creates and merges the GitHub PR, then closes the Jira ticket.

Key Design Decisions

Relevance to Automating Interpretability

The architecture of H-KFX, read a task description → retrieve relevant context → reason → use tools → validate the output → report, is the same scaffold needed for an autonomous interpretability investigator agent. Such an agent would: read a model behavior anomaly, retrieve prior circuit analyses, use interpretability tools (activation patching, probing) to investigate, validate a mechanistic hypothesis, and produce an explanation. H-KFX demonstrates that this loop works end-to-end at production speed.

Tech Stack