Part III: Engineering Intelligent Systems

RAG pipeline, best practices, and agent architectures.

The RAG Pipeline

Explore the main stages of RAG.

🗂️
1. Indexing

Chunking, embeddings, and vector DB indexing.

🔍
2. Retrieval

Similarity search finds relevant chunks.

✍️
3. Generation

Augment the prompt and generate grounded answers.

RAG Best Practices

Chunking

Semantic or heading-aware chunking with modest overlap.

Hybrid Search

Dense vectors + BM25 for exact terms.

Reranking

Cross-encoder rerank top-K results.

Filters

Use metadata to narrow scope.

Citations

Return source URLs/IDs with spans.

Evaluation

Measure precision/recall and faithfulness.

AI Agents

Components
  • Planner
  • Tools & Environment
  • Memory & State
Planning & Tool Use
  • Decompose tasks
  • Validate IO
  • Fallbacks
Memory Systems
  • Short-term context
  • Long-term vector store
  • Episodic artifacts