# kanthetimanojsanjay/langchaindemo architecture

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

- Interactive diagram: https://gitdiagram.com/kanthetimanojsanjay/langchaindemo
- Repository: https://github.com/kanthetimanojsanjay/langchaindemo

## Overview

This repository is a collection of standalone LangChain/Streamlit learning demos, not one integrated application. Users try chat, prompt, chain, history, retrieval, embedding, agent, and image-analysis workflows in separate scripts. The sampled sources show several concrete prompt-to-model, retrieval, and history flows; the empty README and unsampled scripts limit evidence for other internal relationships, so those are represented as independent capabilities rather than connected pipelines.

Main entry points: [`chathistory/streamlit_chathistory_demo.py`](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/chathistory/streamlit_chathistory_demo.py) (Agile Guide), [`basics/streamlit_cloud_demo.py`](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/basics/streamlit_cloud_demo.py) (Cloud Key Chat), [`prompttemplates/prompttemplate_demo.py`](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/prompttemplates/prompttemplate_demo.py) (Cuisine Prompt), [`chains/multiple_llms_demo.py`](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/chains/multiple_llms_demo.py) (Speech Generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_basic["Basic Chat"]
  node_basic_openai["OpenAI Demo<br/>[openai_demo.py]"]
  node_basic_deepseek["DeepSeek Demo<br/>[deepseek_demo.py]"]
  node_basic_gemma["Gemma Demo<br/>[gemma_demo.py]"]
  node_basic_streamlit["Streamlit Chat<br/>[streamlit_demo.py]"]
  node_basic_cloud["Cloud Key Chat"]
end

subgraph group_chains["Prompt And Chains"]
  node_prompt_demo["Cuisine Prompt"]
  node_travelguide["Travel Guide"]
  node_lcel["LCEL Demo<br/>[lcel_demo.py]"]
  node_multiple_llms["Speech Generator"]
  node_sequential["Sequential Chain"]
  node_simple_sequential["Simple Sequential"]
end

subgraph group_history["Chat History"]
  node_chat_history["History Demo"]
  node_chat_prompt["History Prompt"]
  node_streamlit_history["Agile Guide"]
  node_message_history[("Session History")]
end

subgraph group_retrieval["Retrieval And Embeddings"]
  node_text_rag["Text RAG<br/>[rag_demo.py]"]
  node_pdf_rag["PDF RAG<br/>[pdf_rag_demo.py]"]
  node_history_rag["History-Aware RAG"]
  node_deepseek_rag["DeepSeek RAG"]
  node_ollama_rag["Ollama RAG<br/>[ollama_rag_demo.py]"]
  node_embeddings["Embedding Demos<br/>[embeddings_demo.py]"]
  node_ollama_embeddings["Ollama Embeddings"]
  node_job_search["Job Search"]
  node_job_search_ollama["Ollama Job Search"]
  node_similarity["Similarity Finder"]
end

subgraph group_multimodal["Agents And Images"]
  node_agent_demo["Agent Demo<br/>[agent_demo.py]"]
  node_landmark["Landmark Helper<br/>[landmark_helper.py]"]
  node_landmark_ollama["Ollama Landmark"]
  node_image_demo["Image Demo<br/>[images_demo.py]"]
end

node_user(("User"))
node_openai_chat["OpenAI Chat"]
node_ollama_chat["Ollama Chat"]
node_deepseek["DeepSeek Chat"]
node_gemma["Gemma Chat"]

node_user -->|"asks"| node_basic_cloud
node_basic_cloud -->|"invokes"| node_openai_chat
node_user -->|"enters cuisine"| node_prompt_demo
node_prompt_demo -->|"invokes"| node_ollama_chat
node_user -->|"enters topic"| node_multiple_llms
node_multiple_llms -->|"runs chain"| node_ollama_chat
node_user -->|"asks"| node_streamlit_history
node_streamlit_history -->|"invokes"| node_ollama_chat
node_streamlit_history -->|"reads and writes"| node_message_history
node_user -->|"asks"| node_text_rag
node_text_rag -.->|"uses model"| node_ollama_chat
node_user -->|"asks"| node_history_rag
node_history_rag -->|"stores turns"| node_message_history
node_user -->|"searches"| node_job_search
node_job_search -->|"embeds query"| node_openai_chat
node_user -->|"uploads and asks"| node_landmark
node_landmark -->|"identifies image"| node_openai_chat
node_user -.->|"provides image"| node_image_demo

click node_basic_openai "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/basics/openai_demo.py"
click node_basic_deepseek "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/basics/deepseek_demo.py"
click node_basic_gemma "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/basics/gemma_demo.py"
click node_basic_streamlit "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/basics/streamlit_demo.py"
click node_basic_cloud "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/basics/streamlit_cloud_demo.py"
click node_prompt_demo "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/prompttemplates/prompttemplate_demo.py"
click node_travelguide "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/prompttemplates/travelguide_demo.py"
click node_lcel "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/chains/lcel_demo.py"
click node_multiple_llms "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/chains/multiple_llms_demo.py"
click node_sequential "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/chains/sequential_chain_demo.py"
click node_simple_sequential "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/chains/simple_sequential_chain_demo.py"
click node_chat_history "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/chathistory/chathistory_demo.py"
click node_chat_prompt "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/chathistory/chatprompttemplate_demo.py"
click node_streamlit_history "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/chathistory/streamlit_chathistory_demo.py"
click node_message_history "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/chathistory/streamlit_chathistory_demo.py"
click node_text_rag "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/rag/rag_demo.py"
click node_pdf_rag "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/rag/pdf_rag_demo.py"
click node_history_rag "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/rag/historyaware_rag_demo.py"
click node_deepseek_rag "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/rag/deepseek_rag_demo.py"
click node_ollama_rag "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/rag/ollama_rag_demo.py"
click node_embeddings "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/embeddings/embeddings_demo.py"
click node_ollama_embeddings "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/embeddings/embeddings_ollama_demo.py"
click node_job_search "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/embeddings/job_search_helper_demo.py"
click node_job_search_ollama "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/embeddings/job_search_helper_ollama_demo.py"
click node_similarity "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/embeddings/similarity_finder_demo.py"
click node_agent_demo "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/agents/agent_demo.py"
click node_landmark "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/agents/landmark_helper.py"
click node_landmark_ollama "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/agents/landmark_helper_ollama.py"
click node_image_demo "https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/imageprocessing/images_demo.py"

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_basic_openai,node_basic_deepseek,node_basic_gemma,node_basic_streamlit,node_basic_cloud,node_user toneBlue
class node_prompt_demo,node_travelguide,node_lcel,node_multiple_llms,node_sequential,node_simple_sequential toneAmber
class node_chat_history,node_chat_prompt,node_streamlit_history,node_message_history toneMint
class node_text_rag,node_pdf_rag,node_history_rag,node_deepseek_rag,node_ollama_rag,node_embeddings,node_ollama_embeddings,node_job_search,node_job_search_ollama,node_similarity toneRose
class node_agent_demo,node_landmark,node_landmark_ollama,node_image_demo,node_openai_chat,node_ollama_chat,node_deepseek,node_gemma toneIndigo
```

## Components

### Basic Chat

- [OpenAI Demo](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/basics/openai_demo.py): `basics/openai_demo.py`
- [DeepSeek Demo](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/basics/deepseek_demo.py): `basics/deepseek_demo.py`
- [Gemma Demo](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/basics/gemma_demo.py): `basics/gemma_demo.py`
- [Streamlit Chat](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/basics/streamlit_demo.py): `basics/streamlit_demo.py`
- [Cloud Key Chat](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/basics/streamlit_cloud_demo.py): `basics/streamlit_cloud_demo.py`

### Prompt And Chains

- [Cuisine Prompt](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/prompttemplates/prompttemplate_demo.py): `prompttemplates/prompttemplate_demo.py`
- [Travel Guide](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/prompttemplates/travelguide_demo.py): `prompttemplates/travelguide_demo.py`
- [LCEL Demo](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/chains/lcel_demo.py): `chains/lcel_demo.py`
- [Speech Generator](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/chains/multiple_llms_demo.py): `chains/multiple_llms_demo.py`
- [Sequential Chain](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/chains/sequential_chain_demo.py): `chains/sequential_chain_demo.py`
- [Simple Sequential](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/chains/simple_sequential_chain_demo.py): `chains/simple_sequential_chain_demo.py`

### Chat History

- [History Demo](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/chathistory/chathistory_demo.py): `chathistory/chathistory_demo.py`
- [History Prompt](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/chathistory/chatprompttemplate_demo.py): `chathistory/chatprompttemplate_demo.py`
- [Agile Guide](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/chathistory/streamlit_chathistory_demo.py): `chathistory/streamlit_chathistory_demo.py`
- [Session History](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/chathistory/streamlit_chathistory_demo.py): `chathistory/streamlit_chathistory_demo.py`

### Retrieval And Embeddings

- [Text RAG](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/rag/rag_demo.py): `rag/rag_demo.py`
- [PDF RAG](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/rag/pdf_rag_demo.py): `rag/pdf_rag_demo.py`
- [History-Aware RAG](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/rag/historyaware_rag_demo.py): `rag/historyaware_rag_demo.py`
- [DeepSeek RAG](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/rag/deepseek_rag_demo.py): `rag/deepseek_rag_demo.py`
- [Ollama RAG](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/rag/ollama_rag_demo.py): `rag/ollama_rag_demo.py`
- [Embedding Demos](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/embeddings/embeddings_demo.py): `embeddings/embeddings_demo.py`
- [Ollama Embeddings](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/embeddings/embeddings_ollama_demo.py): `embeddings/embeddings_ollama_demo.py`
- [Job Search](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/embeddings/job_search_helper_demo.py): `embeddings/job_search_helper_demo.py`
- [Ollama Job Search](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/embeddings/job_search_helper_ollama_demo.py): `embeddings/job_search_helper_ollama_demo.py`
- [Similarity Finder](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/embeddings/similarity_finder_demo.py): `embeddings/similarity_finder_demo.py`

### Agents And Images

- [Agent Demo](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/agents/agent_demo.py): `agents/agent_demo.py`
- [Landmark Helper](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/agents/landmark_helper.py): `agents/landmark_helper.py`
- [Ollama Landmark](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/agents/landmark_helper_ollama.py): `agents/landmark_helper_ollama.py`
- [Image Demo](https://github.com/kanthetimanojsanjay/langchaindemo/blob/main/imageprocessing/images_demo.py): `imageprocessing/images_demo.py`

### Other components

- **User**
- **OpenAI Chat**
- **Ollama Chat**
- **DeepSeek Chat**
- **Gemma Chat**

## Connections

- User → Cloud Key Chat: asks (evidence: `basics/streamlit_cloud_demo.py`)
- Cloud Key Chat → OpenAI Chat: invokes (evidence: `basics/streamlit_cloud_demo.py`)
- User → Cuisine Prompt: enters cuisine (evidence: `prompttemplates/prompttemplate_demo.py`)
- Cuisine Prompt → Ollama Chat: invokes (evidence: `prompttemplates/prompttemplate_demo.py`)
- User → Speech Generator: enters topic (evidence: `chains/multiple_llms_demo.py`)
- Speech Generator → Ollama Chat: runs chain (evidence: `chains/multiple_llms_demo.py`)
- User → Agile Guide: asks (evidence: `chathistory/streamlit_chathistory_demo.py`)
- Agile Guide → Ollama Chat: invokes (evidence: `chathistory/streamlit_chathistory_demo.py`)
- Agile Guide → Session History: reads and writes (evidence: `chathistory/streamlit_chathistory_demo.py`)
- User → Text RAG: asks (evidence: `rag/rag_demo.py`)
- Text RAG → Ollama Chat: uses model
- User → History-Aware RAG: asks (evidence: `rag/historyaware_rag_demo.py`)
- History-Aware RAG → Session History: stores turns (evidence: `rag/historyaware_rag_demo.py`)
- User → Job Search: searches (evidence: `embeddings/job_search_helper_demo.py`)
- Job Search → OpenAI Chat: embeds query (evidence: `embeddings/job_search_helper_demo.py`)
- User → Landmark Helper: uploads and asks (evidence: `agents/landmark_helper.py`)
- Landmark Helper → OpenAI Chat: identifies image (evidence: `agents/landmark_helper.py`)
- User → Image Demo: provides image
