Skip to content

Harikishan-AI/Agentic-Learning

Repository files navigation

🤖 Agentic Notebooks (LangGraph + LangChain)

Hands-on Jupyter notebooks covering agents, tool-calling, and RAG (Retrieval-Augmented Generation) using LangGraph/LangChain with multiple vector store backends.

📌 What You’ll Find Here

  • Build blocks: prompts, chains, embeddings, loaders, and vector stores
  • RAG: chunking → embedding → retrieval → generation
  • Agent patterns: tool calling, routing, memory, and “corrective” retrieval loops

🗺️ Notebook Guide (Crisp Map)

🧩 LangGraph (agent graphs, tools, state)

Notebook What it covers Key concepts
langgraph_intro.ipynb First steps with StateGraph and state passing Typed state, node functions, message/state updates
langgraph_Agentic_Class_2.ipynb Embeddings + Chroma retrieval wired into an agent-style state HuggingFace embeddings, Chroma retriever, structured state
langgrapha_Agentic_Class_3.ipynb Graph with and without tool calling ToolNode, custom tools, message history, memory patterns
langgraph_Agentic_Class_4.ipynb Tool binding and tool selection behavior bind_tools, inbuilt search tools, tool routing conditions
tools.ipynb Minimal custom tool examples @tool, tool schemas, tool invocation
Agentic RAG Class 5.ipynb End-to-end RAG from web content Web loaders, splitting, embedding, retrieval, generation
Corrective RAG Class 5.ipynb “Corrective RAG”: grade → rewrite → fallback search Relevance grading, JSON parsing, query rewrite, web search fallback
Network Multi Agent_Class_6.ipynb Advanced agent behaviors with tools (and demos) ReAct-style agent usage, commands, tool execution, search/code tools
Supervisor Multi Agent Class 7.ipynb Supervisor agent orchestrating specialist agents supervisor agent, delegation, role-based agents
Human-In-Loop Class 8.ipynb Human-in-the-loop interventions in agent workflows human feedback, approvals, intervention points

🧱 LangChain (foundations, ingestion, vector DBs)

Notebook What it covers Key concepts
basics.ipynb Core LangChain building blocks prompts, chains, model invocation, LangSmith env vars
embeddings.ipynb Embedding text into vectors HuggingFaceEmbeddings, vector dimensions, query vs doc embeddings
data-ingestion.ipynb Loading documents from files TextLoader, PDF loaders, lazy loading, document objects
vectoredatabase.ipynb Vector similarity search + RAG with FAISS cosine vs L2, FAISS indexing, retrieval, RAG patterns
code.ipynb Pinecone-backed vector store index creation, upsert, query, PineconeVectorStore

✅ Pydantic (structured outputs & validation)

Notebook What it covers Key concepts
pydantic.ipynb Data validation vs plain dataclasses BaseModel, type coercion, ValidationError, optional fields

🤝 AutoGen (multi-agent workflows and tools)

Notebook What it covers Key concepts
first autogen agent.ipynb Your first AutoGen agent with a basic task single agent, prompts, run loop
Autogen Agents.ipynb Core AutoGen agent patterns user proxy, assistant agents, conversations
Autogen Agents Tools.ipynb Using tools with AutoGen agents tool calling, code execution, retrieval tools
Autogen Teams.ipynb Teams of cooperating agents multi-agent teams, roles, coordination
Autogen Graph Flow.ipynb Graph-style workflows in AutoGen workflow graphs, routing, multi-step tasks
Selection Group Chat.ipynb Group chat with agent selection group chat, speaker selection, collaboration
Human in the loop.ipynb Human supervision in AutoGen flows human approvals, intervention, oversight
Human in the loop Outside.ipynb Human-in-the-loop with external context external tools, human feedback, review loops
mcp_in_autogen.py Connecting AutoGen agents to MCP servers McpWorkbench, StdioServerParams, tool discovery

🛠️ Agent Development Kit (ADK)

File What it covers Key concepts
built_in_tool_agent/agent.py Multi-agent orchestration with built-in tools AgentTool, google_search, agent wrapping
crew_ai_tool_agent/agent.py Integrating CrewAI tools into ADK CrewaiTool, SerperDevTool, tool wrapping
custom_tool_agent/agent.py Custom Python functions as agent tools Function tools, LlmAgent, tool definitions
openrouter_agent/agent.py Using external LLMs via OpenRouter LiteLlm, OpenRouter integration, multi-provider support
session_runner/runner.py Persistent session management and state Runner, InMemorySessionService, stateful agents
structred_output/agent.py Structured data extraction with Pydantic output_schema, BaseModel, data validation

🏗️ Architecture Diagrams

🤖 AutoGen Team Patterns

AutoGen supports various ways to coordinate multiple agents:

1. Round Robin (Fixed Sequence)

Agents speak in a pre-defined circular order.

graph LR
    User([User]) --> Team[RoundRobinGroupChat]
    Team --> A[Agent 1]
    A --> B[Agent 2]
    B --> C[Agent 3]
    C --> A
Loading

2. Selector (Dynamic Selection)

A "Selector" LLM determines the next best agent to speak based on their description.

graph TD
    User([User]) --> Team[SelectorGroupChat]
    Team --> Selector{Selector LLM}
    Selector -->|analyzes task| A[Planning Agent]
    Selector -->|analyzes task| B[Worker Agent]
    Selector -->|analyzes task| C[Analyst Agent]
    A & B & C --> Team
Loading

3. Graph Flow (State Machine)

Sequence is defined by a Directed Graph (DiGraph) with explicit edges.

graph LR
    User([User]) --> Graph[DiGraphBuilder / GraphFlow]
    Graph --> Writer[Writer Agent]
    Writer --> Reviewer[Reviewer Agent]
    Reviewer -- feedback --> Writer
    Reviewer -- approved --> End([End Task])
Loading

🛠️ ADK Core Architecture

The Google Agent Development Kit (ADK) focuses on session management and persistent runners.

graph TD
    User([User]) --> Runner[Runner]
    subgraph ADK Framework
        Runner --> Session[InMemorySessionService]
        Runner --> Agent[Agent / LlmAgent]
        Session <-->|State/Context| Agent
        Agent --> Tools[Tools Library]
        subgraph Tools Library
            Tools --> BuiltIn[Google Search / etc.]
            Tools --> Custom[Python Functions]
            Tools --> CrewAI[CrewAI Tool Wrappers]
        end
    end
    Agent --> LLM[Gemini / LiteLLM]
Loading

🔁 Visual: Corrective RAG Loop (High Level)

flowchart LR
  Q[User Question] --> R[Retrieve from Vector Store]
  R --> G[Grade Relevance]
  G -->|relevant| A[Answer with Context]
  G -->|irrelevant| W[Rewrite Query]
  W --> S[Web Search]
  S --> R
Loading

Releases

No releases published

Packages

 
 
 

Contributors