The Problem

Developers spend disproportionate time understanding legacy code, reproducing bugs, and iterating on fixes. Manual debugging and patch generation are error‑prone, especially in large, inter‑dependent repositories where context is scattered across files, issue trackers, and CI pipelines.

What This Does

Prometheus implements a knowledge‑graph‑driven AI agent that extracts code‑base structure, stores it in Neo4j, and uses LLM reasoning to produce verifiable patches.

The graph builder lives in prometheus/graph/filegraphbuilder.py and populates prometheus/graph/knowledgegraph.py. Service orchestration is in prometheus/app/services/, e.g., knowledgegraphservice.py, llmservice.py, and neo4jservice.py. Individual reasoning steps are modeled as nodes and sub‑graphs under prometheus/langgraph/nodes/ and prometheus/langgraph/subgraphs/. For example, bugreproducingexecutenode.py runs the reproduced test, while finalpatchselectionnode.py selects the best patch. The FastAPI API entry points are prometheus/app/api/main.py (router registration) and prometheus/app/main.py (application startup).

Together these components let a user submit a GitHub issue (via /api/routes/issue.py) and receive an AI‑generated, test‑validated fix without manual code search.

How To Use It

Setup

Build and start the stack (Neo4j, the API, and optional background workers) docker compose up --build -d

Dockerfile defines the Python environment; docker-compose.yml wires the API container to a Neo4j service.

Configuration

Copy example.env to .env and fill in required keys: NEO4JURI, NEO4JUSER, NEO4JPASSWORD – consumed by prometheus/app/services/neo4jservice.py. OPENAIAPIKEY – used by prometheus/app/services/llmservice.py. Any additional service URLs are read from prometheus/configuration/config.py.

Running

Start the FastAPI server (if not using docker-compose) uvicorn prometheus.app.main:app --host 0.0.0.0 --port 8000

The API documentation is available at http://localhost:8000/docs.

Testing

pytest

The repository includes 25 test modules and CI pipelines defined in .github/workflows/pytestandcoverage.yml and .github/workflows/ruffcheck.yml.

Real‑World Use

A CI job can call the internal client (prometheus/app/services/issueservice.py) to auto‑triage new GitHub issues:

from prometheus.app.services.issueservice import IssueService

service = IssueService() patch = service.handlenewissue(repo="org/repo", number=42) patch is a diff string that has already passed regression tests.

Deploying the stack alongside a corporate Neo4j instance lets the AI agent reuse historical bug‑fix knowledge across projects, reducing MTTR (Mean Time To Repair) for recurring defect patterns.

Code Health & Issues

Med – Missing secret management – API keys are expected via environment variables (OPENAIAPIKEY etc.) but no secret‑handling helper is provided; accidental commit of a real key would be a risk. Low – Limited type hints – Many service and node modules lack explicit Python type annotations, which can hinder IDE assistance and static analysis. Low – Sparse documentation for custom nodes – The langgraph/nodes/ directory contains >50 node files, but only high‑level diagrams exist in docs/; each node’s contract is not documented in code, raising onboarding friction. Low – Dependency pinning – Dockerfile installs packages via requirements.txt (not shown), but versions are not pinned; reproducible builds depend on upstream releases. Low – Test coverage gaps – CI runs pytest and coverage, yet the repository ships only 25 test files for >200 source files, suggesting many code paths (e.g., graph mutation, LLM interaction) are untested.

Overall, the repo includes a CI pipeline, Docker configuration, and a clear package layout, indicating a mature baseline.

The Bottom Line

Prometheus delivers a concrete, containerized platform for AI‑assisted bug reproduction and patch generation, anchored by a Neo4j knowledge graph. It is ready for teams that already operate Docker and have access to OpenAI and Neo4j services. The main drawbacks are modest test coverage and the need for disciplined secret management; organizations should supplement the codebase with additional tests and a secret‑vault integration before production use.