# mr-kushwaha/lang_chain_project architecture

> Architecture diagram of the GitHub repository mr-kushwaha/lang_chain_project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mr-kushwaha/lang_chain_project
- Repository: https://github.com/mr-kushwaha/lang_chain_project

## Overview

This repository is a collection of LangChain learning demos, not a single deployed application. Its clearest runnable workflows are prompt-to-model generation, composition with chains/runnables, and model-response parsing; separate examples cover chat, embeddings, and structured output. The README describes a broader RAG workflow, but the tree and sampled code do not show a complete document-loading, vector-store, and retrieval application, so those stages are not drawn as implemented components. Some demo modules were not sampled, so their internal wiring is left unspecified.

Main entry points: [`EmbeddingModels/embedding_doc_similarity.py`](https://github.com/mr-kushwaha/lang_chain_project/blob/main/EmbeddingModels/embedding_doc_similarity.py) (Similarity demo), [`LangChainPrompt/prompt_ui.py`](https://github.com/mr-kushwaha/lang_chain_project/blob/main/LangChainPrompt/prompt_ui.py) (Prompt UI), [`Structured_Output/typeDict_structOp.py`](https://github.com/mr-kushwaha/lang_chain_project/blob/main/Structured_Output/typeDict_structOp.py) (Typed output), [`LLM_Runnables/Standard_LLm.py`](https://github.com/mr-kushwaha/lang_chain_project/blob/main/LLM_Runnables/Standard_LLm.py) (Runnable connector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prompt_chat["Prompts and chat"]
  node_prompt_ui["Prompt UI<br/>[prompt_ui.py]"]
  node_prompt_templates["Prompt demos"]
  node_chat_demos["Chat demos"]
  node_chat_history["Chat history<br/>[chat_history.txt]"]
end

subgraph group_models_embeddings["Models and embeddings"]
  node_model_adapters["Model adapters"]
  node_gemini_model["Gemini model"]
  node_embedding_adapters["Embedding adapters"]
  node_embedding_demo["Similarity demo"]
  node_embedding_model["HF embeddings<br/>[embedding_hf.py]"]
end

subgraph group_composition["Chains and runnables"]
  node_runnable_connector["Runnable connector<br/>[Standard_LLm.py]"]
  node_dummy_chain["Dummy LLM chain<br/>[dummyLLm.py]"]
  node_chain_demos["Chain demos"]
  node_runnable_demos["Runnable demos"]
end

subgraph group_structured_output["Structured output"]
  node_output_parsers["Output parsers"]
  node_typed_structured["Typed output"]
  node_structured_demos["Structured output demos"]
end

node_user(("User"))

node_user -->|"selects inputs"| node_prompt_ui
node_prompt_ui -->|"invokes chain"| node_gemini_model
node_prompt_ui -->|"loads template config"| node_prompt_templates
node_embedding_demo -->|"embeds documents"| node_embedding_model
node_embedding_demo -->|"embeds query"| node_embedding_model
node_embedding_demo -->|"ranks by similarity"| node_embedding_demo
node_runnable_connector -->|"invokes in sequence"| node_runnable_connector
node_dummy_chain -->|"formats then generates"| node_dummy_chain
node_chat_demos -.->|"loads prior messages"| node_chat_history
node_typed_structured -->|"requests typed output"| node_gemini_model
node_typed_structured -->|"invokes structured model"| node_typed_structured

click node_prompt_ui "https://github.com/mr-kushwaha/lang_chain_project/blob/main/LangChainPrompt/prompt_ui.py"
click node_prompt_templates "https://github.com/mr-kushwaha/lang_chain_project/tree/main/LangChainPrompt"
click node_chat_demos "https://github.com/mr-kushwaha/lang_chain_project/tree/main/LangChainPrompt"
click node_chat_history "https://github.com/mr-kushwaha/lang_chain_project/blob/main/LangChainPrompt/chat_history.txt"
click node_model_adapters "https://github.com/mr-kushwaha/lang_chain_project/tree/main/ChatModels"
click node_gemini_model "https://github.com/mr-kushwaha/lang_chain_project/blob/main/ChatModels/chatmodel_Gemini.py"
click node_embedding_adapters "https://github.com/mr-kushwaha/lang_chain_project/tree/main/EmbeddingModels"
click node_embedding_demo "https://github.com/mr-kushwaha/lang_chain_project/blob/main/EmbeddingModels/embedding_doc_similarity.py"
click node_embedding_model "https://github.com/mr-kushwaha/lang_chain_project/blob/main/EmbeddingModels/embedding_hf.py"
click node_runnable_connector "https://github.com/mr-kushwaha/lang_chain_project/blob/main/LLM_Runnables/Standard_LLm.py"
click node_dummy_chain "https://github.com/mr-kushwaha/lang_chain_project/blob/main/LLM_Runnables/dummyLLm.py"
click node_chain_demos "https://github.com/mr-kushwaha/lang_chain_project/tree/main/LangChain_Chains"
click node_runnable_demos "https://github.com/mr-kushwaha/lang_chain_project/tree/main/LangChain_Runnables"
click node_output_parsers "https://github.com/mr-kushwaha/lang_chain_project/tree/main/LangChain_OutputParser"
click node_typed_structured "https://github.com/mr-kushwaha/lang_chain_project/blob/main/Structured_Output/typeDict_structOp.py"
click node_structured_demos "https://github.com/mr-kushwaha/lang_chain_project/tree/main/Structured_Output"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_prompt_ui,node_prompt_templates,node_chat_demos,node_chat_history,node_user toneBlue
class node_model_adapters,node_gemini_model,node_embedding_adapters,node_embedding_demo,node_embedding_model toneAmber
class node_runnable_connector,node_dummy_chain,node_chain_demos,node_runnable_demos toneMint
class node_output_parsers,node_typed_structured,node_structured_demos toneRose
```

## Components

### Prompts and chat

- [Prompt UI](https://github.com/mr-kushwaha/lang_chain_project/blob/main/LangChainPrompt/prompt_ui.py): `LangChainPrompt/prompt_ui.py`
- [Prompt demos](https://github.com/mr-kushwaha/lang_chain_project/tree/main/LangChainPrompt): `LangChainPrompt`
- [Chat demos](https://github.com/mr-kushwaha/lang_chain_project/tree/main/LangChainPrompt): `LangChainPrompt`
- [Chat history](https://github.com/mr-kushwaha/lang_chain_project/blob/main/LangChainPrompt/chat_history.txt): `LangChainPrompt/chat_history.txt`

### Models and embeddings

- [Model adapters](https://github.com/mr-kushwaha/lang_chain_project/tree/main/ChatModels): `ChatModels`
- [Gemini model](https://github.com/mr-kushwaha/lang_chain_project/blob/main/ChatModels/chatmodel_Gemini.py): `ChatModels/chatmodel_Gemini.py`
- [Embedding adapters](https://github.com/mr-kushwaha/lang_chain_project/tree/main/EmbeddingModels): `EmbeddingModels`
- [Similarity demo](https://github.com/mr-kushwaha/lang_chain_project/blob/main/EmbeddingModels/embedding_doc_similarity.py): `EmbeddingModels/embedding_doc_similarity.py`
- [HF embeddings](https://github.com/mr-kushwaha/lang_chain_project/blob/main/EmbeddingModels/embedding_hf.py): `EmbeddingModels/embedding_hf.py`

### Chains and runnables

- [Runnable connector](https://github.com/mr-kushwaha/lang_chain_project/blob/main/LLM_Runnables/Standard_LLm.py): `LLM_Runnables/Standard_LLm.py`
- [Dummy LLM chain](https://github.com/mr-kushwaha/lang_chain_project/blob/main/LLM_Runnables/dummyLLm.py): `LLM_Runnables/dummyLLm.py`
- [Chain demos](https://github.com/mr-kushwaha/lang_chain_project/tree/main/LangChain_Chains): `LangChain_Chains`
- [Runnable demos](https://github.com/mr-kushwaha/lang_chain_project/tree/main/LangChain_Runnables): `LangChain_Runnables`

### Structured output

- [Output parsers](https://github.com/mr-kushwaha/lang_chain_project/tree/main/LangChain_OutputParser): `LangChain_OutputParser`
- [Typed output](https://github.com/mr-kushwaha/lang_chain_project/blob/main/Structured_Output/typeDict_structOp.py): `Structured_Output/typeDict_structOp.py`
- [Structured output demos](https://github.com/mr-kushwaha/lang_chain_project/tree/main/Structured_Output): `Structured_Output`

### Other components

- **User**

## Connections

- User → Prompt UI: selects inputs (evidence: `LangChainPrompt/prompt_ui.py`)
- Prompt UI → Gemini model: invokes chain (evidence: `LangChainPrompt/prompt_ui.py`)
- Prompt UI → Prompt demos: loads template config (evidence: `LangChainPrompt/prompt_ui.py`)
- Similarity demo → HF embeddings: embeds documents (evidence: `EmbeddingModels/embedding_doc_similarity.py`)
- Similarity demo → HF embeddings: embeds query (evidence: `EmbeddingModels/embedding_doc_similarity.py`)
- Similarity demo → Similarity demo: ranks by similarity (evidence: `EmbeddingModels/embedding_doc_similarity.py`)
- Runnable connector → Runnable connector: invokes in sequence (evidence: `LLM_Runnables/Standard_LLm.py`)
- Dummy LLM chain → Dummy LLM chain: formats then generates (evidence: `LLM_Runnables/dummyLLm.py`)
- Chat demos → Chat history: loads prior messages
- Typed output → Gemini model: requests typed output (evidence: `Structured_Output/typeDict_structOp.py`)
- Typed output → Typed output: invokes structured model (evidence: `Structured_Output/typeDict_structOp.py`)
