Prometheus is a FastAPI-based backend service designed to perform intelligent codebase-level operations, including answering questions, resolving issues, and reviewing pull requests. At its core, it implements a multi-agent approach governed by a state machine to ensure code quality through automated reviews, build verification, and test execution.
- Codebase Analysis: Answer questions about your codebase and provide insights.
- Issue Resolution: Automatically resolve issues in your repository.
- Pull Request Reviews: Perform intelligent reviews of pull requests to ensure code quality.
- Multi-Agent System: Uses a state machine to coordinate multiple agents for efficient task execution.
- Integration with External Services: Seamlessly connects with other services in the
Pantheon-temple
organization.
@misc{Prometheus-code-agent-2025,
title={Prometheus: Unified Knowledge Graphs for Issue Resolution in Multilingual Codebases},
author={Zimin Chen and Yue Pan and Siyu Lu and Jiayi Xu and Claire Le Goues and Martin Monperrus and He Ye},
year={2025},
eprint={2507.19942},
archivePrefix={arXiv},
primaryClass={cs.SE},
url={https://arxiv.org/abs/2507.19942},
}
- Docker
- Docker Compose
- API keys (e.g. OpenAI, Anthropic, Google Gemini)
-
git clone https://github.com/Pantheon-temple/Prometheus.git cd Prometheus
-
Copy the
example.env
file to.env
and update it with your API keys and other required configurations:mv example.env .env
You need to provide a secure
JWT_SECRET_KEY
in the.env
file. You can generate a strong key by running the following command:python -m prometheus.script.generate_jwt_token
This will print a secure token you can copy and paste into your
.env
file -
mkdir working_dir
-
-
Linux (includes PostgreSQL):
docker-compose up --build
-
macOS / Windows:
β οΈ docker-compose.win_mac.yml
does not include PostgreSQL.If you don't have PostgreSQL on your device, you may have to start the PostgreSQL container manually before starting services by following the "Database Setup" section below.docker-compose -f docker-compose.win_mac.yml up --build
-
-
- Service: http://localhost:9002
- OpenAPI Docs: http://localhost:9002/docs
-
You can upload a GitHub repository to Prometheus using the following API endpoint:
- Endpoint:
GET /repository/github/
- Query Parameter:
https_url
(the HTTPS URL of your GitHub repository)
Example using
curl
:curl -X GET "http://localhost:9002/repository/github/?https_url=https://github.com/your/repo.git"
This will clone the specified repository (defaulting to the latest commit on the main branch) into Prometheus.
- Endpoint:
-
You can ask Prometheus to analyze and answer a specific issue in your codebase using the
/issue/answer/
API endpoint.- Endpoint:
POST /issue/answer/
- Request Body: JSON object matching the
IssueRequest
schema (see API Documents) - Response: Returns the generated patch, test/build results, and a summary response.
- Request Body: JSON object matching the
- Endpoint:
β οΈ If you're usingdocker-compose.win_mac.yml
, you may have to manually start PostgreSQL before launching Prometheus:
Run the following command to start a PostgreSQL container:
docker run -d \
-p 5432:5432 \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_DB=postgres \
postgres
Run the following command to start a Neo4j container:
docker run -d \
-p 7474:7474 \
-p 7687:7687 \
-e NEO4J_AUTH=neo4j/password \
-e NEO4J_PLUGINS='["apoc"]' \
-e NEO4J_dbms_memory_heap_initial__size=4G \
-e NEO4J_dbms_memory_heap_max__size=8G \
-e NEO4J_dbms_memory_pagecache_size=4G \
neo4j
Verify Neo4J at: http://localhost:7474
Set the following variables in your .env
file:
PROMETHEUS_NEO4J_URI
PROMETHEUS_NEO4J_USERNAME
PROMETHEUS_NEO4J_PASSWORD
-
PROMETHEUS_ADVANCED_MODEL
-
PROMETHEUS_BASE_MODEL
-
API Keys:
PROMETHEUS_OPENAI_FORMAT_API_KEY
PROMETHEUS_ANTHROPIC_API_KEY
PROMETHEUS_GEMINI_API_KEY
-
Base URL for LLMs:
PROMETHEUS_OPENAI_FORMAT_BASE_URL
PROMETHEUS_WORKING_DIRECTORY
PROMETHEUS_GITHUB_ACCESS_TOKEN
PROMETHEUS_KNOWLEDGE_GRAPH_MAX_AST_DEPTH
PROMETHEUS_NEO4J_BATCH_SIZE
PROMETHEUS_POSTGRES_URL
- Python 3.11+
-
Install dependencies:
pip install hatchling pip install . pip install .[test]
-
Run tests:
coverage run --source=prometheus -m pytest -v -s -m "not git"
-
Generate coverage report:
coverage report -m
-
Generate HTML report:
coverage html open htmlcov/index.html
-
Start dev server:
uvicorn prometheus.app.main:app --host 0.0.0.0 --port 9002
Licensed under the Apache License 2.0.
For questions or support, please open an issue in the GitHub repository.