Try

GenAI and Content Management: Best Practices and an Architectural Roadmap

Photo of Sara Williams

Sara Williams

Generative AI (GenAI) has reshaped every industry over the last few years and AI adoption has taken massive steps in this time. According to McKinsey, worldwide AI adoption has jumped to 72% across multiple organizations in the last year, up from 50% recently. 

Some of the most popular use cases include content creation, accelerated prototyping, and software development, key areas associated with content management. In this blog, we’ll provide a quick summary of our latest webinar, in which we explored the future of genAI and content management and highlighted some of the use cases for generative AI.

Current State of GenAI

AI adoption continues to grow. The same McKinsey survey indicates that 65% of respondents have used genAI in at least one business function, up from only 30% of respondents in just the previous year. The majority of organizations are using gen AI in at least two functions, the most common of which include marketing and sales and product and service development.

The foundational components of generative AI are large language models (LLMs). These include OpenAI’s ChatGPT, Google’s Gemini, Anthropic’s Claude, Meta’s Llama and Hangzhou's Deepseek. Trained on vast amounts of content and data, these LLMs identify patterns to perform various tasks, including content and code generation, idea generation, summarization, language translations, and more. However, challenges arise around bias, accuracy, and the tendency for LLMs to hallucinate.

GenAI Best Practices

To alleviate these challenges and limitations, several best practices can be followed, starting with smart prompt engineering. 

Prompt Engineering

Prompt engineering allows teams to tailor AI outputs to suit your needs, whether it’s generating marketing copy, summarizing reports, or assisting with software development.  

Some common ways to ensure efficiency, accuracy, and quality control for prompts involve contextual framing. In this instance, you provide the AI with background information or examples to better understand and tailor responses to your requests. This could involve:

  • Asking the AI to act as a type of expert
  • Constraint-based prompting, where you specify certain formats or limitations. For example, provide a 100-word summary or answer only with bullet points. 
  • Iterative refinement, where you continually adjust and retest prompts to improve the AI performance as requirements evolve. 

Best practices for prompt engineering start with being specific. The more precise you are, the clearer and more on-target the output will be. Even when using prompt engineering, you need to anticipate and test edge cases and plan for those scenarios where the model might misinterpret instructions and correct them in your prompts. You must also establish quality checks to catch any inaccuracies or inconsistencies. 

Fine Tuning

Fine-tuning is the process of taking a pre-trained LLM, like ChatGPT, and adapting it to perform a specific task or operate within a particular domain. Fine-tuning focuses on refining this knowledge using smaller domain-specific data so that it can better align with your organization’s use cases, whether that’s specialized content creation, customer support automation, or sentiment analysis.

Note that the final output is only as good as your training data, so ensuring accurate, high-quality, and diverse examples is critical to a successful fine-tuning project. However, overfitting is a risk, as if the fine-tuning data set is too narrow, the model will become overly specialized and struggle with more general queries or contexts.

Retrieval Augmented Generation (RAG)

Another best practice, which is more of an architectural approach, is retrieval augmented generation (RAG). This approach, illustrated in Figure 1, combines an LLM’s generative capability with one or more external knowledge sources. Its goal is to enhance the accuracy and relevance of AI-generated content by grounding it in real-world, up-to-date, and domain-specific content and data. 

RAG Architecture

