Skip to content

shibinsp/agentic-model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agentic Bug Fixer

AI-powered code analysis and bug fixing system using Mistral AI.

Features

  • Create bug tickets with descriptions
  • AI agent analyzes code and finds bugs automatically
  • Real-time progress tracking with step-by-step visibility
  • Side-by-side code diff view (original vs fixed)
  • One-click fix application

Tech Stack

  • Frontend: React 18 + Vite + Tailwind CSS
  • Backend: Python FastAPI + SQLite
  • AI: Mistral AI API

Quick Start

1. Start Backend

cd agentic-bug-fixer/backend
pip install -r requirements.txt
python main.py

Backend runs at: http://localhost:8000

2. Start Frontend

cd agentic-bug-fixer/frontend
npm install
npm run dev

Frontend runs at: http://localhost:3000

3. Open Browser

Navigate to http://localhost:3000

Demo

  1. Create a bug ticket:

    • Title: "Application crashes when user has no membership"
    • Description: "KeyError occurs in calculate_discount function when user.membership is not gold/silver/bronze"
    • Code folder: ./sample_code
  2. Watch the agent work:

    • Status changes: NEW -> ANALYZING -> FOUND_BUG -> FIX_GENERATED -> RESOLVED
    • See each analysis step appear in real-time
  3. Review the fix:

    • View original vs fixed code side by side
    • Read AI explanation of the fix
  4. Apply the fix:

    • Click "Apply Fix" button

API Endpoints

Method Endpoint Description
GET / Health check
GET /tickets List all tickets
POST /tickets Create ticket
GET /tickets/{id} Get ticket details
DELETE /tickets/{id} Delete ticket
POST /tickets/{id}/apply-fix Apply fix
POST /tickets/{id}/restart Restart analysis

Agent Steps

  1. Scan Files - Read code files from folder
  2. Analyze Structure - Map file dependencies
  3. Find Bug - AI identifies bug location
  4. Root Cause - Determine why bug occurs
  5. Generate Fix - Create corrected code
  6. Validate - Verify fix addresses issue

Configuration

Set your Mistral API key in backend/.env:

MISTRAL_API_KEY=your-api-key-here

Project Structure

agentic-bug-fixer/
├── backend/
│   ├── main.py          # FastAPI app
│   ├── database.py      # SQLite operations
│   ├── agent.py         # AI agent logic
│   ├── models.py        # Pydantic models
│   └── requirements.txt
├── frontend/
│   ├── src/
│   │   ├── App.jsx
│   │   ├── api/api.js
│   │   └── components/
│   ├── package.json
│   └── vite.config.js
└── sample_code/         # Demo buggy code
    ├── app.py
    ├── utils.py
    └── database.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors