Skip to content

EuniAI/Prometheus

Repository files navigation

Logo

Prometheus

Contributors Stargazers Paper
Credits

Code Coverage

Prometheus

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.

πŸš€ Features

  • 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.

πŸ“Š Evaluation Results on SWE-bench Lite

SWE-bench Lite Result

Success Rate Comparison across popular agents. Prometheus achieves 28.67%.

@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}, 
}

βš™οΈ Quick Start

βœ… Prerequisites

  • Docker
  • Docker Compose
  • API keys (e.g. OpenAI, Anthropic, Google Gemini)

πŸ“¦ Setup

  1. Clone the repository:

    git clone https://github.com/Pantheon-temple/Prometheus.git
    cd Prometheus
  2. 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

  3. Create the working directory to store logs and cloned repositories:

    mkdir working_dir
  4. Start the services using Docker Compose:

    • 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
  5. Access Prometheus:

  6. Upload Your Codebase:

    You can upload a GitHub repository to Prometheus using the following API endpoint:

    • Endpoint: POST /repository/upload/
      • Request Body: JSON object matching the UploadRepositoryRequest schema (see API Documents)

    This will clone the specified repository (defaulting to the latest commit on the main branch) into Prometheus.

  7. πŸ“ Answer Repository Issues

    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.

πŸ—„οΈ Database Setup

PostgreSQL

⚠️ If you're using docker-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

Neo4j

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


πŸ§ͺ Development

Requirements

  • Python 3.11+

Steps

  1. Install dependencies:

    pip install hatchling
    pip install .
    pip install .[test]
  2. Run tests:

    coverage run --source=prometheus -m pytest -v -s -m "not git"
  3. Generate coverage report:

    coverage report -m
  4. Generate HTML report:

    coverage html
    open htmlcov/index.html
  5. Start dev server:

    uvicorn prometheus.app.main:app --host 0.0.0.0 --port 9002

πŸ“„ License

This project is dual-licensed:

  • Community Edition: Licensed under the GNU General Public License v3.0 (GPLv3).
    You are free to use, modify, and redistribute this code, provided that any derivative works are also released under the GPLv3.
    This ensures the project remains open and contributions benefit the community.

  • Commercial Edition: For organizations that wish to use this software in proprietary, closed-source, or commercial settings,
    a separate commercial license is available. Please contact EUNI.AI Team to discuss licensing terms.


πŸ“¬ Contact

For questions or support, please open an issue in the GitHub repository.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5

Languages