Figure 1. RAG Architecture 
(source: https://aws.amazon.com/what-is/retrieval-augmented-generation)

  1. RAG starts with a retrieval step, where the system first takes your prompt and query and queries a structured or unstructured knowledge base, which could be a vector database, external APIs, or a combination of the two. 
  2. Next is the augmentation step, where the most relevant results from this retrieval step are fed into the LLM as contextual input, which guides the generation process. 
  3. Then, you have the generation step, where the LLM uses the enhanced prompt and the query to craft a more accurate, up-to-date, and domain-specific response. 

RAG reduces the risk of AI hallucinations by incorporating current authoritative information at the time of the query. It addresses domain relevance, similar to fine-tuning, but more cost-effectively. Organizations with specialized or proprietary data, such as technical manuals, policy documents, product catalogs, and so forth, can keep an LLM’s responses highly relevant and tailored to their use case. 

That can help keep models smaller and less expensive by offloading knowledge storage to this retriever process rather than baking it all into model parameters. Use cases include: 

  • Customer support: Equipping chatbots with real-time access to technical docs, FAQs, and product guides. 
  • Content creation: Pull internal source documentation, data, and content references to ensure that outputs are factually correct.
  • Personalized recommendations: Providing an LLM with up-to-date customer data like purchase history or browsing behavior so that it can tailor product suggestions and knowledge-based apps.

Agents

One of the fastest-growing approaches to genAI is the use of AI agents. Agents are autonomous software programs that execute tasks, make decisions, and interact with systems on behalf of a user or an organization. 

Unlike standalone LLMs or chatbots, agents operate with a higher degree of independence. They dynamically interpret goals, plan how to achieve them, and adapt to environmental changes. 

An agent has agency, so a predetermined workflow doesn’t drive it, but instead, it decides for itself the steps it takes to achieve an objective. An AI agent is goal-oriented. Given a goal or a set of goals, for example, generate a content strategy for this new product launch. It will break down those goals into actionable steps, assign itself to tasks, and execute them without requiring continual human oversight. They can reason, interact, and execute commands on behalf of your content authors or content strategists, software developers, IT operations, and so forth, and they continually learn over time. 

AI agents can learn from new data and feedback, improving accuracy and efficiency. Some key considerations for agents start with API- first platforms (such as a headless CMS), which play a crucial role in enabling agents to integrate across various services and data sources. 

For example, by prioritizing well-documented and robust APIs, headless platforms make it simpler for agents to access the functionality and content they need, as well as oversight and control. So, while automation drives efficiency, human governance is still essential to prevent errors, security issues, or unintended consequences. 

CMS Use Cases

Below are some use cases related to content management and digital experience development, where you can put these genAI systems, techniques and best practices to work for you: 

  • Authoring Use Cases: Content generation, content optimization, auto-tagging, categorization, scheduling, translation/localization, variant creation, asset type transformation, and user-generated content analysis. 
  • Developer Use Cases: Code generation, template generation, landing pages, microsites, code reviews, test cases and integrations. 
  • End-user Experience Use Cases: Chat assistants, customer service, enhanced search, personalization, customer and employee onboarding, product selection, automated A/B testing, and lead qualification. 

Architecture for GenAI Applications

Now let’s look at a high level architecture for CMS-centric GenAI apps.  Our architecture is going to start with three distinct layered spaces, as shown in Figure 2 below.

GenAI CMS Architecture
Figure 2. GenAI CMS Architecture

1. GenAI Architecture: Data and Services Layer

At the base is a layer for data and services. In this space we find core AI capabilities services and data stores such as LLMs, vector stores, stable diffusion services, speech to text and text to speech services, and vision and recognition systems. 

LLMs are the fundamental, key GenAI service that process, interpret and generate human language. Vector stores are specialized databases for storing and retrieving embeddings, which are data that is vectorized into multi-dimensional space in a way that represents relationships between the data points. Stable diffusion is a specialized type of genAI model that can be used to generate images and video.

2. GenAI Architecture: Orchestration Layer

The next level above the data and services layer is the orchestration layer. In this space we find frameworks for coordinating and orchestrating AI workloads with a couple of objectives in mind. The first objective is to abstract interactions with the services and stores in the layer below so that we can more easily plug and play with different platforms and vendors without needing to rebuild our workloads or our apps and agents that rely on them. Another objective is to provide pluggable templates for common boilerplate usage patterns like the RAG pattern we discussed above. 

The third objective is to provide a place for our domain-specific actions. Here are some popular orchestration Frameworks that we see today Langchain for those working in Python; Langchain4J is a Java based implementation of the same framework  We also have SpringAI which is also a Java based orchestration framework that is woven neatly into the Spring/Java stack. These are just a few of the emerging frameworks out there.

3. GenAI Architecture: Application Layer

Building above the orchestration layer is our AI apps layer. It's through this space that our end users will interact with our AI apps. AI assistants guide and monitor. AI agents, also in this layer in the context of content management, is where we're going to see a stark distinction between content authoring (i.e., the AI-enabled CMS experience) and content delivery (i.e., the AI-enabled end-user site/app experiences) 

For some examples on the content authoring side, just to name a few, are genAI capabilities built directly into Crafter Studio (CrafterCMS's UI) such as content generation. We also have a plug-in framework in the CrafterCMS Marketplace where you can find pre-built AI-enabled capabilities. Here you'll also find interfaces to task AI agents with authoring use (e.g., content creation, summarization, ideation).

Use cases on the content delivery side include: 

  • AI chatbot assistants 
  • AI-backed search and personalization
  • AI agents focused on supporting larger customer journey workflows 

CrafterCMS Architecture for GenAI Applications

In Figure 3, we can see that CrafterCMS can help you in each of the three architectural layers (highlighted in red).

GenAI CrafterCMS Architecture

Figure 3: GenAI CrafterCMS Architecture

In particular,  CrafterCMS provides the most support in the orchestration layer where we build on on top of general orchestration frameworks like SpringAI. This gives you pluggability in the data layer as well as boilerplate templates for AI workloads with additional content management specific and CrafterCMS-specific capabilities and SDKs. 

These also reach up into the app tier with SDKs for common UI and other types of interaction modalities that you can leverage in your own authoring plugins, or for building your site/app visitor experiences on the content delivery side. 

In the data and services tier, CrafterCMS is agnostic, and to enable GenAI use cases we provide out-of-the-box integration with LLMs such as OpenAI’s ChatGPT. CrafterCMS also bundles in OpenSearch into both its content authoring and content delivery systems, which in addition to its typical role as a search index, can also serve as a vector store for embeddings that can be leveraged by your AI workloads.

In summary, CrafterCMS provides a future-proof architecture for all your  GenAI application use cases -- both for content authoring and for your end user site/app experiences.

Learn More

View our recorded webinar: The Future of GenAI and Content Management to learn more about how CrafterCMS natively supports generative AI use cases for all your content managed digital experience applications. 

Share this Post

Related Posts

Related Resources