An AI-powered repository analysis tool that allows you to chat with your codebase. Clone any repository and ask intelligent questions about the code structure, functionality, patterns, and more.
- 🚀 Repository Cloning: Clone any GitHub repository for analysis
- 📊 Intelligent Scanning: Automatically scans and indexes Python, JavaScript, and TypeScript files
- 🧠 AI-Powered Chat: Ask questions about your codebase using natural language
- 🔍 Semantic Search: Advanced vector-based search through your code
- 💬 Chat Sessions: Persistent chat sessions with conversation history
- ⚡ Streaming Responses: Real-time streaming chat responses
- 🎯 Context-Aware: Provides relevant code context in responses
RepoLens.mp4
RepoLens uses a sophisticated multi-agent architecture powered by LangGraph:
- Intent Analysis: Understands user queries and determines the best approach
- Vector Retrieval: Finds relevant code snippets using semantic search
- AI Explanation: Generates intelligent responses based on retrieved context
- Verification: Ensures response accuracy and relevance
- FastAPI: High-performance async API framework
- LangChain: AI/ML framework for building LLM applications
- LangGraph: Multi-agent workflow orchestration
- ChromaDB: Vector database for semantic search
- OpenAI GPT: Language model for intelligent responses
- Sentence Transformers: Text embedding generation
- Next.js: React-based web framework
- Tailwind CSS: Utility-first CSS framework
- Radix UI: Accessible component primitives
- Axios: HTTP client for API communication
- Python 3.12+
- Node.js 18+
- OpenAI API key
- Navigate to the backend directory:
cd backend- Install Python dependencies:
pip install -e .- Create a
.envfile in the backend directory:
OPENAI_API_KEY=your_openai_api_key_here- Navigate to the frontend directory:
cd frontend- Install Node.js dependencies:
npm install- Start the backend server:
cd backend
uvicorn main:app --reload --host 0.0.0.0 --port 8000- Start the frontend development server:
cd frontend
npm run dev- Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- Clone a Repository: Enter a GitHub repository URL and click "Clone Repository"
- Wait for Indexing: The system will clone and index the repository (Python, JS, TS files under 800 lines)
- Start Chatting: Ask questions about the codebase in natural language
- Explore: Ask about:
- Code structure and architecture
- Function implementations
- Design patterns used
- Dependencies and imports
- Code quality and best practices
POST /repos/clone- Clone and index a repositoryGET /repos/session/{session_id}- Get session information
POST /repos/ask- Ask a question about the repositoryPOST /repos/ask/stream- Stream chat responses in real-time
GET /health- API health status
- "What does this repository do?"
- "Show me the main entry points of the application"
- "How is error handling implemented?"
- "What design patterns are used in this codebase?"
- "Find all the API endpoints"
- "Explain the database models"
- "What are the main dependencies?"
RepoLens/
├── backend/
│ ├── main.py # FastAPI application entry point
│ ├── pyproject.toml # Python dependencies
│ └── app/
│ ├── agents/
│ │ └── graph.py # LangGraph agent workflow
│ ├── api/
│ │ └── repos.py # Repository API endpoints
│ ├── core/
│ │ └── ignore.py # File filtering logic
│ └── services/
│ ├── chat_service.py # Chat session management
│ ├── repo_cloner.py # Repository cloning
│ ├── repo_scanner.py # File scanning and analysis
│ ├── vector_store.py # Vector database operations
│ ├── lazy_emberdder.py # Embedding generation
│ └── dependency_extractor.py
├── frontend/
│ ├── package.json # Node.js dependencies
│ ├── next.config.mjs # Next.js configuration
│ └── app/
│ ├── page.jsx # Main application page
│ ├── layout.jsx # App layout
│ └── globals.css # Global styles
└── README.md
Repository not cloning?
- Ensure the repository URL is valid and publicly accessible
- Check your internet connection
Chat not working?
- Verify your OpenAI API key is set correctly
- Ensure the backend server is running
- Check that the repository was successfully indexed
Performance issues?
- Large repositories may take longer to index
- Only files under 800 lines are currently indexed for optimal performance
- Support for more programming languages
- Advanced code analysis features
- Integration with more LLM providers
- Collaborative analysis features
- Repository comparison tools
- Advanced visualization of code relationships