Skip to content

shahidhustles/astra-coder

Repository files navigation

Astra Coder: The Future of Autonomous Debugging

License: MIT Next.js TypeScript

Astra Coder is an advanced, multi-agent AI platform designed to autonomously scan, diagnose, and fix repository-level errors. By combining real-world runtime validation with sophisticated agentic reasoning, Astra Coder moves beyond simple code suggestions to provide verified, production-ready fixes.

Demo VideoSystem ArchitectureQuick StartFeatures


📹 Demo

Watch Astra Coder Demo

Click the image above to watch the full demo video on YouTube


🏗️ System Architecture

Astra Coder System Architecture


The Problem: The "Snippet" Trap

Traditional debuggers and even modern AI assistants often fall into the "Snippet Trap." They analyze isolated blocks of code without understanding the runtime context, environment dependencies, or the "butterfly effect" of a change across a repository.

The Challenge:

  • Manual Reproduction: Developers spend hours trying to replicate errors from logs.
  • Blind Fixing: AI often suggests code that looks correct but fails to compile or breaks dependencies.
  • Context Fragmentation: Constant switching between IDEs, terminals, and GitHub.

Our Solution: While the original problem statement called for a multi-agent workflow to identify errors in snippets, Astra Coder goes way beyond. We don't just look at snippets; we inhabit the entire repository. We don't just suggest; we validate.

🚀 Quick Start

Prerequisites

  • Node.js 18+ or bun
  • pnpm (recommended) or npm/yarn
  • GitHub Personal Access Token (for PR creation)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/astra-coder.git
cd astra-coder
  1. Install dependencies:
pnpm install
  1. Set up environment variables: Create a .env.local file in the project root:
# AI & Gateway
OPENAI_API_KEY=your_openai_key
AI_GATEWAY_API_KEY=your_gateway_key

# GitHub Integration
GITHUB_PAT=your_github_personal_access_token

# E2B Sandbox
E2B_API_KEY=your_e2b_api_key
  1. Run the development server:
pnpm dev

Open http://localhost:3000 with your browser.


✨ Features

  • Autonomous Repository Diagnostics: Automatically clones and analyzes repos in isolated sandboxes.
  • Multi-Agent Intelligence: Scanner, Fixer, and Validator agents work in concert to identify and resolve issues.
  • Generator-Evaluator Loop: Iterates up to 3–5 times until validation passes.
  • Real-time Thought Streaming: Watch the AI's reasoning unfold in real-time.
  • Human-In-The-Loop (HITL): Agent pauses for approval before creating pull requests.
  • Zero-Config Environment Detection: Automatically detects npm, pnpm, yarn, pip, and static sites.

2. Architecture: The Powerhouse Stack

Astra Coder is built on a cutting-edge, high-performance stack designed for speed, reliability, and deep technical integration:

  • Next.js 16 & TypeScript: The backbone of our lightning-fast, type-safe application, ensuring a seamless developer experience.
  • Vercel AI SDK (LangGraph-powered): We leverage advanced state management to orchestrate complex agentic behaviors, ensuring state and context are passed seamlessly between specialized agents.
  • E2B AI Sandboxes: Our core innovation. Every operation happens in a secure, isolated cloud environment where we can actually run your code, install dependencies, and execute builds.
  • AI Gateway: Centralized inference management for optimized token usage, high availability, and low-latency responses.

3. How It Works: The "Propose-Verify-Iterate" Loop

  1. Scanner Agent: Clones the target repository into an isolated E2B Sandbox. It automatically detects the environment (npm, pnpm, yarn, pip) and runs a full build to capture real runtime errors.
  2. Fixer Agent: Analyzes the build logs and source code to propose a surgical fix.
  3. Validator Agent: Applies the fix in the sandbox and re-runs the build/tests. It provides detailed feedback on whether the fix logically and technically addresses the issue.
  4. The Generator-Evaluator Loop: This cycle repeats (up to 3 - 5 iterations) until the Validator is satisfied and the build passes.

4. Innovation: Beyond the Status Quo

We didn't just meet the requirements; we redefined what an AI coding agent can do:

  • Real-time "Thought" Streaming: Total transparency. Just like Perplexity or Cursor, we stream every "thought" and action—from cloning to validation—live to the frontend.
  • Human-In-The-Loop (HITL) Orchestration: We respect your codebase. The agent autonomously prepares the fix, branch, and PR metadata, but it pauses for your final approval before pushing to GitHub.
  • Zero-Config Diagnostics: No setup required. Astra Coder intelligently probes your repo to understand its structure and requirements automatically.

5. Challenges We Solved

  • Challenge: AI "hallucinations" where agents suggest syntactically correct but functionally broken code. Solution: We use E2B Sandboxes to run actual builds and tests, proving the fix works before it ever reaches you.
  • Challenge: The "Black Box" anxiety where developers can't see how an agent reached a conclusion. Solution: Our Real-time Thought Streaming exposes the agent's internal logic live, building trust through total transparency.
  • Challenge: Environment-specific bugs that are impossible to replicate in a standard LLM context. Solution: Astra Coder autonomously detects and mirrors your project's environment (npm, pnpm, pip) within a secure sandbox for 1:1 reproduction.
  • Challenge: Maintaining complex state and context across multi-agent conversations. Solution: We implemented a LangGraph-powered state machine that ensures seamless context passing between specialized Scanner, Fixer, and Validator agents.

6. Roadmap: The Autonomous Maintainer

  • MCP-Powered Documentation: Integrating the Model Context Protocol (MCP) to fetch live, up-to-the-minute documentation updates. This ensures the AI always works with the latest library versions, drastically reducing hallucinations and outdated fixes.
  • Cross-Repo Debugging: Solving complex bugs that span across multiple microservices.
  • Proactive Security Patching: Automatically identifying and fixing CVEs before they can be exploited.
  • IDE Integration: Bringing the full power of Astra Coder's sandboxed validation directly into VS Code and IntelliJ.

📝 Development

Available Scripts

# Development server
pnpm dev

# Build for production
pnpm build

# Run production server
pnpm start

# Lint code
pnpm lint

# Add new UI component
pnpm dlx shadcn@latest add [component-name]

🛠️ Project Structure

astra-coder/
├── app/
│   ├── api/                    # Backend API routes
│   │   ├── scanner/           # Repository scanning endpoint
│   │   ├── fixer-validator/   # Fix generation & validation endpoint
│   │   └── create-pr/         # GitHub PR creation endpoint
│   ├── dashboard/             # Main dashboard UI
│   └── page.tsx               # Landing page
├── components/
│   ├── dashboard/             # Dashboard components
│   ├── ui/                    # Shadcn UI components
│   └── ai-elements/           # Custom AI visualizations
├── lib/
│   ├── scanner/               # Scanner logic & error report generation
│   ├── actions/               # Server actions
│   └── utils.ts
└── public/                    # Static assets

🤝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.


🙋 Support

Have questions or found a bug? Please open an issue on GitHub.


Astra Coder: Stop debugging. Start shipping.

About

Autonomous multi-agent AI debugger that scans repositories, diagnoses errors, and generates verified fixes in isolated sandboxes. No guesses. No hallucinations. Just production-ready solutions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors