Skip to content

pwdev4/repo-base

 
 

Repository files navigation

Repo Base - Chat with a repo

An intelligent chatbot that helps you understand and explore GitHub repositories through natural language conversations. Built with Next.js, Mastra AI, and powered by Google's Gemini 2.5 Flash.

✨ Features

  • 🤖 Intelligent Repository Analysis - Ask questions about any public GitHub repository
  • 💬 Multi-Thread Conversations - Maintain separate conversation threads for different repositories
  • 🔍 Deep Code Understanding - Analyze repository structure, file contents, commits, issues, and pull requests
  • 💾 Persistent Memory - Conversations are saved and can be resumed anytime
  • Real-time Streaming - Get responses as they're generated

📋 Prerequisites

  • Node.js 20+ (recommended) or Bun
  • Docker and Docker Compose
  • A GitHub account (no token required for public repos)
  • A Google AI API key (for Gemini)

🚀 Getting Started

1. Set Up Environment Variables

Create a .env file in the project root:

# Google AI API Key (get from https://aistudio.google.com/apikey)
GOOGLE_GENERATIVE_AI_API_KEY=your_google_ai_api_key_here

# Optional: GitHub Personal Access Token (for higher rate limits)
# GITHUB_TOKEN=your_github_token_here

2. Start PostgreSQL Database and run the Development Server

docker compose up

This will start a PostgreSQL 16 instance in a Docker container with persistent storage and run the development server with hot reloading. Open http://localhost:3000 in your browser.

The node module dependencies will be installed automatically on the first run.

Tips

You can enable SSL for PostgreSQL database by setting DB_SSL=true in the .env file, else it will default to false.

📖 Usage

  1. Enter a Repository: Type a GitHub repository in the format owner/repo (e.g., facebook/react)
  2. Start Chatting: Ask questions about the repository:
    • "What is the project structure?"
    • "How does authentication work?"
    • "Show me the latest commits"
    • "What are the open issues?"
  3. Multiple Threads: Create new conversation threads for the same repository or switch between different repositories

🤖 AI Agent Capabilities

The AI agent has access to the following tools:

  • getFilePaths: Retrieves the complete file structure of a repository
  • getFileContent: Fetches the content of specific files
  • getRepositoryCommits: Analyzes commit history and recent changes
  • getRepositoryIssues: Examines open and closed issues
  • getRepositoryPullRequests: Reviews pull requests and code changes

🔗 Links

About

turn your favorite repository into a knowledge base and get ai powered insights

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 96.0%
  • CSS 3.4%
  • Other 0.6%