# debarun23/job-granite-guide architecture

> Architecture diagram of the GitHub repository debarun23/job-granite-guide, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/debarun23/job-granite-guide
- Repository: https://github.com/debarun23/job-granite-guide

## Overview

##### Project Type and Purpose
- This is a cloud-deployed, AI-powered interview coaching agent built on IBM Watsonx.ai.
- Users interact via a chat interface (web or API), receiving personalized questions, model answers, and feedback.

##### File Structure
- Top-level files only: a Jupyter notebook, README.md, and two PDF artifacts (paper + PPT).
- No standalone frontend/backend code here—most logic lives inside IBM Watsonx.ai Studio (Agentic AI Lab) and runtime.
- Configuration happens in the Studio UI and IBM Cloud deployment spaces, not in local code files.

##### README for Architecture Insights
- Workflow steps: user input → LLM inference → RAG augmentation → agent response.
- Technologies: IBM Granite model, RAG with Cloud Object Storage, Watsonx Studio/Runtime, REST endpoint.
- Deployment: Watsonx.ai Studio to Watsonx runtime; external integration via REST API.

##### Main Components to Illustrate
a. Client Layer
- Web or CLI-based chat interface
- External applications invoking the REST endpoint
b. API & Orchestration Layer
- IBM Watsonx.ai Agentic AI Lab (instructions + workflows)
- IBM Watsonx Runtime (model hosting + execution)
- REST API Gateway (exposes inference endpoint)
c. Core AI Services
- RAG Pipeline
– Retriever (vector search or metadata search)
– Cloud Object Storage (stores domain/HR data, prompt templates)
d. Storage & Data Layer
- IBM Cloud Object Storage (documents, context)
- Optional: Vector store or embedded index inside Cloud Object Storage
e. External Services & Integrations
- IBM Cloud IAM (auth)
- Logging/Monitoring (Cloud Monitoring, LogDNA)
- (Future) Translator, Voice services, Video analysis

##### Relationships & Data Flow
1. User sends a query via chat UI or REST client → API Gateway
2. API Gateway forwards request to Watsonx Runtime
3. Runtime triggers Agentic AI Lab workflow:
a. RAG Retriever queries Cloud Object Storage → returns relevant docs or embeddings
b. Prompt assembler combines user prompt + retrieved context + agent instructions
c. Granite LLM executes the assembled prompt → generates answer + tips
4. Agentic workflow post-processes output (formatting, feedback loops)
5. Response returned through API Gateway → back to user

##### Architectural Patterns & Design Principles
- Separation of concerns: UI vs. Orchestration vs. Model vs. Storage
- RAG pattern: decoupled retrieval + generation
- Micro-workflow/agentic design: reusable “skills” in Agentic AI Lab
- Cloud-native deployment: stateless runtime pods, object storage, managed services
- API-first: everything accessible via REST for easy integration

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        direction TB
        ChatUI["Chat UI (Web/CLI)"]:::client
        RESTClient["REST Client"]:::client
    end

    %% API & Orchestration Layer
    subgraph "API & Orchestration Layer"
        direction TB
        APIGateway["API Gateway (REST)"]:::orchestr
        WatsonxRuntime["Watsonx Runtime"]:::orchestr
        AgentLab["Agentic AI Lab"]:::orchestr
        PromptAssembler["Prompt Assembler"]:::orchestr
        PostProcessor["Post-Processor"]:::orchestr
    end

    %% Core AI Services
    subgraph "Core AI Services"
        direction TB
        RAGRetriever["RAG Retriever"]:::ai
        GraniteLLM["Granite-3B-Instruct LLM"]:::ai
    end

    %% Storage & Data Layer
    subgraph "Storage & Data Layer"
        direction TB
        COS["Cloud Object Storage"]:::storage
    end

    %% External Services & Integrations
    subgraph "External Services & Integrations"
        direction TB
        IAM["IBM Cloud IAM"]:::external
        Monitoring["Logging & Monitoring"]:::external
        FutureExt["Future Services\n(Translator, Voice, Video)"]:::external
    end

    %% Research & Documentation
    subgraph "Research & Documentation"
        direction TB
        Paper["Few-Shot Learning Paper"]:::docs
        Slides["Architecture Slides"]:::docs
        Notebook["Demo Notebook"]:::docs
    end

    %% Connections
    ChatUI -->|1. send query| APIGateway
    RESTClient -->|1. send query| APIGateway
    APIGateway -->|2. forward request| WatsonxRuntime
    WatsonxRuntime -->|3. trigger workflow| AgentLab
    AgentLab -->|a. retrieve| RAGRetriever
    RAGRetriever -->|query| COS
    COS -->|docs/embeddings| RAGRetriever
    AgentLab -->|b. assemble prompt| PromptAssembler
    PromptAssembler -->|c. call model| GraniteLLM
    GraniteLLM -->|response| PostProcessor
    PostProcessor -->|post-process| APIGateway
    APIGateway -->|5. return response| ChatUI
    APIGateway -->|5. return response| RESTClient

    %% External Integrations
    APIGateway --> IAM
    APIGateway --> Monitoring
    AgentLab --> FutureExt

    %% Documentation Links
    click ChatUI "https://github.com/debarun23/job-granite-guide/blob/main/Job_Granite_Guide_Standard_noteBook.ipynb"
    click Notebook "https://github.com/debarun23/job-granite-guide/blob/main/Job_Granite_Guide_Standard_noteBook.ipynb"
    click APIGateway "https://github.com/debarun23/job-granite-guide/blob/main/README.md"
    click WatsonxRuntime "https://github.com/debarun23/job-granite-guide/blob/main/README.md"
    click AgentLab "https://github.com/debarun23/job-granite-guide/blob/main/README.md"
    click COS "https://github.com/debarun23/job-granite-guide/blob/main/README.md"
    click IAM "https://github.com/debarun23/job-granite-guide/blob/main/README.md"
    click Monitoring "https://github.com/debarun23/job-granite-guide/blob/main/README.md"
    click FutureExt "https://github.com/debarun23/job-granite-guide/blob/main/README.md"
    click Paper "https://github.com/debarun23/job-granite-guide/blob/main/language_models_are_few-shot_learners-Paper.pdf"
    click Slides "https://github.com/debarun23/job-granite-guide/blob/main/project_PPT (PDF).pdf"

    %% Styles
    classDef client fill:#AED6F1,stroke:#21618C,color:#000
    classDef orchestr fill:#A9DFBF,stroke:#196F3D,color:#000
    classDef ai fill:#F5B041,stroke:#B9770E,color:#000
    classDef storage fill:#F9E79F,stroke:#B7950B,color:#000
    classDef external fill:#D5DBDB,stroke:#6E2C00,color:#000
    classDef docs fill:#E8DAEF,stroke:#6C3483,color:#000
```
