# manthanguptaa/real-world-llm-apps architecture

> Architecture diagram of the GitHub repository manthanguptaa/real-world-llm-apps, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manthanguptaa/real-world-llm-apps
- Repository: https://github.com/manthanguptaa/real-world-llm-apps

## Overview

##### Project Type and Purpose
- This repository is a collection of real-world applications that use Large Language Models (LLMs) for diverse purposes (e.g., document retrieval in the RAG application, browser-based interactions, health advice, recruitment, and evaluation tasks).
- Each application (folder) is self-contained with its own set of configuration files, requirements, and documentation. This signals a modular multi-application design where each module demonstrates a different use case of LLMs.

##### Analyzing the File Structure
- Top-level directories represent individual applications (e.g., ai_basic_rag, ai_browser_agent, ai_health_advisor_agent, ai_recruiter, evals), each with their own README, agent logic, configuration (.env.example), and requirements.
- Common patterns include:
- An "agents.py" file in most folders that encapsulate the core interaction logic with the LLM.
- "app.py" or "cli.py" that serve as entry points for running the application.
- Project-specific files (e.g., "vector_store.py" in ai_basic_rag and "browser_actions.py" in ai_browser_agent) that indicate specialized functionality.
- The existence of configuration files and environment examples indicates each component or application is designed to run as a service or standalone module, likely interfacing with external LLM APIs.

##### Insights from the README
- The README provides an overview of each application, emphasizing production-ready code and diverse use cases ranging from healthcare to recruitment.

a. Main Components to Include:
- Individual LLM Applications: Each folder (ai_basic_rag, ai_browser_agent, ai_health_advisor_agent, ai_recruiter, evals) should be represented as a distinct module.
- Core Components within Each Application:
- Agent Module: Represented by the "agents.py" files, these handle LLM interactions.
- Application Interface: The "app.py" (or "cli.py" for command-line apps) showing the entry points.
- Specialized Functionality: For example, the vector store in ai_basic_rag or browser actions in ai_browser_agent.
- Configuration and Environment Management: Indicate the use of ".env.example" files and requirements files, suggesting standardized dependencies and configuration management.
- External Services: Optionally, include a component (or cloud symbol) that represents the external LLM API service(s) that every module likely taps into.

b. Relationships and Interactions:
- From the user interface (CLI/streamlit apps) to the respective agent modules.
- From agent modules to the external LLM/API service components.
- Interactions among configured components; for instance, evaluation results in the “evals” folder might be triggered by outputs from other modules.

c. Architectural Patterns / Design Principles:
- Modularity: Separate modules for each application illustrate a plugin-like architecture.
- Separation of Concerns: Presentation (app/cli), business/logic (agents), and storage/specialized functionality (vector_store, browser_actions).
- Configurability: Use of environment files (.env.example) and modular configuration files (config.py) highlight the importance of parameterization and dependency management.

d. Relevant Technologies:
- Python is the underlying language.
- Streamlit may be involved in the UI part of some applications (e.g., ai_recruiter with its .streamlit folder).
- External APIs for LLM interactions should be illustrated to show integration points.
- Additional libraries as specified in requirements.txt should be noted if they play a role (e.g., those needed for making HTTP requests or for data storage).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% AI Basic RAG Module
    subgraph "AI Basic RAG"
        basic_app["AI Basic Rag - App"]:::ui
        basic_agents["AI Basic Rag - Agents"]:::agents
        basic_vector["AI Basic Rag - Vector Store"]:::specialized
        basic_config["AI Basic Rag - Config"]:::config
        basic_app --> basic_agents
        basic_agents --> basic_vector
        basic_agents --> external_llm["LLM Provider/API"]:::external
        basic_agents --> eval_script["Evaluation Module - Eval Script"]:::eval
    end

    %% AI Browser Agent Module
    subgraph "AI Browser Agent"
        browser_cli["AI Browser Agent - CLI"]:::ui
        browser_agents["AI Browser Agent - Agents"]:::agents
        browser_actions["AI Browser Agent - Browser Actions"]:::specialized
        browser_config["AI Browser Agent - Config"]:::config
        browser_cli --> browser_agents
        browser_agents --> browser_actions
        browser_agents --> external_llm
        browser_agents --> eval_script
    end

    %% AI Health Advisor Module
    subgraph "AI Health Advisor"
        health_app["AI Health Advisor - App"]:::ui
        health_agents["AI Health Advisor - Agents"]:::agents
        health_config["AI Health Advisor - Config"]:::config
        health_app --> health_agents
        health_agents --> external_llm
        health_agents --> eval_script
    end

    %% AI Recruiter Module
    subgraph "AI Recruiter"
        recruiter_app["AI Recruiter - App"]:::ui
        recruiter_agents["AI Recruiter - Agents"]:::agents
        recruiter_streamlit["AI Recruiter - Streamlit Config"]:::config
        recruiter_config["AI Recruiter - Config"]:::config
        recruiter_app --> recruiter_agents
        recruiter_agents --> external_llm
        recruiter_agents --> eval_script
    end

    %% Evaluation Module
    subgraph "Evaluation Module"
        eval_script["Evaluation Module - Eval Script"]:::eval
        eval_example["Evaluation Module - Example"]:::eval
        eval_results["Evaluation Module - Results Storage"]:::eval
        eval_config["Evaluation Module - Config"]:::config
        eval_script --> eval_example
        eval_example --> eval_results
        eval_results --> eval_config
    end

    %% Click Events for AI Basic RAG
    click basic_app "https://github.com/manthanguptaa/real-world-llm-apps/blob/main/ai_basic_rag/app.py"
    click basic_agents "https://github.com/manthanguptaa/real-world-llm-apps/blob/main/ai_basic_rag/agents.py"
    click basic_vector "https://github.com/manthanguptaa/real-world-llm-apps/blob/main/ai_basic_rag/vector_store.py"
    click basic_config "https://github.com/manthanguptaa/real-world-llm-apps/blob/main/ai_basic_rag/.env.example"

    %% Click Events for AI Browser Agent
    click browser_cli "https://github.com/manthanguptaa/real-world-llm-apps/blob/main/ai_browser_agent/cli.py"
    click browser_agents "https://github.com/manthanguptaa/real-world-llm-apps/blob/main/ai_browser_agent/agents.py"
    click browser_actions "https://github.com/manthanguptaa/real-world-llm-apps/blob/main/ai_browser_agent/browser_actions.py"
    click browser_config "https://github.com/manthanguptaa/real-world-llm-apps/blob/main/ai_browser_agent/config.py"

    %% Click Events for AI Health Advisor
    click health_app "https://github.com/manthanguptaa/real-world-llm-apps/blob/main/ai_health_advisor_agent/app.py"
    click health_agents "https://github.com/manthanguptaa/real-world-llm-apps/blob/main/ai_health_advisor_agent/agents.py"
    click health_config "https://github.com/manthanguptaa/real-world-llm-apps/blob/main/ai_health_advisor_agent/.env.example"

    %% Click Events for AI Recruiter
    click recruiter_app "https://github.com/manthanguptaa/real-world-llm-apps/blob/main/ai_recruiter/app.py"
    click recruiter_agents "https://github.com/manthanguptaa/real-world-llm-apps/blob/main/ai_recruiter/agents.py"
    click recruiter_streamlit "https://github.com/manthanguptaa/real-world-llm-apps/blob/main/ai_recruiter/.streamlit"
    click recruiter_config "https://github.com/manthanguptaa/real-world-llm-apps/blob/main/ai_recruiter/.env.example"

    %% Click Events for Evaluation Module
    click eval_script "https://github.com/manthanguptaa/real-world-llm-apps/blob/main/evals/evals.py"
    click eval_example "https://github.com/manthanguptaa/real-world-llm-apps/blob/main/evals/example.py"
    click eval_results "https://github.com/manthanguptaa/real-world-llm-apps/tree/main/evals/results"
    click eval_config "https://github.com/manthanguptaa/real-world-llm-apps/blob/main/evals/.env.example"

    %% Styles
    classDef ui fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef agents fill:#d4edda,stroke:#333,stroke-width:2px;
    classDef specialized fill:#f8d7da,stroke:#333,stroke-width:2px;
    classDef config fill:#fff3cd,stroke:#333,stroke-width:2px;
    classDef external fill:#d1ecf1,stroke:#333,stroke-width:2px;
    classDef eval fill:#e2e3e5,stroke:#333,stroke-width:2px;
```
