Skip to content

Repository files navigation

🚀 Generative AI with LangChain & Ollama

A comprehensive collection of my learning journey, code implementations, experiments, and projects built while studying Generative AI, LangChain, RAG, AI Agents, and Ollama.

This repository contains hands-on implementations of concepts covered throughout the LangChain and Ollama learning path, ranging from prompt engineering to building end-to-end AI agents.


📚 Topics Covered

1. Introduction to LangChain

  • What is LangChain?
  • Why LangChain for LLM Applications?
  • LangChain Architecture
  • Core Building Blocks

2. LangChain Components

  • Models
  • Prompts
  • Chains
  • Tools
  • Agents
  • Memory
  • Retrievers

3. Working with Models

  • OpenAI Models
  • Groq Models
  • Local LLMs
  • Chat Models
  • Embedding Models

4. Prompt Engineering

  • Prompt Templates
  • Chat Prompt Templates
  • Dynamic Prompt Construction
  • Prompt Chaining

5. Structured Outputs

  • JSON Output Generation
  • Pydantic Output Parsing
  • Schema Validation

6. Output Parsers

  • String Parsers
  • JSON Parsers
  • Custom Output Parsers

7. LangChain Chains

  • LLM Chains
  • Sequential Chains
  • Runnable Chains
  • Chain Composition

8. LangChain Runnables

  • RunnableSequence
  • RunnableParallel
  • RunnableLambda
  • Advanced Runnable Workflows

9. Document Processing

  • Document Loaders
  • PDF Loading
  • Web Page Loading
  • CSV Processing
  • Text Extraction

10. Text Splitting

  • Character Text Splitter
  • Recursive Text Splitter
  • Token-Based Splitting
  • Chunking Strategies

11. Vector Databases

  • Embeddings
  • Similarity Search
  • Vector Storage
  • Semantic Search

12. Retrievers

  • Basic Retrieval
  • Context Retrieval
  • Similarity Search Retrieval
  • Advanced Retrieval Techniques

13. Retrieval-Augmented Generation (RAG)

  • RAG Fundamentals
  • Knowledge Retrieval
  • Context Injection
  • End-to-End RAG Pipelines

14. RAG Projects

  • YouTube Chatbot
  • PDF Question Answering
  • Document Search Systems
  • Knowledge Base Assistants

15. Tools and Tool Calling

  • Custom Tools
  • Built-in LangChain Tools
  • Search Tools
  • API Integration
  • Tool Calling Workflows

16. AI Agents

  • ReAct Agents
  • Tool-Using Agents
  • Agent Executors
  • Multi-Step Reasoning
  • End-to-End Agent Development

17. Ollama

  • Running Local LLMs
  • Model Management
  • Local AI Development
  • LangChain + Ollama Integration

🛠️ Tech Stack

  • Python
  • LangChain
  • Ollama
  • OpenAI API
  • Groq API
  • ChromaDB
  • FAISS
  • HuggingFace Embeddings
  • Pydantic
  • Streamlit
  • Jupyter Notebook

📂 Repository Structure

├── 01_Introduction/
├── 02_LangChain_Components/
├── 03_Models/
├── 04_Prompts/
├── 05_Structured_Output/
├── 06_Output_Parsers/
├── 07_Chains/
├── 08_Runnables/
├── 09_Document_Loaders/
├── 10_Text_Splitters/
├── 11_Vector_Stores/
├── 12_Retrievers/
├── 13_RAG/
├── 14_Projects/
├── 15_Tools/
├── 16_Tool_Calling/
├── 17_AI_Agents/
├── 18_Ollama/
└── README.md

⚙️ Setup

Clone Repository

git clone https://github.com/your-username/repository-name.git
cd repository-name

Create Virtual Environment

python -m venv venv

Activate Environment

Windows:

venv\Scripts\activate

Linux/Mac:

source venv/bin/activate

Install Dependencies

pip install -r requirements.txt

Configure Environment Variables

Create a .env file:

OPENAI_API_KEY=your_api_key
GROQ_API_KEY=your_api_key

🚨 Security Notice

The .env file is ignored using .gitignore and should never be pushed to GitHub.


🎯 Learning Outcomes

By completing the implementations in this repository, I learned:

  • Prompt Engineering
  • LLM Application Development
  • Retrieval-Augmented Generation (RAG)
  • AI Agent Design
  • Tool Calling
  • Vector Databases
  • Semantic Search
  • Local LLM Deployment using Ollama
  • Production-Oriented LangChain Workflows

🙏 Credits

Learning resources and inspiration from the excellent Generative AI and LangChain tutorials by CampusX.


⭐ Support

If you find this repository useful, consider giving it a star.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages