# allwefantasy/auto-coder architecture

> Architecture diagram of the GitHub repository allwefantasy/auto-coder, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/allwefantasy/auto-coder
- Repository: https://github.com/allwefantasy/auto-coder

## Overview

##### Main Components Identification

The system should be divided into these major components:

a) Core Components:
- Auto-Coder Engine (src/autocoder)
- RAG (Retrieval-Augmented Generation) System
- Agent System
- Chat Interface
- IDE Integration

b) Integration Layers:
- VSCode Plugin
- Desktop Application
- Command-line Interface

**[User Interfaces]**
- ↓
**[Integration Layer]**
- ↓
**[Core Services]**
- ↓
**[Infrastructure]**

##### Component Details

Frontend Layer (Blue):
- VSCode Extension (ide_plugins/vscode)
- Desktop App (pc/app-auto-coder)
- CLI Interface (auto_coder_installer)

Core Services Layer (Green):
- Agent System
- Coder Agent
- Planner Agent
- Designer Agent
- Project Reader
- RAG System
- Document Retrieval
- Cache Management
- Index Management
- Code Generation
- Auto Merge
- Code Modification
- Code Execution

Infrastructure Layer (Gray):
- LLM Integration
- File System
- Storage System
- Search Engine Integration

##### Data Flow Representation

- User input flow
- Code generation pipeline
- Document retrieval path
- Model interaction flow

##### Additional Details

Annotations for:
- File formats supported
- Communication protocols
- Cache mechanisms
- Security boundaries

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph User_Interfaces
        VS["VSCode Extension"]:::frontend
        DA["Desktop App"]:::frontend
        CLI["CLI Interface"]:::frontend
    end

    subgraph Integration_Layer
        AC["Auto-Coder Engine"]:::integration
        CI["Chat Interface"]:::integration
    end

    subgraph Core_Services
        subgraph Agent_System
            PA["Planner Agent"]:::agent
            CA["Coder Agent"]:::agent
            DA2["Designer Agent"]:::agent
            PR["Project Reader"]:::agent
        end

        subgraph RAG_System
            DR["Document Retrieval"]:::rag
            CM["Cache Management"]:::rag
            IM["Index Management"]:::rag
        end

        subgraph Code_Services
            CG["Code Generation"]:::code
            CM2["Code Modification"]:::code
            AM["Auto Merge"]:::code
        end
    end

    subgraph Infrastructure
        LLM["LLM Integration"]:::infra
        FS["File System"]:::infra
        SS["Storage System"]:::infra
        SE["Search Engine"]:::infra
    end

    VS --> AC
    DA --> AC
    CLI --> AC
    AC --> CI
    CI --> Agent_System
    CI --> RAG_System
    Agent_System --> Code_Services
    RAG_System --> Code_Services
    Code_Services --> Infrastructure

    %% Click Events
    click VS "https://github.com/allwefantasy/auto-coder/tree/master/ide_plugins/vscode/auto-coder/"
    click DA "https://github.com/allwefantasy/auto-coder/tree/master/pc/app-auto-coder/"
    click CLI "https://github.com/allwefantasy/auto-coder/tree/master/auto_coder_installer/"
    click AC "https://github.com/allwefantasy/auto-coder/blob/master/src/autocoder/auto_coder.py"
    click CI "https://github.com/allwefantasy/auto-coder/tree/master/src/autocoder/chat/"
    click PA "https://github.com/allwefantasy/auto-coder/blob/master/src/autocoder/agent/planner.py"
    click CA "https://github.com/allwefantasy/auto-coder/blob/master/src/autocoder/agent/coder.py"
    click DA2 "https://github.com/allwefantasy/auto-coder/blob/master/src/autocoder/agent/designer.py"
    click PR "https://github.com/allwefantasy/auto-coder/blob/master/src/autocoder/agent/project_reader.py"
    click DR "https://github.com/allwefantasy/auto-coder/blob/master/src/autocoder/rag/document_retriever.py"
    click CM "https://github.com/allwefantasy/auto-coder/tree/master/src/autocoder/rag/cache/"
    click IM "https://github.com/allwefantasy/auto-coder/tree/master/src/autocoder/index/"
    click CG "https://github.com/allwefantasy/auto-coder/blob/master/src/autocoder/common/code_auto_generate.py"
    click CM2 "https://github.com/allwefantasy/auto-coder/blob/master/src/autocoder/common/code_auto_merge.py"

    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef integration fill:#f1c40f,stroke:#f39c12,color:black
    classDef agent fill:#2ecc71,stroke:#27ae60,color:white
    classDef rag fill:#2ecc71,stroke:#27ae60,color:white
    classDef code fill:#2ecc71,stroke:#27ae60,color:white
    classDef infra fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Legend
    subgraph Legend
        F["Frontend"]:::frontend
        I["Integration"]:::integration
        C["Core Services"]:::agent
        IF["Infrastructure"]:::infra
    end
```
