How daveebbelaar/ai-cookbook works
This repository is an AI engineering cookbook: tutorial scripts demonstrate agents, retrieval and knowledge preparation, model capabilities, MCP tools, and workflow patterns rather than forming one deployed application. A representative user-to-result flow is the web research agent: a user asks a question, the agent calls an appropriate handbook or page tool (and may use built-in web search), then returns a structured answer. Knowledge examples separately cover document ingestion and hybrid retrieval. The graph preserves those capability branches; relationships for unsampled tutorials are omitted rather than inferred.
Main entry points: 4-search-agent.py Research agent · 6-evaluate.py Retrieval evaluation · service.py Transcript service · 3-embedding.py Document ingestion
Components 27
Agents and context
- Research agent
context/web/4-search-agent.py - Handbook lookup
context/web/tools/search_handbook.py - Page fetch
context/web/tools/get_web_page.py - Web search
context/web/tools/web_search.py - Agent patterns
agents/agent-complexity - Agent building blocks
agents/building-blocks
Knowledge systems
- Document ingestion
knowledge/docling/3-embedding.py - Tokenizer adapter
knowledge/docling/utils/tokenizer.py - Document search and chat
knowledge/docling/4-search.py - Retrieval evaluation
knowledge/hybrid-retrieval/6-evaluate.py - BM25 and dense retrievers
knowledge/hybrid-retrieval/utils/retrievers.py - Rank fusion
knowledge/hybrid-retrieval/utils/fusion.py - Result reranking
knowledge/hybrid-retrieval/utils/reranker.py - Agentic RAG
knowledge/agentic-rag - Memory examples
knowledge/mem0
Model examples
- Model APIs and outputs
models/openai - Model routing patterns
models/jev - Audio transcription
models/whisper/transcribe.py
MCP integrations
- MCP clients
mcp/crash-course/4-openai-integration/client.py - Knowledge-base server
mcp/crash-course/4-openai-integration/server.py - YouTube transcript server
mcp/servers/youtube/server.py - Transcript service
mcp/servers/youtube/src/service.py - Video ID parser
mcp/servers/youtube/src/utils.py
Workflow patterns
- Workflow patterns
patterns/workflows
Other components
- User
- OpenAI API
- YouTube transcripts
Connections 13
- User → Research agent: asks
context/web/4-search-agent.py - Research agent → OpenAI API: requests responses
context/web/4-search-agent.py - Research agent → Handbook lookup: calls lookup
context/web/4-search-agent.py - Research agent → Page fetch: calls fetch
context/web/4-search-agent.py - Research agent → Web search: offers search
context/web/4-search-agent.py - Research agent → User: returns answer
context/web/4-search-agent.py - Document ingestion → Tokenizer adapter: uses tokenizer
knowledge/docling/3-embedding.py - Retrieval evaluation → BM25 and dense retrievers: evaluates retrieval
knowledge/hybrid-retrieval/6-evaluate.py - Retrieval evaluation → Rank fusion: evaluates fusion
knowledge/hybrid-retrieval/6-evaluate.py - Retrieval evaluation → Result reranking: evaluates reranking
knowledge/hybrid-retrieval/6-evaluate.py - YouTube transcript server → Transcript service: calls service
mcp/servers/youtube/server.py - Transcript service → Video ID parser: extracts ID
mcp/servers/youtube/src/service.py - Transcript service → YouTube transcripts: fetches transcript
mcp/servers/youtube/src/service.py