# krishnaik06/updated-langchain architecture

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

- Interactive diagram: https://gitdiagram.com/krishnaik06/updated-langchain
- Repository: https://github.com/krishnaik06/updated-langchain

## Overview

This repository is a collection of LangChain demos: interactive chat, document-question-answering apps, and a small HTTP API with a Streamlit client. The main document workflow loads web or PDF material, splits it into chunks, creates embeddings and a vector store, retrieves relevant context, and generates an answer. The graph separates the demos because the sampled code does not show them sharing runtime components. README documentation is minimal; unsampled notebooks and integrations are not expanded beyond what the tree supports.

Main entry points: [`objectbox/app.py`](https://github.com/krishnaik06/updated-langchain/blob/main/objectbox/app.py) (ObjectBox RAG), [`groq/app.py`](https://github.com/krishnaik06/updated-langchain/blob/main/groq/app.py) (Web RAG demo), [`groq/llama3.py`](https://github.com/krishnaik06/updated-langchain/blob/main/groq/llama3.py) (PDF RAG demo), [`api/app.py`](https://github.com/krishnaik06/updated-langchain/blob/main/api/app.py) (LangServe API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_chat["Chat demos"]
  node_chat_openai["OpenAI chat<br/>[app.py]"]
  node_chat_ollama["Ollama chat<br/>[localama.py]"]
end

subgraph group_rag["Document Q&amp;A"]
  node_web_rag["Web RAG demo<br/>[app.py]"]
  node_pdf_rag["PDF RAG demo<br/>[llama3.py]"]
  node_objectbox_rag["ObjectBox RAG<br/>[app.py]"]
  node_web_loader["Web loader<br/>[app.py]"]
  node_pdf_loader["PDF loader<br/>[llama3.py]"]
  node_objectbox_loader["PDF loader<br/>[app.py]"]
  node_web_splitter["Chunk splitter<br/>[app.py]"]
  node_pdf_splitter["Chunk splitter<br/>[llama3.py]"]
  node_objectbox_splitter["Chunk splitter<br/>[app.py]"]
  node_web_store[("FAISS store<br/>[app.py]")]
  node_pdf_store[("FAISS store<br/>[llama3.py]")]
  node_objectbox_store[("ObjectBox store<br/>[app.py]")]
  node_web_retrieval["Retrieval chain<br/>[app.py]"]
  node_pdf_retrieval["Retrieval chain<br/>[llama3.py]"]
  node_objectbox_retrieval["Retrieval chain<br/>[app.py]"]
end

subgraph group_api["HTTP API"]
  node_api_client["Streamlit client<br/>[client.py]"]
  node_api_server["LangServe API<br/>[app.py]"]
end

subgraph group_services["External services"]
  node_openai["OpenAI"]
  node_ollama["Ollama"]
  node_groq_service["Groq models"]
end

node_user(("User"))
node_web_docs["LangSmith docs"]
node_census_docs["Census PDFs"]

node_user -->|"asks"| node_chat_openai
node_user -->|"asks"| node_chat_ollama
node_user -->|"asks"| node_web_rag
node_user -->|"asks"| node_pdf_rag
node_user -->|"asks"| node_objectbox_rag
node_user -->|"enters prompts"| node_api_client
node_chat_openai -->|"invokes model"| node_openai
node_chat_ollama -->|"invokes model"| node_ollama
node_web_rag -->|"loads pages"| node_web_loader
node_web_docs -->|"provides pages"| node_web_loader
node_web_rag -->|"splits documents"| node_web_splitter
node_web_rag -->|"embeds and stores"| node_web_store
node_web_rag -->|"builds and invokes"| node_web_retrieval
node_web_retrieval -->|"retrieves context"| node_web_store
node_web_rag -->|"generates answer"| node_groq_service
node_pdf_rag -->|"loads PDFs"| node_pdf_loader
node_census_docs -->|"provides PDFs"| node_pdf_loader
node_pdf_rag -->|"splits documents"| node_pdf_splitter
node_pdf_rag -->|"embeds and stores"| node_pdf_store
node_pdf_rag -->|"builds and invokes"| node_pdf_retrieval
node_pdf_retrieval -->|"retrieves context"| node_pdf_store
node_pdf_rag -->|"generates answer"| node_groq_service
node_objectbox_rag -->|"loads PDFs"| node_objectbox_loader
node_census_docs -->|"provides PDFs"| node_objectbox_loader
node_objectbox_rag -->|"splits documents"| node_objectbox_splitter
node_objectbox_rag -->|"embeds and stores"| node_objectbox_store
node_objectbox_rag -->|"builds and invokes"| node_objectbox_retrieval
node_objectbox_retrieval -->|"retrieves context"| node_objectbox_store
node_objectbox_rag -->|"generates answer"| node_groq_service
node_objectbox_rag -->|"creates embeddings"| node_openai
node_api_client -->|"posts prompts"| node_api_server
node_api_server -->|"routes requests"| node_openai
node_api_server -->|"routes poems"| node_ollama

click node_chat_openai "https://github.com/krishnaik06/updated-langchain/blob/main/chatbot/app.py"
click node_chat_ollama "https://github.com/krishnaik06/updated-langchain/blob/main/chatbot/localama.py"
click node_web_rag "https://github.com/krishnaik06/updated-langchain/blob/main/groq/app.py"
click node_pdf_rag "https://github.com/krishnaik06/updated-langchain/blob/main/groq/llama3.py"
click node_objectbox_rag "https://github.com/krishnaik06/updated-langchain/blob/main/objectbox/app.py"
click node_web_loader "https://github.com/krishnaik06/updated-langchain/blob/main/groq/app.py"
click node_pdf_loader "https://github.com/krishnaik06/updated-langchain/blob/main/groq/llama3.py"
click node_objectbox_loader "https://github.com/krishnaik06/updated-langchain/blob/main/objectbox/app.py"
click node_web_splitter "https://github.com/krishnaik06/updated-langchain/blob/main/groq/app.py"
click node_pdf_splitter "https://github.com/krishnaik06/updated-langchain/blob/main/groq/llama3.py"
click node_objectbox_splitter "https://github.com/krishnaik06/updated-langchain/blob/main/objectbox/app.py"
click node_web_store "https://github.com/krishnaik06/updated-langchain/blob/main/groq/app.py"
click node_pdf_store "https://github.com/krishnaik06/updated-langchain/blob/main/groq/llama3.py"
click node_objectbox_store "https://github.com/krishnaik06/updated-langchain/blob/main/objectbox/app.py"
click node_web_retrieval "https://github.com/krishnaik06/updated-langchain/blob/main/groq/app.py"
click node_pdf_retrieval "https://github.com/krishnaik06/updated-langchain/blob/main/groq/llama3.py"
click node_objectbox_retrieval "https://github.com/krishnaik06/updated-langchain/blob/main/objectbox/app.py"
click node_api_client "https://github.com/krishnaik06/updated-langchain/blob/main/api/client.py"
click node_api_server "https://github.com/krishnaik06/updated-langchain/blob/main/api/app.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_chat_openai,node_chat_ollama,node_user toneBlue
class node_web_rag,node_pdf_rag,node_objectbox_rag,node_web_loader,node_pdf_loader,node_objectbox_loader,node_web_splitter,node_pdf_splitter,node_objectbox_splitter,node_web_store,node_pdf_store,node_objectbox_store,node_web_retrieval,node_pdf_retrieval,node_objectbox_retrieval toneAmber
class node_api_client,node_api_server toneMint
class node_openai,node_ollama,node_groq_service toneRose
class node_web_docs,node_census_docs toneIndigo
```

## Components

### Chat demos

- [OpenAI chat](https://github.com/krishnaik06/updated-langchain/blob/main/chatbot/app.py): `chatbot/app.py`
- [Ollama chat](https://github.com/krishnaik06/updated-langchain/blob/main/chatbot/localama.py): `chatbot/localama.py`

### Document Q&A

- [Web RAG demo](https://github.com/krishnaik06/updated-langchain/blob/main/groq/app.py): `groq/app.py`
- [PDF RAG demo](https://github.com/krishnaik06/updated-langchain/blob/main/groq/llama3.py): `groq/llama3.py`
- [ObjectBox RAG](https://github.com/krishnaik06/updated-langchain/blob/main/objectbox/app.py): `objectbox/app.py`
- [Web loader](https://github.com/krishnaik06/updated-langchain/blob/main/groq/app.py): `groq/app.py`
- [PDF loader](https://github.com/krishnaik06/updated-langchain/blob/main/groq/llama3.py): `groq/llama3.py`
- [PDF loader](https://github.com/krishnaik06/updated-langchain/blob/main/objectbox/app.py): `objectbox/app.py`
- [Chunk splitter](https://github.com/krishnaik06/updated-langchain/blob/main/groq/app.py): `groq/app.py`
- [Chunk splitter](https://github.com/krishnaik06/updated-langchain/blob/main/groq/llama3.py): `groq/llama3.py`
- [Chunk splitter](https://github.com/krishnaik06/updated-langchain/blob/main/objectbox/app.py): `objectbox/app.py`
- [FAISS store](https://github.com/krishnaik06/updated-langchain/blob/main/groq/app.py): `groq/app.py`
- [FAISS store](https://github.com/krishnaik06/updated-langchain/blob/main/groq/llama3.py): `groq/llama3.py`
- [ObjectBox store](https://github.com/krishnaik06/updated-langchain/blob/main/objectbox/app.py): `objectbox/app.py`
- [Retrieval chain](https://github.com/krishnaik06/updated-langchain/blob/main/groq/app.py): `groq/app.py`
- [Retrieval chain](https://github.com/krishnaik06/updated-langchain/blob/main/groq/llama3.py): `groq/llama3.py`
- [Retrieval chain](https://github.com/krishnaik06/updated-langchain/blob/main/objectbox/app.py): `objectbox/app.py`

### HTTP API

- [Streamlit client](https://github.com/krishnaik06/updated-langchain/blob/main/api/client.py): `api/client.py`
- [LangServe API](https://github.com/krishnaik06/updated-langchain/blob/main/api/app.py): `api/app.py`

### External services

- **OpenAI**
- **Ollama**
- **Groq models**

### Other components

- **User**
- **LangSmith docs**
- **Census PDFs**

## Connections

- User → OpenAI chat: asks (evidence: `chatbot/app.py`)
- User → Ollama chat: asks (evidence: `chatbot/localama.py`)
- User → Web RAG demo: asks (evidence: `groq/app.py`)
- User → PDF RAG demo: asks (evidence: `groq/llama3.py`)
- User → ObjectBox RAG: asks (evidence: `objectbox/app.py`)
- User → Streamlit client: enters prompts (evidence: `api/client.py`)
- OpenAI chat → OpenAI: invokes model (evidence: `chatbot/app.py`)
- Ollama chat → Ollama: invokes model (evidence: `chatbot/localama.py`)
- Web RAG demo → Web loader: loads pages (evidence: `groq/app.py`)
- LangSmith docs → Web loader: provides pages (evidence: `groq/app.py`)
- Web RAG demo → Chunk splitter: splits documents (evidence: `groq/app.py`)
- Web RAG demo → FAISS store: embeds and stores (evidence: `groq/app.py`)
- Web RAG demo → Retrieval chain: builds and invokes (evidence: `groq/app.py`)
- Retrieval chain → FAISS store: retrieves context (evidence: `groq/app.py`)
- Web RAG demo → Groq models: generates answer (evidence: `groq/app.py`)
- PDF RAG demo → PDF loader: loads PDFs (evidence: `groq/llama3.py`)
- Census PDFs → PDF loader: provides PDFs (evidence: `groq/llama3.py`)
- PDF RAG demo → Chunk splitter: splits documents (evidence: `groq/llama3.py`)
- PDF RAG demo → FAISS store: embeds and stores (evidence: `groq/llama3.py`)
- PDF RAG demo → Retrieval chain: builds and invokes (evidence: `groq/llama3.py`)
- Retrieval chain → FAISS store: retrieves context (evidence: `groq/llama3.py`)
- PDF RAG demo → Groq models: generates answer (evidence: `groq/llama3.py`)
- ObjectBox RAG → PDF loader: loads PDFs (evidence: `objectbox/app.py`)
- Census PDFs → PDF loader: provides PDFs (evidence: `objectbox/app.py`)
- ObjectBox RAG → Chunk splitter: splits documents (evidence: `objectbox/app.py`)
- ObjectBox RAG → ObjectBox store: embeds and stores (evidence: `objectbox/app.py`)
- ObjectBox RAG → Retrieval chain: builds and invokes (evidence: `objectbox/app.py`)
- Retrieval chain → ObjectBox store: retrieves context (evidence: `objectbox/app.py`)
- ObjectBox RAG → Groq models: generates answer (evidence: `objectbox/app.py`)
- ObjectBox RAG → OpenAI: creates embeddings (evidence: `objectbox/app.py`)
- Streamlit client → LangServe API: posts prompts (evidence: `api/client.py`)
- LangServe API → OpenAI: routes requests (evidence: `api/app.py`)
- LangServe API → Ollama: routes poems (evidence: `api/app.py`)
