# pavankunchala/llm-learn-pk architecture

> Architecture diagram of the GitHub repository pavankunchala/llm-learn-pk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pavankunchala/llm-learn-pk
- Repository: https://github.com/pavankunchala/llm-learn-pk

## Overview

##### Project type and purpose
- This is a monorepo “LLM-Learn-PK”—a learning playground of independent AI/RAG/LLM experiments and mini-apps, including:
- Full-stack demos (e.g., resume-tailor, polygon-zone-app)
- Chainlit-based documentation agents (crewai, llama_index_doc_bot)
- Local-model demos (parking_analysis via Ollama, vision-parsing OCR)
- Data analysis scripts (csv_analyzer, customer_support)
- DSP/RAG/Quantization experiments
- Purpose: explore various LLM/RAG techniques, end-to-end pipelines, frontend/back-end integrations, and model/tooling experiments in one repo.

##### File structure
- Top-level folders each host a self-contained subproject.
- “resume-tailor”: React/Vite frontend + Flask backend + RAG (logs + vectorstore placeholder “rag”)
- “polygon-zone-app”: TypeScript/Vite frontend + Python WebSocket backend for video polygon drawing
- “Chainlit-apps”: Chainlit servers + vectorstore directories + crawler scripts
- “ollama/parking_analysis” & “vision-parsing”: Python test scripts + media assets + local LLM calls
- “DSP”, “Quantization”, “AIAgent-CrewAi”, “Agno-AI-Agents”: plain Python scripts and configs for experiments
- Configuration & build files present per subproject (requirements.txt, package.json, pyproject.toml, bolt config, Tailwind/Vite configs).

##### README for additional insights
- Highlights five featured demos with GIFs and links.
- No single unified architecture—each demo has its own stack and data flow.
- Underlying theme: LLM invocation (OpenAI, Ollama), RAG (Chroma vectorstore), retrieval pipelines, custom tools, web UIs or CLI scripts.

a. Main components (group by subproject category)
- Frontend UIs (React/Vite apps, Chainlit web UIs)
- Backend services (Flask apps, Python WebSocket servers, Chainlit agents)
- LLM services (OpenAI API, local Ollama endpoint)
- Vectorstores (Chroma directories under vectorstore/)
- Data sources (PDFs, CSVs, video streams)
- Custom tools & scripts (crew.py, crawler.py, DSP/Quantization modules)
b. Relationships & interactions
- Frontend → Backend over HTTP/WebSocket → triggers
- Backend → LLM Service calls → receives text/JSON
- Retrieval path: Backend → Vectorstore read/write → RAG loop → Backend
- Data ingest: Crawler/loader scripts → Local storage (assets/, data/) → Vectorstore
- Offline experiments: scripts reading CSV/PDF → produce reports
c. Architectural patterns & principles
- Separation of concerns: UI vs. API vs. data/model layer
- Plugin-style extensibility: custom tools directory under crew, custom_data_loader, quantization hooks
- RAG pipeline pattern: ingestion → embedding → storage → retrieve → LLM compose
- Event-driven Video processing: WebSocket feed → polygon drawing → result panel
d. Key technologies and frameworks
- Frontend: React, Vite, TypeScript, Tailwind
- Backend: Flask, Python WebSocket, Chainlit
- LLM: OpenAI API, Ollama local model
- Vectorstore: Chroma, pickle/JSON artifacts
- Utilities: PyProject/Tox for Python builds, bolt prompts, DSPy experiments

##### Essential architectural elements
- RAG pipeline’s stages explicitly (ingest → embed → store → retrieve → LLM).
- Integration points where experiments diverge (e.g., custom_tool vs. DSP modules).
- Every component’s responsibility is clear: who owns data, who calls whom, and where state is persisted.

## Diagram (Mermaid)

