This repository contains experiments and sample projects using LangChain for building LLM-powered applications, including Retrieval-Augmented Generation (RAG) pipelines.
- Chat with OpenAI models using LangChain's
ChatOpenAI - Document loading and splitting (PDFs, text)
- Embeddings generation with OpenAI models
- Vector storage and retrieval using Pinecone
- Retrieval-Augmented Generation (RAG) with LangChain's
RetrievalQAchain
-
Clone the repository:
git clone https://github.com/your-username/langchain-projects.git cd langchain-projects -
Install dependencies:
poetry install # or, if using pip: pip install -r requirements.txt -
Set environment variables:
OPENAI_API_KEYfor OpenAI accessPINECONE_API_KEYfor Pinecone access
-
Activate virtual environment:
poetry shell
- Run Jupyter notebooks for interactive experiments:
jupyter notebook
- Example notebooks:
chat_model.ipynb: Basic chat with OpenAI modelsrag.ipynb: Full RAG pipeline with PDF ingestion, chunking, embedding, and retrieval
- Adjust chunk sizes in text splitters to avoid Pinecone's per-vector and per-request size limits.
- Ensure your embedding model's output dimension matches your Pinecone index dimension.