Skip to content

A Generative AI Assistant with advance agentic capabilities. Codebuddy uses machine learning to generate code, complete tasks, and streamline coding tasks workflow.

License

Notifications You must be signed in to change notification settings

olasunkanmi-SE/codebuddy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CodeBuddy: AI-Powered Agentic Coding Assistant

Version Downloads Rating

CodeBuddy is an advanced AI-powered VS Code extension featuring an agentic architecture with specialized sub-agents, tool orchestration, and multi-model support. It transforms your development workflow with intelligent code assistance, autonomous task execution, and deep codebase understanding.

✨ What's New in v3.7.x

πŸ€– Agentic Architecture - DeepAgents-powered autonomous developer agent with specialized sub-agents
🧠 LangGraph Integration - Sophisticated multi-agent orchestration with stateful workflows
πŸ”§ Tool Orchestration - Web search, file operations, and think tools for complex reasoning
πŸ“Š Mermaid Diagram Rendering - Visual diagram rendering with auto-fix for LLM syntax errors
πŸ” PR Review System - Intelligent pull request analysis with change detection
πŸ“š Persistent Codebase Understanding - SQLite-backed analysis caching across sessions
⚑ Streaming Responses - Real-time token streaming for responsive interactions


πŸ—οΈ Architecture Overview

CodeBuddy employs a sophisticated multi-agent architecture built on modern AI orchestration patterns:

flowchart TB
    subgraph Extension["🧩 CodeBuddy Extension"]
        subgraph UI["User Interface Layer"]
            Webview["πŸ’¬ Webview<br/>(React UI)"]
            Commands["⚑ Commands<br/>(Actions)"]
            Orchestrator["🎯 Orchestrator<br/>(Event Publisher)"]
        end

        subgraph AgentLayer["πŸ€– Agent Service Layer"]
            DeveloperAgent["🧠 Developer Agent<br/>(DeepAgents)"]

            subgraph SubAgents["Specialized Sub-Agents"]
                CodeAnalyzer["πŸ” Code<br/>Analyzer"]
                DocWriter["πŸ“ Doc<br/>Writer"]
                Debugger["πŸ› Debugger"]
                FileOrganizer["πŸ“ File<br/>Organizer"]
            end
        end

        subgraph Tools["πŸ”§ Tool Provider"]
            WebSearch["🌐 Web<br/>Search"]
            FileTool["πŸ“„ File<br/>Tool"]
            ThinkTool["πŸ’­ Think<br/>Tool"]
            TavilySearch["πŸ”Ž Tavily<br/>Search"]
        end

        subgraph Backends["πŸ’Ύ Backend Systems"]
            Filesystem["πŸ“‚ Filesystem<br/>(/workspace/)"]
            Store["πŸ—„οΈ Store<br/>(/docs/)"]
            State["⚑ State<br/>(/ ephemeral)"]
        end
    end

    subgraph External["☁️ External Services"]
        Gemini["Gemini"]
        Anthropic["Anthropic"]
        Groq["Groq"]
        Deepseek["Deepseek"]
        Tavily["Tavily API"]
    end

    Webview --> DeveloperAgent
    Commands --> DeveloperAgent
    Orchestrator --> DeveloperAgent

    DeveloperAgent --> SubAgents
    DeveloperAgent --> Tools

    Tools --> Backends
    Tools --> External
Loading

πŸ€– Agentic System

The core of CodeBuddy is built on DeepAgents and LangGraph, providing:

  • Developer Agent: Main orchestrating agent with access to tools and sub-agents
  • Specialized Sub-Agents:
    • Code Analyzer: Deep code review, architecture analysis, bug detection
    • Doc Writer: Comprehensive documentation generation
    • Debugger: Error investigation with web search for solutions
    • File Organizer: Project structure refactoring and organization

πŸ—„οΈ Hybrid Storage Architecture

CodeBuddy uses a sophisticated three-tier storage system:

Path Backend Persistence Purpose
/workspace/ Filesystem Permanent Real file operations on your codebase
/docs/ Store Cross-session Long-term knowledge and documentation
/ (root) State Session only Temporary scratch space

🎯 Core Features

🧠 AI-Powered Developer Agent

  • Autonomous Task Execution: Agent can plan, execute, and verify multi-step tasks
  • Tool Usage: Web search, file analysis, and structured thinking capabilities
  • Sub-Agent Delegation: Complex tasks are delegated to specialized agents
  • Human-in-the-Loop: Optional approval for file write/edit operations

πŸ’¬ Interactive Chat Interface

  • Modern React UI: Beautiful, responsive chat with syntax highlighting
  • Real-time Streaming: Token-by-token response streaming
  • Mermaid Diagrams: Visual diagram rendering with auto-fix for syntax errors
  • File Upload: Support for PDF, DOCX, CSV, JSON, TXT analysis
  • Customizable Themes: Multiple themes to match your preferences

πŸ” Code Intelligence

  • Code Review: Comprehensive analysis of code quality, security, and best practices
  • Refactoring: Context-aware code improvements and restructuring
  • Optimization: AI-driven performance enhancement suggestions
  • Explanation: Clear explanations of complex code logic
  • Comment Generation: Intelligent documentation for your code

πŸ“Š Mermaid Diagram Support

  • Visual Rendering: Automatic detection and rendering of Mermaid diagrams
  • Dark Theme: Beautiful purple-accented dark theme matching VS Code
  • Auto-Fix: Intelligent repair of common LLM syntax errors:
    • & symbol conversion to and
    • Smart quote normalization
    • Bracket balancing
    • Sequence/flowchart-specific fixes
  • Copy & Collapsible Source: Easy access to diagram code

πŸ”„ Pull Request Review

  • Branch Comparison: Compare current branch against any target branch
  • Change Detection: Multi-provider fallback for robust change detection
  • Comprehensive Analysis: Security, performance, and best practice review
  • Git CLI Integration: Direct integration with Git for accurate diffs

πŸ“š Documentation Generation

  • README Generation: Auto-generates professional README files
  • API Documentation: Extracts and documents REST endpoints
  • Architecture Diagrams: Creates Mermaid diagrams for system visualization
  • Component Documentation: Documents classes, interfaces, and modules

🌐 Web Search Integration

  • Tavily Search: High-quality search results for current information
  • URL Reranking: Prioritizes authoritative sources
  • Content Extraction: Readability-based article parsing
  • Solution Discovery: Find fixes for errors and best practices

πŸš€ Quick Start

Installation

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for "CodeBuddy"
  4. Click Install

Setup

  1. Select AI Model: Choose your preferred AI provider in settings
  2. Add API Key: Configure your API key for the chosen model
  3. Start Coding: CodeBuddy is ready to assist!

Getting Your API Keys

Provider Get API Key
Gemini Google AI Studio
Anthropic Anthropic Console
Groq Groq Console
Deepseek Deepseek Platform
XGrok X.AI Console
Tavily Tavily Dashboard (for web search)

πŸ“‹ How to Use

Right-Click Context Menu

Right-click on selected code to access:

Feature Description
πŸ’­ Add Comments Intelligent code documentation
πŸ” Review Code Comprehensive code analysis
πŸ”„ Refactor Code Smart code improvements
⚑ Optimize Code Performance enhancements
πŸ’¬ Explain Code Clear explanations
πŸ“ Generate Commit Smart Git commit messages
πŸ’« Inline Chat Context-aware discussions
πŸ“š Interview Me Technical interview prep
πŸ“Š Generate Diagram Mermaid diagram creation
πŸ—οΈ Analyze Codebase Deep architectural analysis
πŸ” Review PR Pull request review

⌨️ Keyboard Shortcuts

Command Windows/Linux macOS
Add Comment Ctrl+Shift+J Cmd+Shift+J
Review Code Ctrl+Shift+R Cmd+Shift+R
Refactor Code Ctrl+Shift+; Cmd+Shift+;
Optimize Code Ctrl+Shift+O Cmd+Shift+O
Explain Code Ctrl+Shift+1 Cmd+Shift+1
Generate Commit Ctrl+Shift+2 Cmd+Shift+2
Inline Chat Ctrl+Shift+8 Cmd+Shift+8
Generate Architecture Diagram Ctrl+Shift+8 Cmd+Shift+8
Analyze Codebase Ctrl+Shift+6 Cmd+Shift+6

Note: Customize shortcuts in VS Code's Keyboard Shortcuts settings (Cmd+K Cmd+S / Ctrl+K Ctrl+S)

Command Palette

Access via Ctrl+Shift+P / Cmd+Shift+P:

  • CodeBuddy: Generate Documentation
  • CodeBuddy: Show Cache Status
  • CodeBuddy: Clear Cache
  • CodeBuddy: Refresh Analysis
  • CodeBuddy: Restart

πŸ”§ Configuration

AI Model Selection

{
  "generativeAi.option": "Gemini" // or "Groq", "Anthropic", "XGrok", "Deepseek"
}

API Keys

{
  "google.gemini.apiKeys": "your-gemini-api-key",
  "google.gemini.model": "gemini-2.5-pro",
  "anthropic.apiKey": "your-anthropic-api-key",
  "anthropic.model": "claude-sonnet-4-5",
  "groq.llama3.apiKey": "your-groq-api-key",
  "groq.llama3.model": "llama-3.1-70b-versatile",
  "deepseek.apiKey": "your-deepseek-api-key",
  "tavily.apiKey": "your-tavily-api-key"
}

UI Customization

{
  "font.family": "JetBrains Mono",
  "chatview.theme": "Atom One Dark",
  "chatview.font.size": 16
}

πŸ“ Project Structure

codebuddy/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ extension.ts              # Extension entry point
β”‚   β”œβ”€β”€ orchestrator.ts           # Event orchestration system
β”‚   β”œβ”€β”€ agents/
β”‚   β”‚   β”œβ”€β”€ agentService.ts       # Main agent service
β”‚   β”‚   β”œβ”€β”€ developer/
β”‚   β”‚   β”‚   β”œβ”€β”€ agent.ts          # Developer agent (DeepAgents)
β”‚   β”‚   β”‚   β”œβ”€β”€ prompts.ts        # System prompts
β”‚   β”‚   β”‚   └── subagents.ts      # Specialized sub-agents
β”‚   β”‚   β”œβ”€β”€ backends/
β”‚   β”‚   β”‚   └── filesystem.ts     # VS Code filesystem backend
β”‚   β”‚   β”œβ”€β”€ langgraph/
β”‚   β”‚   β”‚   β”œβ”€β”€ tools/            # LangGraph tool implementations
β”‚   β”‚   β”‚   β”œβ”€β”€ nodes/            # Graph nodes (planner, responder, etc.)
β”‚   β”‚   β”‚   └── state/            # State management
β”‚   β”‚   └── tools/
β”‚   β”‚       └── provider.ts       # Tool factory and provider
β”‚   β”œβ”€β”€ commands/                 # VS Code command implementations
β”‚   β”‚   β”œβ”€β”€ pr/                   # PR review system
β”‚   β”‚   └── *.ts                  # Individual commands
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ codebase-understanding.service.ts
β”‚   β”‚   β”œβ”€β”€ documentation-generator.service.ts
β”‚   β”‚   β”œβ”€β”€ context-retriever.ts
β”‚   β”‚   β”œβ”€β”€ web-search-service.ts
β”‚   β”‚   β”œβ”€β”€ embedding.ts
β”‚   β”‚   └── *.ts
β”‚   β”œβ”€β”€ tools/
β”‚   β”‚   └── tools.ts              # Tool definitions (Web, File, Think)
β”‚   β”œβ”€β”€ llms/                     # AI provider integrations
β”‚   β”œβ”€β”€ infrastructure/           # Logging, database, etc.
β”‚   └── webview-providers/        # Webview provider management
β”œβ”€β”€ webviewUi/                    # React chat interface
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ MermaidDiagram.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ thinkingComponent.tsx
β”‚   β”‚   β”‚   └── *.tsx
β”‚   β”‚   └── App.tsx
β”‚   └── package.json
└── package.json                  # Extension manifest

πŸ”Œ Supported AI Models

Provider Models Best For
Gemini gemini-2.5-pro, gemini-1.5-flash General purpose, embeddings
Anthropic claude-sonnet-4-5, claude-3-opus Complex reasoning, code review
Groq llama-3.1-70b-versatile Fast responses
Deepseek deepseek-chat Cost-effective coding
XGrok grok-beta Latest capabilities

πŸš€ Roadmap

βœ… Completed

  • Multi-model AI support (5 providers)
  • Agentic architecture with DeepAgents
  • LangGraph integration for orchestration
  • Specialized sub-agents (Code Analyzer, Doc Writer, Debugger, File Organizer)
  • Web search with Tavily integration
  • Mermaid diagram rendering with auto-fix
  • PR review system
  • Persistent codebase analysis (SQLite)
  • Real-time streaming responses
  • Keyboard shortcuts

πŸ”œ Coming Soon

  • MCP Integration - Model Context Protocol for enhanced tool usage
  • Agent-to-Agent Communication - A2A protocol support
  • Local LLM Support - Ollama integration for offline usage
  • Multi-language Support - Extended language support
  • Team Collaboration - Shared contexts across teams
  • Custom Agents - User-defined specialized agents

πŸ› οΈ Troubleshooting

Common Issues

❓ Agent not responding

  • Verify API key is correct in settings
  • Check API quota/billing status
  • Try a different AI model

❓ Mermaid diagrams not rendering

  • Diagrams auto-fix common syntax errors
  • Check console for specific parse errors
  • Try "Show Source Code" to see raw diagram

❓ PR Review not working

  • Ensure you're in a Git repository
  • Check that you have multiple branches
  • Verify Git CLI is accessible

❓ Slow responses

  • Try Groq for faster responses
  • Check internet connection
  • Clear cache with CodeBuddy: Clear Cache

Getting Help


🀝 Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Development Setup

# Clone the repository
git clone https://github.com/olasunkanmi-SE/codebuddy.git

# Install dependencies
npm install
cd webviewUi && npm install

# Build
npm run compile
cd webviewUi && npm run build

# Run in development
# Press F5 in VS Code to launch extension development host

πŸ“Š Technical Specs

  • Bundle Size: ~9MB (Extension) + ~800KB (UI)
  • VS Code Version: 1.78.0+
  • AI Models: 5 providers supported
  • Database: SQLite for metadata, LanceDB for vectors
  • Agent Framework: DeepAgents + LangGraph
  • UI Framework: React + styled-components

πŸ“„ License

MIT License - see LICENSE for details.


🌟 Support the Project

If CodeBuddy enhances your workflow:

  • ⭐ Star the repository
  • πŸ“ Leave a review on the VS Code Marketplace
  • πŸ“ Leave a review on the open-vsx.org Marketplace
  • πŸ› Report bugs or suggest features
  • 🀝 Contribute to the codebase
  • πŸ’¬ Share with fellow developers

Made with ❀️ by Olasunkanmi Raymond

Transform your coding experience with AI-powered agentic assistance. Install CodeBuddy today and code smarter, not harder!

Install Now

About

A Generative AI Assistant with advance agentic capabilities. Codebuddy uses machine learning to generate code, complete tasks, and streamline coding tasks workflow.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 6

Languages