This repository contains all the code examples, demos, and hands-on projects from every chapter of "A Developer's Guide to Integrating Generative AI into Applications" by Chris Minnick, published by Wiley Publishing in 2026.
The book provides practical guidance for software developers who want to integrate AI capabilities into their applications, covering everything from basic API integration to advanced techniques like RAG (Retrieval-Augmented Generation), vector search, production-ready AI systems, cost optimization, and advanced orchestration patterns.
- Title: A Developer's Guide to Integrating Generative AI into Applications
- Author: Chris Minnick
- Publisher: Wiley Publishing
- Publication Year: 2026
- ISBN: 9781394373130
This repository contains complete code examples from every chapter and is organized by chapter with working examples of:
- AI API Integration - OpenAI, Anthropic, and Google Gemini integrations
- Interactive Games - 20 Questions, Choose Your Adventure, and Hangman powered by AI
- Chat Applications - Full-stack chat implementations with streaming
- Content Generation - Structured output and template-based generation
- Code Optimization - AI-assisted coding environments and optimization techniques
- Production Tools - SPOT (Structured Prompt Output Toolkit) and PACE for enterprise AI content generation and development
- Vector Search - Embedding-based search and recommendation systems
- RAG Systems - Retrieval-Augmented Generation implementations
- AI Safety & Moderation - Content filtering and feedback systems
- Cost Management - Usage tracking, quotas, and cost optimization
- Advanced Routing - Multi-modal adapters and intelligent request orchestration
├── chapter-02/          # RAG (Retrieval-Augmented Generation) concepts
├── chapter-03/          # Interactive AI games and demos
│   ├── 20-questions/    # AI-powered 20 Questions game
│   ├── choose-your-adventure/  # Interactive story game
│   └── hangman/         # AI word guessing game
├── chapter-04/          # Structured content generation
├── chapter-05/          # Recipe generator with Node.js
├── chapter-07/          # AI optimization examples and techniques
├── chapter-08/          # Chat applications
│   ├── simple-chat-python/     # Flask-based chat server
│   ├── chat-client-react-*/    # React chat clients
│   └── simple-chat-server-*/   # Node.js chat servers
├── chapter-09/          # Production AI tools
│   ├── spot-toolkit/   # SPOT Node.js implementation
│   └── spot-python/    # SPOT Python implementation
├── chapter-10/          # AI-assisted coding
│   └── pace/            # Prompt-Augmented Coding Environment
├── chapter-11/          # Vector search and recommendations
│   ├── vector-search-demo/     # Embedding-based search
│   ├── recommender-demo/       # AI recommendation system
│   └── fuse/                   # Advanced search implementation
├── chapter-12/          # AI safety, moderation and feedback systems
├── chapter-13/          # Cost optimization, usage tracking and quotas
└── chapter-14/          # AI routing, orchestration and multi-modal adapters
- Languages: Python, JavaScript/Node.js, TypeScript
- Frameworks: Flask, Express.js, React, Vite
- AI Providers: OpenAI GPT, Anthropic Claude, Google Gemini
- Databases: Vector databases, JSON storage
- Tools: CodeMirror, various AI SDKs
Chapter 9
A production-ready content generation system available in both Node.js and Python implementations, featuring:
- Multi-provider AI support with automatic failover
- Brand voice enforcement and style governance
- Golden set testing and evaluation
- Circuit breakers and health monitoring
- Template management with versioning
Chapter 10
An AI-enhanced code editor that combines CodeMirror with customizable AI prompt templates for developer productivity.
Chapter 12
Production-ready implementations featuring:
- Content moderation and filtering
- Feedback collection and analysis systems
- Safe AI interaction patterns
- Real-time monitoring and alerting
Chapter 13
Enterprise-grade tools for AI cost management:
- Real-time usage tracking and analytics
- Token counting and cost estimation
- Quota enforcement and rate limiting
- Usage summarization and reporting
Chapter 3
- 20 Questions: AI acts as the answerer in the classic guessing game
- Choose Your Adventure: AI-generated interactive stories with branching narratives
- Hangman: AI provides words and hints for the classic word game
Chapter 8
Complete implementations showing:
- Real-time streaming responses
- Session management
- Full-stack architecture (Python Flask + React)
- WebSocket integration
Chapter 11
- Embedding-based search systems
- User profile-driven recommendations
- Advanced search with the Fuse.js library
- Node.js 18+
- Python 3.8+
- API keys for at least one AI provider:
- 
Clone the repository: git clone https://github.com/chrisminnick/ai-integration.git cd ai-integration
- 
Set up environment variables: # Copy the example environment file (if available in specific chapters) export OPENAI_API_KEY="your-openai-api-key" export ANTHROPIC_API_KEY="your-anthropic-api-key" export GOOGLE_AI_API_KEY="your-google-ai-api-key" 
- 
Run a demo (example - 20 Questions game): cd chapter-03/20-questions pip install -r requirements.txt python server.py
- 
Visit http://localhost:5000to try the demo
Each chapter folder contains its own README.md with specific setup instructions. Most Python projects include a requirements.txt file, and Node.js projects include a package.json file for dependency management.
If you're new to AI integration, we recommend following this order:
- Chapter 3 - Start with the interactive games to understand basic AI API calls
- Chapter 4 - Learn structured output and content generation
- Chapter 5 - Explore Node.js integration patterns
- Chapter 8 - Build full-stack chat applications
- Chapter 7 - Optimize performance and implement caching
- Chapter 9 - Scale to production with SPOT (Structured Prompt Output Toolkit)
- Chapter 10 - Enhance development workflow with PACE
- Chapter 11 - Implement advanced search and recommendations
- Chapter 12 - Add safety and moderation to your AI systems
- Chapter 13 - Implement cost monitoring and usage optimization
- Chapter 14 - Master advanced routing and multi-modal orchestration
This repository primarily serves as companion code for the book, but we welcome:
- Bug reports and fixes
- Documentation improvements
- Additional examples or variations
- Performance optimizations
Please see individual project READMEs for specific contribution guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
- Book Support: Contact Wiley Publishing for book-related questions
- Code Issues: Open an issue in this GitHub repository
- Author Contact: Chris Minnick
"A Developer's Guide to Integrating Generative AI into Applications"
© 2026 Wiley Publishing. All rights reserved.
The code examples and demonstrations in this repository are open source and licensed under the MIT License. See the LICENSE file for full details.
The book and its content are protected by copyright. The code examples are provided for educational purposes to accompany the book and may be used, modified, and distributed under the terms of the MIT License.
