Skip to content

yashpatil582/repomind

Repository files navigation

RepoMind

An AI-powered GitHub repository agent that truly understands codebases and manages repository workflows with human-level intelligence.

Features

Core Capabilities

  • Semantic Code Understanding: Uses RAG (Retrieval-Augmented Generation) to understand your codebase at a deep level
  • Intelligent Issue Handling: Auto-labels, categorizes, and responds to issues based on codebase knowledge
  • PR Description Generation: Automatically generates comprehensive PR descriptions from diffs
  • Duplicate Detection: Identifies and links related/duplicate issues
  • Stale Issue Management: Automatically marks and closes stale issues/PRs

Agent Architecture

RepoMind uses a sophisticated agent loop:

  1. Perceive: Gathers context about events, issues, PRs, and relevant code
  2. Plan: Uses LLM to determine the best course of action
  3. Validate: Checks if actions require human approval
  4. Execute: Performs actions via GitHub API
  5. Reflect: Logs decisions and learns from feedback

Autonomy Levels

  • Full Auto: Agent acts independently on all decisions
  • Balanced: Agent requires approval for critical actions (close, merge)
  • Suggest Only: Agent only suggests actions, never executes

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                         GitHub                                   │
│  (Issues, PRs, Comments, Pushes)                                │
└──────────────────────┬──────────────────────────────────────────┘
                       │ Webhooks
                       ▼
┌─────────────────────────────────────────────────────────────────┐
│                    Webhook Handler                               │
│  - Validates signatures                                          │
│  - Routes to appropriate processor                               │
└──────────────────────┬──────────────────────────────────────────┘
                       │
                       ▼
┌─────────────────────────────────────────────────────────────────┐
│                     Event Queue (Redis)                          │
│  - Ensures reliability                                           │
│  - Handles rate limiting                                         │
└──────────────────────┬──────────────────────────────────────────┘
                       │
                       ▼
┌─────────────────────────────────────────────────────────────────┐
│                     Agent Core                                   │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐             │
│  │   Planner   │→ │  Executor   │→ │  Reflector  │             │
│  └─────────────┘  └─────────────┘  └─────────────┘             │
└─────────────────────────────────────────────────────────────────┘
                       │
         ┌─────────────┼─────────────┐
         ▼             ▼             ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│  Vector DB  │ │  PostgreSQL │ │  Claude API │
│ (Codebase)  │ │  (State)    │ │  (LLM)      │
└─────────────┘ └─────────────┘ └─────────────┘

Tech Stack

  • Runtime: Node.js/TypeScript
  • LLM: Claude (Anthropic) or OpenAI
  • Vector DB: Qdrant
  • Database: PostgreSQL
  • Queue: Redis + BullMQ
  • GitHub: Octokit + GitHub App

Quick Start

Prerequisites

  • Node.js 20+
  • PostgreSQL
  • Redis
  • Qdrant (or use cloud)

Installation

# Clone the repository
git clone https://github.com/yourusername/repomind.git
cd repomind

# Install dependencies
npm install

# Copy environment file
cp .env.example .env

# Edit .env with your configuration

Configuration

Edit .env with your settings:

# LLM Provider (anthropic or openai)
LLM_PROVIDER=anthropic
ANTHROPIC_API_KEY=your_api_key

# GitHub App
GITHUB_APP_ID=your_app_id
GITHUB_APP_PRIVATE_KEY=base64_encoded_key
GITHUB_WEBHOOK_SECRET=your_secret

# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/repomind

# Redis
REDIS_URL=redis://localhost:6379

# Qdrant
QDRANT_URL=http://localhost:6333

Running

# Run database migrations
npm run db:migrate

# Start the server
npm run dev

# In another terminal, start the worker
npm run worker

# Start the dashboard
npm run dashboard

GitHub App Setup

  1. Go to GitHub Developer Settings
  2. Create a new GitHub App
  3. Set the webhook URL to https://your-domain.com/webhook
  4. Configure permissions:
    • Issues: Read & Write
    • Pull requests: Read & Write
    • Contents: Read
    • Metadata: Read
  5. Subscribe to events:
    • Issues
    • Issue comment
    • Pull request
    • Pull request review
    • Push
  6. Generate and download a private key
  7. Install the app on your repositories

Usage

Interacting with RepoMind

Mention @repomind in any issue or PR comment:

@repomind explain how authentication works

@repomind find the user validation logic

@repomind summarize this issue

@repomind help

Providing Feedback

React to RepoMind's comments with:

  • 👍 for positive feedback
  • 👎 for negative feedback

Or reply with "helpful" or "not helpful" in your comment.

Project Structure

repomind/
├── src/
│   ├── agent/           # Core agent logic
│   │   ├── core.ts      # Main agent loop
│   │   ├── planner.ts   # Decision planning
│   │   ├── executor.ts  # Action execution
│   │   ├── reflector.ts # Learning & feedback
│   │   └── memory.ts    # Context & history
│   ├── tools/           # Agent tools
│   │   ├── github.ts    # GitHub API wrapper
│   │   ├── codeSearch.ts # Code search
│   │   └── ragQuery.ts  # Vector search
│   ├── indexer/         # Codebase indexing
│   │   ├── parser.ts    # Code parsing
│   │   ├── embeddings.ts # Embedding generation
│   │   └── sync.ts      # Index synchronization
│   ├── handlers/        # Event handlers
│   │   ├── issues.ts    # Issue handling
│   │   ├── pullRequests.ts
│   │   └── comments.ts
│   ├── web/             # Dashboard
│   │   ├── api/         # REST API
│   │   └── dashboard/   # React UI
│   ├── db/              # Database
│   ├── queue/           # Job queue
│   └── index.ts         # Entry point
├── tests/
└── docs/

API Reference

REST Endpoints

GET  /health                     # Health check
GET  /api/repositories           # List repositories
GET  /api/repositories/:id       # Get repository details
PATCH /api/repositories/:id/settings  # Update settings
POST /api/repositories/:id/reindex    # Trigger reindex
GET  /api/repositories/:id/actions    # Get action logs
POST /api/feedback               # Submit feedback
GET  /api/dashboard/metrics      # Dashboard metrics

Testing

# Run all tests
npm test

# Run tests with coverage
npm run test:coverage

# Run type checking
npm run typecheck

# Run linting
npm run lint

Deployment

Using Docker

FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --production
COPY dist ./dist
CMD ["node", "dist/index.js"]

Using Railway/Fly.io

See deployment guides in /docs/deployment/.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and linting
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Acknowledgments

  • Built with Claude by Anthropic
  • GitHub integration via Octokit
  • Vector search powered by Qdrant

About

AI-powered GitHub repository agent

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors