Inspiration
Debugging is the most time-consuming part of software development — developers spend an estimated 50% of their time finding and fixing bugs rather than building new features. We've all been there: staring at a cryptic stack trace at 2 AM, copy-pasting it into Google, digging through StackOverflow threads, and still not knowing where to start. We wanted to build something that felt like having a senior engineer sitting next to you — one who instantly reads the trace, pinpoints the root cause, writes the fix, and opens the pull request. That's the vision behind Mirai.
What it does
Mirai is an AI-powered debugging assistant that takes a bug from detection to a merged pull request — automatically.
Bug Analysis — Paste any stack trace into the chat. Mirai's AI identifies the root cause, affected file and function, severity level, and confidence score in seconds. Commit Analysis — Connect your GitHub repository and analyze your latest commits for potential issues, regressions, or code quality problems before they become bugs. Auto-Generated Patches — Mirai produces a ready-to-apply diff and auto-generated test cases for every bug it analyzes. One-Click PRs — With a connected GitHub App, Mirai can open a pull request with the fix directly from the dashboard — no terminal needed. Persistent Chat Sessions — Every debugging conversation is saved, filterable by bug type or commit analysis, and resumable at any time.
How we built it
Frontend: Next.js 15 App Router with TypeScript and Tailwind CSS. We used the Vercel AI SDK's useChat hook with text-stream protocol for real-time streamed AI responses.
Authentication: Better Auth with GitHub OAuth, storing access tokens so users can connect repositories directly without needing a GitHub App installation.
AI / LLM: Groq API running llama-3.1-8b-instant for near-instant inference. We built a structured prompt system that parses AI output into typed objects — severity, root cause, fix steps, unified diffs, and test cases.
GitHub Integration: A dual-path GitHub integration — OAuth tokens for personal repo access and a GitHub App for organization-wide installation. Both paths share the same downstream API so everything works transparently.
Database: Supabase (PostgreSQL) stores bugs, patches, chat sessions, commit analyses, and GitHub installations with Row Level Security.
Deployment: The full stack runs on a single Next.js server with API routes handling LLM calls, GitHub webhook events, and internal analysis jobs.
Challenges we ran into
Flex layout height containment — Getting the chat interface to scroll correctly inside a nested flex chain was surprisingly tricky. Without min-h-0 on the right containers, the chat body would grow to its full content height, get clipped by an overflow-hidden ancestor, and silently swallow all messages. It looked like the AI wasn't responding when it actually was. OAuth token routing — Better Auth stores GitHub tokens under camelCase column names in a table we don't fully control. Building a transparent oauth: virtual installation ID that all downstream GitHub functions understood without modification required careful abstraction. LLM response parsing — Getting the model to consistently output structured data (diffs, severity levels, test names) with no hallucinated formatting required multiple iterations on the system prompt and a robust fallback parser. GitHub App vs OAuth — Reconciling two completely different GitHub auth flows (App installation tokens vs. user OAuth tokens) into a single unified repo selector and analysis pipeline was a significant architectural challenge.
Accomplishments that we're proud of
A fully working end-to-end pipeline: paste a stack trace → get AI root cause analysis → receive a unified diff → open a PR — all without leaving the dashboard. Streaming AI responses that feel instant thanks to Groq's low-latency inference. A dual-mode GitHub integration that works for both individual developers (OAuth) and teams (GitHub App) with zero extra configuration for the user. A clean, production-quality UI with a real-time chat interface, commit analysis panels, session history, and a full issue tracker — built end-to-end during the hackathon. Structured AI output parsing that turns raw LLM text into typed TypeScript objects with severity badges, confidence scores, and actionable fix steps.
What we learned
rompt engineering is product engineering. The quality of Mirai's output is entirely determined by how precisely we describe the task to the model. Small changes in the system prompt produced dramatically different (better or worse) structured outputs. Streaming UX changes everything. Switching from waiting for a full response to streaming tokens in real time made the product feel 10× more responsive and trustworthy, even when the underlying latency was the same. Auth is never "just auth." OAuth scopes, token storage, refresh flows, and downstream API compatibility took far more time than expected — but getting it right meant users could connect GitHub in one click with zero friction. Flex and overflow are deceptively complex. Browser layout behavior in deeply nested flex containers has non-obvious rules that can silently break entire sections of UI in ways that look like backend failures.
What's next for Mirai
Auto-fix on webhook trigger — When a GitHub Actions CI run fails, Mirai automatically receives the error via webhook, analyzes it, and opens a PR with a fix — zero human involvement required. Multi-file patch generation — Today's diffs are single-file. We want Mirai to understand cross-file call graphs and produce patches that span multiple files when necessary. Team collaboration — Shared bug queues, commenting on analyses, and assigning fixes to teammates. IDE extension — Bring Mirai's analysis directly into VS Code so developers never have to leave their editor. Fine-tuned model — Train on a corpus of real bug-fix pairs to improve patch accuracy and reduce hallucinations in generated diffs.
Built With
- better-auth
- github-api
- github-apps
- github-oauth
- github-webhooks
- groq
- llama-3.1
- next.js
- octokit
- postgresql
- react
- supabase
- tailwind-css
- typescript
- vercel-ai-sdk

Log in or sign up for Devpost to join the conversation.