Skip to content

Repository files navigation

Generative AI with Python 🤖

A progressive, hands-on LangChain playground — 13 modules taking you from basic LLM calls to a production-ready RAG pipeline, tool calling, and agentic workflows.

Built for developers who already know how to code and want to understand how Generative AI actually works — not just call an API, but build pipelines, process documents, implement semantic search, and wire up agents that use tools.

All 13 modules are complete. Start at module 01 and work forward, or jump to the topic you need.


Table of Contents


Quick Start

git clone https://github.com/Wcoder547/generative-ai-with-python.git
cd generative-ai-with-python

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate        # Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

Create a .env file in the root:

OPENAI_API_KEY=your_openai_key
GROK_API_KEY=your_grok_key       # Optional

Then navigate to any module folder and run the notebooks or scripts.


Learning Path

13 progressive modules — each builds on the last.

Module Topic Key Concepts
01_langchain-models LLM Models & Chat ChatOpenAI, Grok, basic LLM calls
02_langchain_prompts Prompt Engineering Prompt templates, chat history, chatbot
03_structured_output Structured Generation with_structured_output(), typing
04_Output_parser Output Parsing JSON, Pydantic, string, structured parsers
05_chains Chains Sequential, parallel, conditional chains
06_runnables Runnables RunnableSequence, RunnableParallel, branching
07_document_loader Document Loaders PDF, TXT, CSV, DOCX, web page loaders
08_text_Splitter Text Splitting Character, recursive, semantic chunking
09_custom_langchain Custom Components Custom chains, tools, output parsers
10_vectorStore Vector Stores ChromaDB, FAISS, embeddings
11_retrivers Retrievers VectorStoreRetriever, contextual compression
12_rag RAG Pipeline Full retrieval-augmented generation with sources
13_tool_calling Tool Calling & Agents Function tools, agent executors

What the progression looks like

LLM calls → Prompt templates → Structured output → Output parsers
  → Chains → Runnables → Document loading → Text splitting
  → Vector stores → Retrievers → RAG → Tool calling & Agents

Modules 10–12 are the core of the repo — vector stores, retrievers, and RAG are where everything you've learned in 01–09 comes together into a system that can actually answer questions about your own documents.


Tech Stack

Layer Technology
Language Python 3.11+
LLM Framework LangChain, LangGraph
LLMs OpenAI GPT, xAI Grok
Vector DBs ChromaDB, FAISS
Document Loaders Unstructured, PyPDF, BeautifulSoup
Output Parsing Pydantic, JSON Schema
Embeddings OpenAI, HuggingFace

Bonus: GenAI Notes PDF

📄 GenAi-Notes.pdf — included at the repo root. Covers the full LangChain curriculum structure, architecture diagrams, best practices, and deployment strategies.


Contributing

  1. Fork the repository
  2. Create a branch: git checkout -b feature/your-feature
  3. Commit your changes: git commit -m "add: your feature"
  4. Push and open a Pull Request

About

This repo was built to bridge the gap between knowing how to build web applications and understanding how to build AI-powered ones. LangChain's abstraction layers make sense once you've implemented each piece — prompts, chains, retrievers, vector stores — individually before wiring them together.

Module 12 (RAG) is the payoff: a working system that ingests documents, embeds them, stores them in a vector database, retrieves relevant chunks at query time, and generates grounded answers with source attribution. That's the pattern behind most production AI features today.

Built by Waseem Akram — Full-Stack Developer and DevOps Engineer based in Pakistan, working across the MERN stack, Generative AI integrations, and cloud automation.


If this helped you, consider giving it a ⭐

About

Hands-on LangChain playground — 13 progressive modules from basic LLM calls to RAG pipelines, vector stores, tool calling & agentic workflows. Built for developers learning Generative AI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages