Skip to content

nivethadhanakoti/BugBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BugBot — Bug Fixing Co-Pilot

AI-powered multi-agent system for bug triage, knowledge retrieval, code context linking, and fix recommendation.

Stack: Python + FastAPI · React + Vite + Tailwind · sentence-transformers + FAISS · Ollama (local LLM)


Quick Start

1. Backend

cd backend
python -m venv venv
source venv/bin/activate          # Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reload --port 8000

API live at http://localhost:8000 · Swagger docs at http://localhost:8000/docs

2. Frontend

cd frontend
npm install
npm run dev

UI live at http://localhost:5173

3. Ollama (optional — for AI-powered fixes)

ollama serve
ollama pull codellama              # or: llama3, deepseek-coder

BugBot works without Ollama using intelligent rule-based fallbacks.


Architecture

bugbot/
├── backend/
│   ├── main.py                    # FastAPI app + all routes
│   ├── config.py                  # Environment config
│   ├── requirements.txt
│   ├── data/
│   │   ├── bugs.json              # Bug DB (15 sample bugs)
│   │   ├── faiss_index.bin        # Vector index (auto-generated)
│   │   └── sample_repo/           # Sample Java source files
│   ├── agents/
│   │   ├── triage_agent.py        # Bug classification P0–P3
│   │   ├── knowledge_agent.py     # FAISS similarity search
│   │   ├── context_agent.py       # Code file & function linking
│   │   └── fix_agent.py           # LLM fix + rule-based fallback
│   ├── models/schemas.py          # Pydantic models
│   └── services/
│       ├── bug_store.py           # JSON CRUD
│       ├── embedding_service.py   # sentence-transformers + FAISS
│       └── ollama_service.py      # Ollama REST client
└── frontend/
    └── src/
        ├── App.jsx
        ├── components/
        │   ├── Dashboard.jsx      # Stats + recent bugs
        │   ├── BugAnalyzer.jsx    # Full 4-agent pipeline UI
        │   ├── BugList.jsx        # Registry with search/filter
        │   └── Sidebar.jsx
        ├── hooks/useData.js
        └── services/api.js

API Reference

Method Endpoint Description
POST /api/bugs/analyze Run full pipeline
GET /api/bugs List bugs (filter by status/priority)
PATCH /api/bugs/{id} Update bug status
GET /api/bugs/stats Aggregated stats
POST /api/index/rebuild Rebuild FAISS index
GET /api/ollama/status Check LLM availability

Adding Your Own Code Repo

# Drop source files into:
backend/data/sample_repo/

# Rebuild index:
curl -X POST http://localhost:8000/api/index/rebuild

Supports: .java .py .js .ts .go .kt .cs .cpp


Troubleshooting

FAISS index empty → Click "Rebuild Index" on Dashboard or:

curl -X POST http://localhost:8000/api/index/rebuild

Ollama not connecting → Run ollama serve in a separate terminal.

Frontend can't reach API → Ensure backend is on port 8000.


Roadmap

  • Real Jira webhook integration
  • Git/Gerrit code repo integration
  • Java AST Parser for line-level code analysis
  • Auto-create draft pull request with fix
  • Slack/Teams P0 notifications
  • Fine-tuned triage model (replace keyword scoring)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages