An intelligent ReAct agent that explores GitHub repositories and provides grounded answers based on actual code and repository content.
Note: Configure both
GEMINI_API_KEYandGITHUB_TOKENin your environment before running the agent.
- 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
VitAI uses the ReAct (Reasoning + Acting) pattern:
Thought → Action → Observation → Thought → ... → Final Answer
The agent autonomously:
- Reasons about what information it needs
- Takes actions using available tools
- Observes the results
- Continues until it can provide a complete answer
- search_code: Find code files using GitHub's code search
- get_repo_structure: Get detailed directory/file tree
- get_file_contents: Fetch actual file contents
- Python 3.10+
- GitHub Token
- Gemini API Key
# Clone the repository
git clone https://github.com/anirudhsengar/VitAI.git
cd VitAI
# Install dependencies (using uv)
uv syncCreate a .env file with the following:
GEMINI_API_KEY=your_gemini_api_key
GITHUB_TOKEN=your_github_token┌──────────────────────────────────────────────┐
│ 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 │
└──────────────────────────────────────────────┘
