Skip to content

An intelligent ReAct agent that explores GitHub repositories and provides grounded answers based on actual code and repository content

Notifications You must be signed in to change notification settings

anirudhsengar/VitAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VitAI - GitHub Repository Analysis Agent

An intelligent ReAct agent that explores GitHub repositories and provides grounded answers based on actual code and repository content.

Note: Configure both GEMINI_API_KEY and GITHUB_TOKEN in your environment before running the agent.

Features

Core Capabilities

  • Intelligent Code Search: Search across GitHub repositories with precise queries
  • File Content Fetching: Retrieve and analyze actual file contents via GitHub API
  • Issue/PR Search: Find relevant discussions, bugs, and feature requests
  • Repository Structure Analysis: Understand repository layout and organization

ReAct Pattern

VitAI uses the ReAct (Reasoning + Acting) pattern:

Thought → Action → Observation → Thought → ... → Final Answer

The agent autonomously:

  1. Reasons about what information it needs
  2. Takes actions using available tools
  3. Observes the results
  4. Continues until it can provide a complete answer

Available Tools

  1. search_code: Find code files using GitHub's code search
  2. get_repo_structure: Get detailed directory/file tree
  3. get_file_contents: Fetch actual file contents

Installation

Prerequisites

  • Python 3.10+
  • GitHub Token
  • Gemini API Key

Setup

# Clone the repository
git clone https://github.com/anirudhsengar/VitAI.git
cd VitAI

# Install dependencies (using uv)
uv sync

Environment Variables

Create a .env file with the following:

GEMINI_API_KEY=your_gemini_api_key
GITHUB_TOKEN=your_github_token

Architecture

MCP Architecture

Agent Flow

┌──────────────────────────────────────────────┐
│ Initialize Agent                             │
│  ├─ Load repository structures (cached)      │
│  ├─ Initialize LLM client                    │
│  └─ Initialize GitHub search client          │
└──────────────────────────────────────────────┘
                    ↓
┌──────────────────────────────────────────────┐
│ User Query                                   │
│  ├─ Inject repository context               │
│  ├─ Send to LLM with structure info          │
│  └─ Start ReAct loop                         │
└──────────────────────────────────────────────┘
                    ↓
┌──────────────────────────────────────────────┐
│ ReAct Loop                                   │
│  ├─ Thought: Reason about next step          │
│  ├─ Action: Use tool with precise query      │
│  │   (Informed by repository structure)      │
│  ├─ Observation: Process results             │
│  └─ Repeat or provide Final Answer           │
└──────────────────────────────────────────────┘

About

An intelligent ReAct agent that explores GitHub repositories and provides grounded answers based on actual code and repository content

Resources

Stars

Watchers

Forks

Languages