
Building Business-Ready Generative AI Systems
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
- Enhance GenAISys with multi-domain, multimodal reasoning capabilities and Chain of Thought (CoT)
- Seamlessly integrate cutting-edge OpenAI and DeepSeek models as you see fit
Book DescriptionIn today's rapidly evolving AI landscape, standalone LLMs no longer deliver sufficient business value on their own. This guide moves beyond basic chatbots, showing you how to build advanced, agentic ChatGPT-grade systems capable of sophisticated semantic and sentiment analysis, powered by context-aware AI controllers. You'll design AI controller architectures with multi-user memory retention to dynamically adapt your system to diverse user and system inputs. You'll architect a Retrieval-Augmented Generation (RAG) system with Pinecone, designed to combine instruction-driven scenarios. Enhance your system's intelligence with powerful multimodal capabilities-including image generation, voice interactions, and machine-driven reasoning-leveraging Chain-of-Thought orchestration to address complex, cross-domain automation challenges. Seamlessly integrate generative models like OpenAI's suite and DeepSeek-R1 without disrupting your existing GenAISys ecosystem. Your GenAISys will apply neuroscience-inspired insights to marketing strategies, predict human mobility, integrate smoothly into human workflows, visualize complex scenarios, and connect to live external data, all wrapped in a polished, investor-ready interface. By the end, you'll have built a GenAISys capable of deploying intelligent agents in your business environment.What you will learn - Implement an AI controller with a conversation AI agent and orchestrator at its core
- Build contextual awareness with short-term, long-term, and cross-session memory
- Design cross-domain automation with multimodal reasoning, image generation, and voice features
- Expand a CoT agent by integrating consumer-memory understanding
- Integrate cutting-edge models of your choice without disrupting your existing GenAISys
- Connect to real-time external data while blocking security breaches
Who this book is forThis book is for AI and Machine Learning Engineers seeking to enhance their understanding of Generative AI and its enterprise applications. It will particularly benefit those interested in building AI agents, creating advanced orchestration systems, and leveraging AI for automation in marketing, production, and logistics. Software architects and enterprise developers looking to build scalable AI-driven systems will also find immense value in this guide. No prior superintelligence experience is necessary, but familiarity with AI concepts is recommended.
All prices
More details
Content
- Cover
- Title Page
- Copyright
- Dedication
- Contributors
- Table of Contents
- Preface
- Your Book Comes with Exclusive Perks - Here's How to Unlock Them
- Chapter 1: Defining a Business-Ready Generative AI System
- Components of a business-ready GenAISys
- AI controllers
- Model-agnostic approach to generative AI
- Building the memory of a GenAISys
- RAG as an agentic multifunction co-orchestrator
- Human roles
- GenAISys implementation and governance teams
- GenAISys RACI
- Business opportunities and scope
- Hybrid approach
- Key characteristics
- Use case examples
- Small scope and scale
- Key characteristics
- Use case examples
- Full-scale GenAISys
- Key characteristics
- Use case examples
- Contextual awareness and memory retention
- Setting up the environment
- Downloading OpenAI resources
- 1. Stateless and memoryless session
- Semantic query
- Episodic query with a semantic undertone
- Stateless and memoryless verification
- 2. Short-term memory session
- 3. Long-term memory of multiple sessions
- 4. Long-term memory of multiple cross-topic sessions
- Summary
- Questions
- References
- Further reading
- Chapter 2: Building the Generative AI Controller
- Architecture of the AI controller
- Conversational AI agent
- Setting up the environment
- Conversational AI agent workflow
- Starting the initial conversation
- The full-turn conversation loop
- Running the conversational AI agent
- Next steps
- AI controller orchestrator
- Understanding the intent functionality
- From T5 to GPT models
- Corpus of Linguistic Acceptability (CoLA)
- Translation task
- Semantic Textual Similarity Benchmark (STSB)
- Summarization
- Implementing the orchestrator for instruction selection
- Selecting a scenario
- Defining task/instruction scenarios
- Performing intent recognition and scenario selection
- Running scenarios with the generative AI agent
- Sentiment analysis
- Semantic analysis
- Summary
- Questions
- References
- Further reading
- Chapter 3: Integrating Dynamic RAG into the GenAISys
- Architecting RAG for dynamic retrieval
- Scenario-driven task execution
- Hybrid retrieval and CoT
- Building a dynamic Pinecone index
- Setting up the environment
- Installing Pinecone
- Initializing the Pinecone API key
- Processing data
- Data loading and chunking
- Embedding the dataset
- Creating the Pinecone index
- Upserting instruction scenarios into the index
- Upserting classical data into the index
- Data loading and chunking
- Querying the Pinecone index
- Querying functions
- Querying the vector store and returning results
- Processing the queries
- Retrieval queries
- Summary
- Questions
- References
- Chapter 4: Building the AI Controller Orchestration Interface
- Architecture of an event-driven GenAISys interface
- Building the processes of an event-driven GenAISys interface
- 1. Start
- 2. Initialize widgets
- 3. Display the UI
- 4. Input box event
- 5. chat(user_message) function
- 6. If 'exit' is chosen
- 7. If user(s) continue the conversation
- 8. Generate bot response
- 9. Update display
- Conversational agent
- Multi-user, multi-turn GenAISys session
- A session with two users
- The interactive conversation
- Loading and displaying the conversation
- Loading and summarizing the conversation
- Multi-user session
- Semantic and sentiment analysis
- RAG for episodic memory retrieval
- Generative AI agent for ideation
- Dialogue without an AI conversational agent
- Loading, displaying, and summarizing the conversation
- Summary
- Questions
- References
- Further reading
- Chapter 5: Adding Multimodal, Multifunctional Reasoning with Chain of Thought
- Enhancing the event-driven GenAISys interface
- IPython interface and AI agent enhancements
- Layer 1: IPython interface
- Layer 2: AI agent
- Layer 3: Functions
- Setting up the environment
- OpenAI
- Initializing gTTS, machine learning, and CoT
- Image generation and analysis
- Image generation
- Image analysis
- Reasoning with CoT
- CoT in GenAISys versus traditional software sequences
- Cognitive flow of CoT reasoning
- Start
- Step 1: ML-baseline
- Step 2: Suggest activities
- Step 3: Generate image
- Step 4: Analyze image
- End
- Running CoT reasoning from a user perspective
- Summary
- Questions
- References
- Chapter 6: Reasoning E-Marketing AI Agents
- Designing the consumer GenAISys memory agent
- Consumer-memory agent use case
- Defining memory structures
- Enhancing the architecture of the GenAISys
- Building the consumer memory agent
- The dataset: Hotel reviews
- Step 1: Memory and sentiment analysis
- Designing a complex system message for Step 1
- Running the memory analysis
- Step 2: Extract sentiment scores
- Step 3: Statistics
- Step 4: Content creation
- Step 5: Creating an image
- Step 6: Creating a custom message
- GenAISys interface: From complexity to simplicity
- Adding the CoT widget
- Enhancing the AI agent
- Generalizing the GenAISys capabilities
- Summary
- Questions
- References
- Further reading
- Chapter 7: Enhancing the GenAISys with DeepSeek
- Balancing model evolution with project needs
- DeepSeek-V3, DeepSeek-V1, and R1-Distill-Llama: Overview
- Getting started with DeepSeek-R1-Distill-Llama-8B
- Setting up the DeepSeek Hugging Face environment
- Downloading DeepSeek
- Running a DeepSeek-R1-Distill-Llama-8B session
- Integrating DeepSeek-R1-Distill-Llama-8B
- Implementing the handler selection mechanism as an orchestrator of the GenAISys
- What is a handler?
- Why is a handler better than a traditional if...then list?
- 1. IPython interface
- File management
- 2. Handler selection mechanism
- 3. Handler registry
- Pinecone/RAG handler
- Reasoning handler
- Analysis handler
- Generation handler
- Image handler
- Fallback memory handler
- 4. AI functions
- RAG
- Sentiment analysis (genaisys)
- Semantic analysis (genaisys)
- Data retrieval (data01)
- Chain of thought
- Analysis (memory)
- Generation
- Creating an image
- Fallback handler (memory-based)
- Summary
- Questions
- References
- Further reading
- Chapter 8: GenAISys for Trajectory Simulation and Prediction
- Trajectory simulations and predictions
- Challenges in large-scale mobility forecasting
- From traditional models to LLMs
- Key contributions of the paper
- Reformulating trajectory prediction as a Q&A
- Instruction tuning for domain adaptation
- Handling missing data
- Building the trajectory simulation and prediction function
- Creating the trajectory simulation
- Visualizing the trajectory simulator
- Output of the simulation function
- Creating the mobility orchestrator
- Preparing prediction instructions and the OpenAI function
- Message preparation
- Fitting the messages together
- Implementing the messages into the OpenAI API function
- Trajectory simulation, analysis, and prediction
- Adding mobility intelligence to the GenAISys
- IPython interface
- Creating the option in instruct_selector
- Handling the "mobility" value in update_display()
- handle_submission() logic
- Handler selection mechanism
- AI functions
- Running the mobility-enhanced GenAISys
- Production-delivery verification scenario
- Fire disaster scenario
- Summary
- Questions
- References
- Further reading
- Chapter 9: Upgrading the GenAISys with Data Security and Moderation for Customer Service
- Enhancing the GenAISys
- Adding a security function to the handler selection mechanism
- Implementing the security function
- Handler selection mechanism interactions
- Implementing the moderation function
- Building the data security function
- Populating the Pinecone index
- Querying the Pinecone index
- Running security checks
- Building a weather forecast component
- Setting up the OpenWeather environment
- Adding a weather widget to the interface
- Adding a handle to the handler registry
- Adding the weather forecast function to AI functions
- Running the GenAISys
- A multi-user, cross-domain, and multimodal dialogue
- Summary
- Questions
- References
- Further reading
- Chapter 10: Presenting Your Business-Ready Generative AI System
- Designing the presentation of the GenAISys
- Building a flexible HTML interface
- 1. Presenting the core GenAISys
- 2. Presenting the vector store
- 3. Human-centric approach to KPIs
- ROI through growth
- Adding a real-time KPI to the GenAISys web interface
- 4. Integration: Platforms and frameworks
- Showcasing advanced frameworks: A MAS
- Strategic integration options for the MAS
- 5. Security and privacy
- 6. Customization
- 7. GenAISys resources (RACI)
- Summary
- Questions
- References
- Further reading
- Answers
- Other Books You May Enjoy
- Index
1
Defining a Business-Ready Generative AI System
Implementing a generative AI system (GenAISys) in an organization doesn't stop at simply integrating a standalone model such as GPT, Grok, Llama, or Gemini via an API. While this is often a starting point, we often mistake it as the finish line. The rising demand for AI, as it expands across all domains, calls for the implementation of advanced AI systems that go beyond simply integrating a prebuilt model.
A business-ready GenAISys should provide ChatGPT-grade functionality in an organization, but also go well beyond it. Its capabilities and features must include natural language understanding (NLU), contextual awareness through memory retention across dialogues in a chat session, and agentic functions such as autonomous image, audio, and document analysis and generation. Think of a generative AI model as an entity with a wide range of functions, including AI agents as agentic co-workers.
We will begin the chapter by defining what a business-ready GenAISys is. From there, we'll focus on the central role of a generative AI model, such as GPT-4o, that can both orchestrate and execute tasks. Building on that, we will lay the groundwork for contextual awareness and memory retention, discussing four types of generative AI memory: memoryless, short-term, long-term, and multiple sessions. We will also define a new approach to retrieval-augmented generation (RAG) that introduces an additional dimension to data retrieval: instruction and agentic reasoning scenarios. Adding instructions stored in a vector store takes RAG to another level by retrieving instructions that we can add to a prompt. In parallel, we will examine a critical component of a GenAISys: human roles. We will see how, throughout its life cycle, an AI system requires human expertise. Additionally, we will define several levels of implementation to adapt the scope and scale of a GenAISys, not only to business requirements but also to available budgets and resources.
Finally, we'll illustrate how contextual awareness and memory retention can be implemented using OpenAI's LLM and multimodal API. A GenAISys cannot work without solid memory retention functionality-without memory, there's no context, and without context, there's no sustainable generation. Throughout this book, we will create modules for memoryless, short-term, long-term, and multisession types depending on the task at hand. By the end of this chapter, you will have acquired a clear conceptual framework for what makes an AI system business-ready and practical experience in building the first bricks of an AI controller.
In a nutshell, this chapter covers the following topics:
- Components of a business-ready GenAISys
- AI controllers and agentic functionality (model-agnostic)
- Hybrid human roles and collaboration with AI
- Business opportunities and scope
- Contextual awareness through memory retention
Let's begin by defining what a business-ready GenAISys is.
Components of a business-ready GenAISys
A business-ready GenAISys is a modular orchestrator that seamlessly integrates standard AI models with multifunctional frameworks to deliver hybrid intelligence. By combining generative AI with agentic functionality, RAG, machine learning (ML), web search, non-AI operations, and multiple-session memory systems, we are able to deliver scalable and adaptive solutions for diverse and complex tasks. Take ChatGPT, for example; people use the name "ChatGPT" interchangeably for the generative AI model as well as for the application itself. However, behind the chat interface, tools such as ChatGPT and Gemini are part of larger systems-online copilots-that are fully integrated and managed by intelligent AI controllers to provide a smooth user experience.
It was Tomczak (2024) who took us from thinking of generative AI models as a collective entity to considering complex GenAISys architectures. His paper uses the term "GenAISys" to describe these more complex platforms. Our approach in this book will be to expand the horizon of a GenAISys to include advanced AI controller functionality and human roles in a business-ready ecosystem. There is no single silver-bullet architecture for a GenAISys. However, in this section, we'll define the main components necessary to attain ChatGPT-level functionality. These include a generative AI model, memory retention functions, modular RAG, and multifunctional capabilities. How each component contributes to the GenAISys framework is illustrated in Figure 1.1:
Figure 1.1: GenAISys, the AI controller, and human roles
Let's now define the architecture of the AI controllers and human roles that make up a GenAISys.
AI controllers
At the heart of a business-ready GenAISys is an AI controller that activates custom ChatGPT-level features based on the context of the input. Unlike traditional pipelines with predetermined task sequences, the AI controller operates without a fixed order, dynamically adapting tasks-such as web search, image analysis, and text generation-based on the specific context of each input. This agentic context-driven approach enables the AI controller to orchestrate various components seamlessly, ensuring effective and coherent performance of the generative AI model.
A lot of work is required to achieve effective results with a custom ChatGPT-grade AI controller. However, the payoff is a new class of AI systems that can withstand real-world pressure and produce tangible business results. A solid AI controller ecosystem can support use cases across multiple domains: customer support automation, sales lead generation, production optimization (services and manufacturing), healthcare response support, supply chain optimization, and any other domain the market will take you! A GenAISys, thus, requires an AI controller to orchestrate multiple pipelines, such as contextual awareness to understand the intent of the prompt and memory retention to support continuity across sessions.
The GenAISys must also define human roles, which determine which functions and data can be accessed. Before we move on to human roles, however, let's first break down the key components that power the AI controller. As shown in Figure 1.1, the generative AI model, memory, modular RAG, and multifunctional capabilities each play vital roles in enabling flexible, context-driven orchestration. Let's explore how these elements work together to build a business-ready GenAISys. We will first define the role of the generative AI model.
Model-agnostic approach to generative AI
When we build a sustainable GenAISys, we need model interchangeability-the flexibility to swap out the underlying model as needed. A generative AI model should serve as a component within the system, not as the core that the system is built around. That way, if our model is deprecated or requires updating, or we simply find a better-performing one, we can simply replace it with another that better fits our project.
As such, the generative AI model can be OpenAI's GPT, Google's Gemini, Meta's Llama, xAI's Grok, or any Hugging Face model, as long as it supports the required tasks. Ideally, we should choose a multipurpose, multimodal model that encompasses text, vision, and reasoning abilities. Bommasani et al. (2021) provide a comprehensive analysis of such foundation models, whose scope reaches beyond LLMs.
A generative AI model has two main functions, as shown in Figure 1.2:
- Orchestrates by determining which tasks need to be triggered based on the input. This input can be a user prompt or a system request from another function in the pipeline. The orchestration function agent can trigger web search, document parsing, image generation, RAG, ML functions, non-AI functions, and any other function integrated into the GenAISys.
- Executes the tasks requested by the orchestration layer or executes a task directly based on the input. For example, a simple query such as requesting the capital of the US will not necessarily require complex functionality. However, a request for document analysis might require several functions (chunking, embedding, storing, and retrieving).
Figure 1.2: A generative AI model to orchestrate or execute tasks
Notice that Figure 1.2 has a unique feature. There are no arrows directing the input, orchestration, and execution components. Unlike traditional hardcoded linear pipelines, a flexible GenAISys has its components unordered. We build the components and then let automated scenarios selected by the orchestration function order the tasks dynamically.
This flexibility ensures the system's adaptability to a wide range of tasks. We will not be able to build a system that solves every task, but we can build one that satisfies a wide range of tasks within a company. Here are two example workflows that illustrate how a GenAISys can dynamically sequence tasks based on the roles involved:
- Human roles can be configured so that, in some cases, the user input executes a simple API call to provide a straightforward response, such as requesting the capital of a country. In this case, the...
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.
File format: ePUB
Copy protection: without DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Use a reader that can handle the file format ePUB, such as Adobe Digital Editions or FBReader – both free (see eBook Help).
- Tablet/Smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePUB works well for novels and non-fiction books – i.e., 'flowing' text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook does not use copy protection or Digital Rights Management
For more information, see our eBook Help page.