```mermaid
graph TB
  %% Full-stack Demos
  subgraph "Full-stack Demos"
    subgraph "Resume Tailor"
      RT_UI["Resume Tailor UI"]:::ui
      RT_BE["Resume Tailor Backend"]:::service
      RT_VS["Vectorstore (Chroma)"]:::storage
      RT_LLM["LLM Service (OpenAI)"]:::llm
    end
    subgraph "Polygon Zone App"
      PZ_UI["Polygon Zone UI"]:::ui
      PZ_BE["Polygon Zone Backend"]:::service
      PZ_WS["WebSocket Stream"]:::data
      PZ_LLM["LLM Service (OpenAI)"]:::llm
    end
  end

  %% Chainlit Apps
  subgraph "Chainlit Apps"
    subgraph "CrewAI Documentation Bot"
      CA_UI["Chainlit UI"]:::ui
      CA_BE["crewai-documentation-bot"]:::service
      CA_CR["Crawler"]:::service
      CA_VS["Vectorstore (Chroma)"]:::storage
      CA_LLM["LLM Service (OpenAI)"]:::llm
    end
    subgraph "Llama_Index Doc Bot"
      LI_UI["Chainlit UI"]:::ui
      LI_BE["llama_index-doc-bot"]:::service
      LI_CR["Crawler"]:::service
      LI_VS["Vectorstore (Chroma)"]:::storage
      LI_LLM["LLM Service (OpenAI)"]:::llm
    end
  end

  %% Local-model Demos
  subgraph "Local-model Demos"
    OP_ASSETS["Media Assets"]:::data
    OP["Parking Analysis"]:::service
    OP_LLM["Ollama LLM"]:::llm
    VP_ASSETS["Image Assets"]:::data
    VP["Vision Parsing OCR"]:::service
    VP_LLM["Ollama LLM"]:::llm
    parking_report["Parking_Report.md"]:::data
    vision_report["OCR Report"]:::data
  end

  %% Script Experiments
  subgraph "Script Experiments"
    CSV["CSV Analyzer"]:::service
    CSUP["Customer Support Analyzer"]:::service
    DSP["DSP Experiments"]:::service
    QNT["Quantization Experiments"]:::service
    AGCB["Blog Writing Crew"]:::service
    AGNO["Agno AI Agents"]:::service
    csv_data["CSV Data"]:::data
    csup_data["Support Logs"]:::data
    dsp_logs["DSP Logs"]:::data
    qnt_models["Quantized Models"]:::data
    crew_tools["Crew Tools"]:::data
    agno_logs["Agent Logs"]:::data
  end

  %% Connections - Full-stack
  RT_UI -->|"HTTP POST JSON"| RT_BE
  RT_BE -->|"RAG: query/embed"| RT_VS
  RT_BE -->|"OpenAI API"| RT_LLM

  PZ_UI -->|"HTTP/WS"| PZ_BE
  PZ_BE -->|"Stream"| PZ_WS
  PZ_BE -->|"OpenAI API"| PZ_LLM

  %% Connections - Chainlit
  CA_UI -->|"HTTP"| CA_BE
  CA_BE -->|"query"| CA_VS
  CA_BE -->|"OpenAI API"| CA_LLM
  CA_CR -->|"ingest"| CA_VS

  LI_UI -->|"HTTP"| LI_BE
  LI_BE -->|"query"| LI_VS
  LI_BE -->|"OpenAI API"| LI_LLM
  LI_CR -->|"ingest"| LI_VS

  %% Connections - Local-model
  OP_ASSETS -->|"input"| OP
  OP -->|"Ollama API"| OP_LLM
  OP -->|"generate report"| parking_report

  VP_ASSETS -->|"input"| VP
  VP -->|"Ollama API"| VP_LLM
  VP -->|"generate report"| vision_report

  %% Connections - Scripts
  CSV -->|"reads"| csv_data
  CSUP -->|"reads"| csup_data
  DSP -->|"produces"| dsp_logs
  QNT -->|"produces"| qnt_models
  AGCB -->|"uses"| crew_tools
  AGNO -->|"logs to"| agno_logs

  %% Click Events
  click RT_UI "https://github.com/pavankunchala/llm-learn-pk/tree/main/resume-tailor/frontend/"
  click RT_BE "https://github.com/pavankunchala/llm-learn-pk/tree/main/resume-tailor/backend/"
  click PZ_UI "https://github.com/pavankunchala/llm-learn-pk/tree/main/polygon-zone-app/project/"
  click PZ_BE "https://github.com/pavankunchala/llm-learn-pk/tree/main/polygon-zone-app/backend/"
  click CA_BE "https://github.com/pavankunchala/llm-learn-pk/tree/main/Chainlit-apps/crewai-documentation-bot/"
  click CA_CR "https://github.com/pavankunchala/llm-learn-pk/blob/main/Chainlit-apps/crewai-documentation-bot/crawler.py"
  click CA_VS "https://github.com/pavankunchala/llm-learn-pk/tree/main/Chainlit-apps/crewai-documentation-bot/vectorstore/"
  click LI_BE "https://github.com/pavankunchala/llm-learn-pk/tree/main/Chainlit-apps/llama_index_doc_bot/"
  click LI_CR "https://github.com/pavankunchala/llm-learn-pk/blob/main/Chainlit-apps/llama_index_doc_bot/crawler.py"
  click LI_VS "https://github.com/pavankunchala/llm-learn-pk/tree/main/Chainlit-apps/llama_index_doc_bot/vectorstore/"
  click OP "https://github.com/pavankunchala/llm-learn-pk/tree/main/ollama/parking_analysis/"
  click VP "https://github.com/pavankunchala/llm-learn-pk/tree/main/vision-parsing/"
  click CSV "https://github.com/pavankunchala/llm-learn-pk/tree/main/AIAgent-CrewAi/csv_analyzer/"
  click CSUP "https://github.com/pavankunchala/llm-learn-pk/tree/main/AIAgent-CrewAi/customer_support/"
  click DSP "https://github.com/pavankunchala/llm-learn-pk/tree/main/DSP/"
  click QNT "https://github.com/pavankunchala/llm-learn-pk/tree/main/Quantization/"
  click AGCB "https://github.com/pavankunchala/llm-learn-pk/tree/main/AIAgent-CrewAi/blog_writing_crew/"
  click AGNO "https://github.com/pavankunchala/llm-learn-pk/tree/main/Agno-AI-Agents/basic-testing/"

  %% Styles
  classDef ui fill:#D0E8FF,stroke:#0366D6
  classDef service fill:#DFF8E1,stroke:#028A0F
  classDef llm fill:#F4E1FF,stroke:#5D3FD3,shape:cloud
  classDef storage fill:#E1E7FF,stroke:#4C6EF5,shape:cylinder
  classDef data fill:#F0F0F0,stroke:#333
  class parking_report,vision_report,csv_data,csup_data,dsp_logs,qnt_models,crew_tools,agno_logs data
```
