File size: 1,575 Bytes
eb49d63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
LangGraph is a library for building stateful, multi-step workflows using LangChain agents and tools. It introduces a graph-based abstraction where nodes represent steps (e.g., retrieval, generation, decision-making) and edges define transitions between them.

Key Concepts:
- Nodes: Functional units like retrievers, LLMs, or tool wrappers.
- Edges: Conditional or static paths that control flow between nodes.
- State: A shared dictionary passed and updated across nodes.

LangGraph supports asynchronous execution, retries, and streaming, making it ideal for complex agentic workflows.

Retrieval-Augmented Generation (RAG) is a technique that enhances LLM responses by injecting external knowledge. It typically involves:
1. Querying a vector store to retrieve relevant documents.
2. Passing those documents as context to the LLM.
3. Generating a grounded, context-aware response.

Benefits of RAG:
- Reduces hallucinations by anchoring responses in real data.
- Enables domain-specific QA without fine-tuning.
- Improves transparency and traceability.

LangChain provides the building blocks for RAG:
- Document loaders and chunkers
- Embedding models and vector stores (e.g., FAISS, Chroma)
- Chains and agents for orchestration

LangGraph extends LangChain by enabling:
- Explicit control flow
- Modular design
- Debuggable, reproducible workflows

Use Cases:
- Academic QA bots
- Internal knowledge assistants
- Modular agent systems with tool use

This primer serves as a foundational reference for building explainable, modular GenAI systems using LangGraph and RAG.