Repo Base is an AI-powered tool that helps you chat with and understand GitHub repositories. It uses Mastra, a TypeScript AI framework, to fetch repository data including file trees, file contents, pull requests, and issues, allowing you to easily navigate and understand codebases of any size.
- Repository Analysis: Upload a GitHub repository URL and instantly start a conversation about it
- Code Exploration: Navigate file trees, view file contents, and understand code structure
- PR & Issue Access: Query information about pull requests and issues directly in chat
- Large Codebase Support: Powered by Google's Gemini Flash model with its large context window
- Intuitive UI: Built with assistant-UI for a seamless chat experience with retries, copy, and message branching
- Node.js 18+
- PostgreSQL database
- Google Generative AI API key
- GitHub token (optional, but recommended for better rate limits)
- Clone the repository:
git clone https://github.com/yourusername/repo-base.git
cd repo-base- Install dependencies:
npm install
# or
yarn install- Create a
.envfile in the root directory and add your API keys:
GOOGLE_GENERATIVE_AI_API_KEY=your_gemini_api_key_here
DB_URL=postgresql://username:password@localhost:5432/repo_base
GITHUB_TOKEN=your_github_token_here # optional, but helps with rate limits
- Set up the database:
npx prisma migrate dev
# or
yarn prisma migrate dev- Start the development server:
npm run dev
# or
yarn dev- Open your browser and navigate to
http://localhost:3000
- Enter a GitHub repository URL in the input field (e.g.,
https://github.com/facebook/react) - Start chatting with Repo Base about the repository
- Use commands like:
- "Show me the file structure"
- "What are the recent pull requests?"
- "Explain the purpose of [filename]"
- "How many open issues are there?"
- Framework: Mastra (TypeScript AI Framework)
- Frontend: Next.js, assistant-UI
- AI Model: Google Gemini Flash
- Database: PostgreSQL (for agent memory)
- Deployment: Vercel (recommended)
Repo Base uses a tool-based approach rather than traditional RAG systems, making it more efficient for large codebases. When you provide a repository URL, Repo Base uses tools to:
- Fetch the repository's file tree
- Access file contents on demand
- Retrieve information about pull requests and issues
- Store conversation history using Mastra's memory package
The large context window of Gemini Flash allows the agent to hold more code in memory, making the conversation more coherent and informed.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Mastra for providing the TypeScript AI framework
- assistant-UI for the chat interface components
- Google's Gemini Flash model for powering the AI capabilities
Built with ❤️ using Mastraheck out our Next.js deployment documentation for more details.