An AI-powered multi-agent mentorship system that helps beginner developers make their first open-source contributions.
FirstPR dynamically ingests any GitHub repository on demand, builds a structure-aware index, and uses a team of local AI agents to explain codebases, answer questions, estimate issue difficulty, and provide actionable contribution paths.
- π€ 100% Local AI Execution - Runs entirely on your machine using Ollama (privacy-first, zero API costs)
- π§ Multi-Agent RAG System - Issue Analyzer, Retrieval Agent, Reasoning Agent, and Q&A Agent working together
- πΎ Persistent ChromaDB Storage - Vector embeddings saved locally, no re-ingestion needed
- π Hybrid Search - Combines semantic embeddings with BM25 keyword search for accurate code retrieval
- π Issue Difficulty Analysis - Automatically categorizes issues by type, difficulty, and required skills
- π― Step-by-Step Contribution Guides - Get beginner-friendly explanations with optional code patches
- π¬ Interactive Codebase Q&A - Ask questions about any part of the repository
- β‘ Optimized for Apple Silicon - Highly optimized for M-series chips (also supports AMD/NVIDIA GPUs)
- π Modern React Frontend - Beautiful, responsive UI built with React, Vite, and Tailwind CSS
FirstPR consists of two main components:
- FastAPI server with rate limiting and CORS support
- Ollama running
qwen2.5-coder:1.5bfor 32k context AI reasoning - ChromaDB for persistent vector storage and metadata
- HuggingFace BGE-base for local text embeddings
- Hybrid RAG Pipeline combining semantic and keyword search
- React 19 with modern hooks and components
- Vite for lightning-fast development and builds
- Tailwind CSS 4 for responsive, beautiful UI
- Framer Motion for smooth animations
- Lucide React for crisp, modern icons
Before getting started, ensure you have:
- Python 3.9+ - Download Python
- Node.js 18+ - Download Node.js
- Git - Download Git
- Ollama - Download Ollama
git clone https://github.com/AkibDa/FirstPR.git
cd FirstPR# Navigate to backend directory
cd backend
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Pull the AI model (required for first-time setup)
ollama pull qwen2.5-coder:1.5b
# Start Ollama server (in a separate terminal)
ollama serve
# Start the FastAPI backend
uvicorn main:app --reloadBackend will be available at http://127.0.0.1:8000
# Navigate to frontend directory (from project root)
cd frontend
# Install dependencies
npm install
# Start development server
npm run devFrontend will be available at http://localhost:5173
Visit the interactive API documentation at http://127.0.0.1:8000/docs
POST /api/load-repo{
"repo_url": "https://github.com/TheAlgorithms/Python"
}POST /api/analyze-issue?generate_patch=true{
"repo_url": "https://github.com/TheAlgorithms/Python",
"issue_url": "https://github.com/TheAlgorithms/Python/issues/42"
}Or provide manual issue details:
{
"repo_url": "https://github.com/TheAlgorithms/Python",
"issue_title": "Fix binary search edge case",
"issue_text": "The binary search fails when array is empty..."
}POST /api/ask{
"repo_url": "https://github.com/TheAlgorithms/Python",
"question": "How does the binary search algorithm handle edge cases?"
}FirstPR/
βββ backend/ # FastAPI backend
β βββ main.py # Application entry point
β βββ api.py # API route definitions
β βββ services.py # RAG pipeline and AI agents
β βββ schemas.py # Pydantic data models
β βββ utils.py # Helper functions
β βββ config.py # Configuration management
β βββ limiter.py # Rate limiting
β βββ requirements.txt # Python dependencies
β βββ chroma_db/ # Persistent vector storage (auto-generated)
β
βββ frontend/ # React frontend
β βββ src/ # Source code
β βββ public/ # Static assets
β βββ index.html # HTML entry point
β βββ package.json # Node dependencies
β βββ vite.config.js # Vite configuration
β βββ eslint.config.js # ESLint configuration
β
βββ README.md # This file
- FastAPI - Modern Python web framework
- Ollama - Local LLM inference engine
- ChromaDB - Vector database for embeddings
- HuggingFace Transformers - BGE-base embeddings
- SlowAPI - Rate limiting middleware
- Pydantic - Data validation
- React 19 - UI library
- Vite 8 - Build tool and dev server
- Tailwind CSS 4 - Utility-first CSS framework
- Framer Motion - Animation library
- Lucide React - Icon library
- qwen2.5-coder:1.5b - 32k context window, optimized for code
- BAAI/bge-base-en-v1.5 - Embeddings for semantic search
-
Issue Analyzer Agent
- Categorizes issue type (bug, feature, documentation, etc.)
- Estimates difficulty level (beginner, intermediate, advanced)
- Identifies required skills and technologies
-
Retrieval Agent
- Hybrid search using semantic embeddings + BM25 keyword matching
- Traces imports and file dependencies
- Smart filtering (ignores SVGs, CSVs, lockfiles)
-
Reasoning Agent
- Reads raw source code with full context
- Generates step-by-step contribution guides
- Optionally creates unified diff patches
-
Q&A Agent
- Allows free-form codebase exploration
- Contextual answers based on repository structure
- Helps users learn and understand the project
- Asynchronous processing for large repositories
- Batch embedding to prevent VRAM overflow
- Persistent storage eliminates re-ingestion
- Smart chunking for optimal context windows
- Throttled requests for stable performance
- β 100% local execution - No data sent to external APIs
- β No telemetry - Your code stays on your machine
- β Rate limiting - Protection against abuse
- β CORS configured - Secure cross-origin requests
Contributions are welcome! This project itself is designed to help beginners contribute to open source.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source and available under the MIT License.
- Ollama - For making local AI accessible
- ChromaDB - For efficient vector storage
- HuggingFace - For open-source embeddings
- FastAPI - For the excellent Python web framework
- React & Vite - For modern frontend development
Having issues?
- Check the Backend README for detailed backend setup
- Check the Frontend README for frontend configuration
- Open an issue on GitHub
The application can be deployed using:
- Backend: Any cloud platform supporting Python (Railway, Render, Fly.io)
- Frontend: Vercel, Netlify, or any static hosting service
Current deployment: https://firstpr-mentor.vercel.app
Built with π to help developers make their first open-source contributions