AI Review Engine
Mesraiβs AI Review Engine is the core of our code review platform. It uses advanced language models to understand your code at a deep level and provide actionable feedback.
How It Works
The AI Review Engine processes your pull requests in three phases:
1. Code Understanding
When you open a PR, Mesrai:
- Analyzes the changed files and understands the code structure
- Maps relationships and dependencies across your codebase
- Builds a contextual understanding of what your code does
2. Analysis
The engine performs multiple analysis passes:
- Security Analysis: Identifies potential vulnerabilities and security anti-patterns
- Performance Analysis: Detects inefficient code patterns and optimization opportunities
- Architecture Analysis: Evaluates code organization and adherence to best practices
- Style Analysis: Checks for consistency with your teamβs coding standards
3. Feedback Generation
Finally, the engine generates human-readable feedback:
- Specific line-by-line comments with suggested fixes
- Summary of overall PR quality
- Prioritized list of issues by severity
Key Features
Context-Aware Reviews
Unlike simple linters, Mesrai understands the broader context of your changes:
// Mesrai understands this function is called from an async context
// and suggests appropriate error handling
function fetchUserData(userId) {
return database.query(`SELECT * FROM users WHERE id = ${userId}`);
// β οΈ Mesrai: SQL injection vulnerability detected
// Suggestion: Use parameterized queries
}Language Support
The AI Review Engine supports all major programming languages:
| Language | Support Level |
|---|---|
| JavaScript / TypeScript | Full analysis |
| Python | Full analysis |
| Go | Full analysis |
| Java | Full analysis |
| Ruby | Full analysis |
| Rust | Full analysis |
| C# / .NET | Full analysis |
| PHP | Full analysis |
| And more⦠| 20+ languages |
Configuration via Platform
All configuration is done through the Mesrai Dashboard β no config files needed!
Repository-Level Rules
Configure review rules for each repository directly from the Mesrai platform:
- Go to app.mesrai.com and sign in
- Select your repository from the dashboard
- Navigate to Settings β Review Rules
- Configure your preferences:
- Enable/disable specific analysis types
- Set severity levels for different issue types
- Add custom instructions for your team
Custom Instructions
You can provide custom instructions to guide how Mesrai reviews your code:
- Coding standards β Tell Mesrai about your teamβs conventions
- Focus areas β Prioritize security, performance, or other aspects
- Ignore patterns β Specify files or patterns to skip
- Team preferences β Add context about your project requirements
How to Configure
- Open app.mesrai.com
- Select your Organization or Repository
- Go to Settings
- Configure:
- Review Settings β Enable/disable review types
- Instructions β Add custom guidance for reviews
- Exclusions β Specify files to ignore
Changes take effect immediately on new pull requests.
Review Settings
Analysis Types
Control which types of analysis are performed:
| Setting | Description |
|---|---|
| Security | Vulnerability detection, secrets scanning |
| Performance | Inefficient patterns, optimization suggestions |
| Architecture | Design patterns, code organization |
| Best Practices | Language-specific recommendations |
Severity Levels
Configure how strictly Mesrai reviews your code:
| Level | Behavior |
|---|---|
| Strict | Flag all potential issues |
| Moderate | Balance between thoroughness and noise |
| Relaxed | Focus on critical issues only |
Best Practices
- Start with default settings β The engine is pre-configured for common use cases
- Add custom instructions gradually β Begin with key guidelines and expand over time
- Review AI suggestions β While highly accurate, always verify suggestions match your intent
- Provide feedback β Use the π/π buttons on comments to help improve accuracy
Feedback Loop
Help improve Mesraiβs reviews for your codebase:
- π Helpful β Mark suggestions that were useful
- π Not Helpful β Flag suggestions that missed the mark
- Comment β Add context to help Mesrai learn your preferences
Your feedback helps Mesrai provide better, more relevant reviews over time.
Next Steps
- Configure Context Awareness β Enhance review accuracy
- Set up Architectural Analysis β Deep design analysis
- Integrate with GitHub β Connect your repositories
- View Dashboard β Configure your settings
Need help configuring? Check our FAQ or contact support.