FeaturesAI Review Engine

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:

LanguageSupport Level
JavaScript / TypeScriptFull analysis
PythonFull analysis
GoFull analysis
JavaFull analysis
RubyFull analysis
RustFull analysis
C# / .NETFull analysis
PHPFull 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:

  1. Go to app.mesrai.com and sign in
  2. Select your repository from the dashboard
  3. Navigate to Settings β†’ Review Rules
  4. 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

  1. Open app.mesrai.com
  2. Select your Organization or Repository
  3. Go to Settings
  4. 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:

SettingDescription
SecurityVulnerability detection, secrets scanning
PerformanceInefficient patterns, optimization suggestions
ArchitectureDesign patterns, code organization
Best PracticesLanguage-specific recommendations

Severity Levels

Configure how strictly Mesrai reviews your code:

LevelBehavior
StrictFlag all potential issues
ModerateBalance between thoroughness and noise
RelaxedFocus on critical issues only

Best Practices

  1. Start with default settings β€” The engine is pre-configured for common use cases
  2. Add custom instructions gradually β€” Begin with key guidelines and expand over time
  3. Review AI suggestions β€” While highly accurate, always verify suggestions match your intent
  4. 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


πŸ’‘

Need help configuring? Check our FAQ or contact support.