🤖 A structured, hands-on repository covering LangChain — the most widely used framework for building LLM-powered applications, RAG systems, AI agents, and production-grade GenAI pipelines.
LangChain is the backbone of modern GenAI development:
- ⚡ Powers RAG systems — retrieval + generation pipelines
- 🤖 Used in AI Agents with tool calling
- 🏭 Industry standard for production LLM apps
- 🔗 Integrates with OpenAI, Groq, HuggingFace, Anthropic
- 📦 Used internally by CryptoChat project for RAG pipeline
Building sequential pipelines that connect prompts → LLMs → outputs.
from langchain.chains import LLMChain
from langchain.prompts import PromptTemplate
prompt = PromptTemplate(
input_variables=["topic"],
template="Explain {topic} in simple terms."
)
chain = LLMChain(llm=llm, prompt=prompt)
result = chain.run("RAG systems")Key Concepts:
- Simple chains — single step LLM calls
- Sequential chains — multi-step pipelines
- Prompt templates — dynamic input handling
Converting raw LLM text output into structured Python objects.
from langchain.output_parsers import PydanticOutputParser
from pydantic import BaseModel
class Movie(BaseModel):
title: str
year: int
genre: str
parser = PydanticOutputParser(pydantic_object=Movie)
# LLM output → structured Movie objectKey Concepts:
StrOutputParser— plain text outputPydanticOutputParser— structured JSON → Python objectsCommaSeparatedListOutputParser— list extraction- Format instructions — telling LLM how to respond
LangChain Expression Language (LCEL) — modern, composable pipelines.
from langchain_core.runnables import RunnablePassthrough
# LCEL pipe syntax — composing chains
chain = prompt | llm | output_parser
# Parallel execution
chain = RunnableParallel(
summary=summarize_chain,
keywords=keyword_chain
)Key Concepts:
RunnablePassthrough— pass data through unchangedRunnableParallel— run multiple chains simultaneouslyRunnableLambda— wrap any Python function as runnable- Pipe
|operator — elegant chain composition
Connecting to different LLM providers and model types.
# Chat Models
from langchain_openai import ChatOpenAI
from langchain_groq import ChatGroq
llm = ChatGroq(model="llama3-8b-8192") # Fast & free
# Embedding Models
from langchain_community.embeddings import HuggingFaceEmbeddings
embeddings = HuggingFaceEmbeddings(
model_name="sentence-transformers/all-MiniLM-L6-v2"
)Key Concepts:
- LLM vs ChatModel differences
- OpenAI, Groq, HuggingFace integration
- Embedding models for vector search
- Model parameters — temperature, max_tokens, streaming
User Input
↓
Prompt Template (dynamic variables)
↓
LLM Model (OpenAI / Groq / HuggingFace)
↓
Output Parser (text → structured data)
↓
Chain / Runnable (connects everything)
↓
Final Output
| Component | Technology |
|---|---|
| Framework | LangChain v0.2+ |
| LLM APIs | OpenAI, Groq |
| Embeddings | HuggingFace sentence-transformers |
| Language | Python 3.10+ |
| Notebooks | Jupyter Notebook |
# Clone the repo
git clone https://github.com/tashfeen786/LangChain.git
cd LangChain
# Install dependencies
pip install langchain langchain-openai langchain-groq \
langchain-community python-dotenv jupyter
# Set up API keys
cp .env.example .env
# Add your keys to .envOPENAI_API_KEY=your_openai_key
GROQ_API_KEY=your_groq_keyLangChain/
│
├── LANGCHAIN_CHAIN/ # LLM chains & sequential pipelines
├── LANGCHAIN_OTUPUT_PARSERS/ # Structured output parsing
├── Runnables in LangChain/ # LCEL — modern runnable interface
├── langchain_model/ # LLM & embedding model integration
└── README.md
This LangChain knowledge is directly applied in:
🤖 CryptoChat RAG System — used LangChain to build the complete RAG pipeline: document loading → embedding → vector search → Groq LLM → personalized crypto investment advice.
- RAG pipeline from scratch
- AI Agent with tool calling
- Memory & conversation history
- LangGraph — stateful agent workflows
- LangSmith — observability & debugging
Tashfeen Aziz — AI/ML Engineer & Python Developer
⭐ If you found this helpful, please give it a star!