Everything AI – RAG, MCP, A2A integration architectures

Context

In this blog post, we are going to explore Agentic AI prominent integration architectures. We are going to discuss RAG, MCP and A2A architectures. If you are not familiar with these terminologies, don’t worry as you are in good company. Let us begin with how we got here in the first place.

What is an Agentic AI?

An AI agent is a system designed to pursue a goal autonomously by combining perception, reasoning, action, and memory. Often built using a large language model (LLM) and integrated with external tools. These agents perceive inputs, reason about what to do, act on those plans, and whilst also remembering any past interactions (memory).

We will now expound more on some of the key words below:

  • Perception – this is how your agent recognises or receives inputs such as a user prompt or some event occurring
  • Reasoning – this is the capability to break down a goal or objective into individual steps, identify which tools to use and adapt plans. This will usually be powered by an LLM
  • Tool – is any external system the agent can call or interact with, such as an API call or a database
  • Action – is the execution of the plan or decision by the agent, the act of sending an email for example, or submitting a form. Agent will perform the action leveraging the tools

What is Retrieval Augmented Generation (RAG)?

Carrying on with our AI agent conversation, suppose we need to empower our agent with deep, factual knowledge of a particular domain. Then RAG is the architectural pattern to use. As an analogy, think of RAG as an expert with instant access to your particular domain knowledge.

This pattern allows us to connect an LLM to an external knowledge source, which is typically a vector database. Therefore, the agent’s prompts are then “augmented” with this more relevant, retrieved data before the final response is generated.

Key benefit

With RAG, agents drastically reduces “noise” or “hallucinations” ensuring that the responses and answers are based on specific and latest domain knowledge or enterprise data

Some use cases

  • Q&A scenarios over Enterprise Knowledge – think of an HR agent that answers employee questions by referencing HR policy documents. Ensures the answers are accurate and citations of policies
  • Legal Team agent – that analyses company data rooms, summarizing risks and cross-referencing findings with internal documents and playbooks

What is Model Context Protocol (MCP)?

MCP is an open-source standard for connecting AI applications to external systems. As an analogy, think of MCP as a highly skilled employee who knows exactly which department (API) to call for a particular task.

MCP architecture, adapted from: https://modelcontextprotocol.io/docs/getting-started/intro

This is an emerging standard for enabling agents to discover and interact with external systems (APIs) in a structured and also predicable manner. It is like a USB-C for AI agents

Key benefit

MCP provides a governable, secure and standardized way for our agents to take action and interact with enterprise systems, doing more and going beyond simple data retrieval as in the use cases for RAG

Some use cases

  • Self-service sales agent – think of a Sales agent that allows a salesperson to create a new opportunity in a company CRM, then set up and add standard follow-up tasks as required. The agent does discovery of available CRM APIs, understand the required parameters and executes the transactions securely.
  • An accounting agent – think of automated financial operations where upon receiving an invoice in a email inbox, the agent calls the ERP system to create a draft bill, match it to Purchase Order and schedule a payment.

What is Agent-to-Agent (A2A)?

This does what is says on the tin. Multiple, specialized or utility agents collaborate to solve a problem that is too complex for a single agent. The graphic below illustrates this collaboration. As an analogy, think of a team of specialists collaborating on a complex project.

Key benefit

A2A enables tackling highly complex, multi-domain problems by leveraging specialized skills, similar to a human workforce.

Some use cases

  • Autonomous product development team – think of an autonomous product development teams consisting of “PM agent”, “Developer agent”, “QA agent” all working together. PM writes specs, Developer writes code and QA tests the code, iterating until a feature is completed. Specialization means agents can achieve higher quality of outputs at each stage of a complex workflow.

So which is it, RAG, MCP or A2A?

As architects we often rely on rubrics when we need to make architectural decisions. With Agent AI solutions, you can use a set of guidelines that best helps you assess the business domain problem and come up with the right solution. Below is an example rubric to help with your assessments and criteria when to leverage RAG, MCP or A2A.

Start with a goal

Agentic AI solutions are not any different. There is no “one size fits all” solutions. Always start with a goal, business objective so you can map the right Agentic AI solution for it. Sometimes Agentic AI many not be the right solution at all, don’t just jump on the bandwagon.

Trends and road ahead

Agentic AI is at very early stages and expect more emergence patterns in coming days and months. We may need to combine RAG and MCP and leverage a hybrid approach to solving AI problems. We already seeing the most valuable enterprise agents are not pure RAG or MCP but a hybrid.

Next steps

In this blog post, we looked at prominent integration architectures in this age of Agent AI. We explored RAG, MCP and A2A architectural patterns. We also looked at some of the use cases for each as well as key benefits we get from each pattern. We finished with a sample architecture rubric that can be leveraged.

Stay tuned for future posts, feel free to leave us comments and feedback as well.

Step-by-step guide to integrating with Sitecore Stream Brand Management APIs

I previously blogged about Sitecore Stream Brand Management and looked at a high level architecture on how the Brand Kit works under the hood. Today, I continue this conversation and look at a more detailed step-by-step guide on how you can start integrating with the Stream Brand Management APIs.

As a quick recap, Sitecore have evolved the Stream Brand Management to provide a set of REST APIs to manage life-cycle of the brand kit as well as getting a list of all brand kits. You can now use REST APIs to create a new brand kit, including sections and subsections, and create or update the content of individual subsections. You can also upload brand documents and initiate the brand ingestion process.

  • Brand Management REST API (brand kits, sections/subsections)
  • Document Management REST API (upload/retrieve brand documents).

These new capabilities opens opportunities such as allowing you to ingest brand documents directly from your existing DAM. You could also integrate them with your AI agents so that you can enforce you brand rules

Step 1 – Register and get Brand Kit keys

Brand Management REST APIs use OAuth 2.0 to authorize all REST API requests. Follow these steps below:

a) From your Sitecore Stream portal navigate to the the Admin page and then navigate to Brand Kit Keys section, as shown below.

b) Then click on Create credential button which opens the Create New Client dialog similar to one shown below. Populate with the required client name and a description, then click on Create

c) Your new client will be created as shown below. Ensure you copy the Client ID and Client Secret and keep them in a secure location. You will not be able to view the Client Secret after you close the dialog.

Step 2 – Requesting an access token

You can use your preferred tool to a request the access token. In the sample below, I am leveraging Postman to send a POST request to the https://auth.sitecorecloud.io/oauth/token endpoint.

  • client_id This is the Client ID from previous step
  • client_secret This is the Client Secret from previous step
  • grant_type This defaults to client_credentials
  • audience This defaults https://api.sitecorecloud.io

If successful, you will get the response that contains the access_token as shown below

  {
    "access_token": "{YOUR_ACCESS_TOKEN}",
    "scope": "ai.org.brd:w ai.org.brd:r ai.org.docs:w ai.org.docs:r ai.org:adminai.org.brd:w ai.org.docs:w ai.org:admin",
    "expires_in": 86400,
    "token_type": "Bearer"
  }

Step 3 – Query Brand Kit APIs

You can start making REST APIs securely by using the access token in the request header.

Get list of all brand kits

Below is a sample request that I used to get a list of available brand kits for my organisation. I am leveraging Postman to send a GET request to the https://ai-brands-api-euw.sitecorecloud.io/api/brands/v1/organizations/{{organizationId}}/brandkits endpoint.

You can get your organisationId from your Sitecore Cloud portal

https://portal.sitecorecloud.io/?organization=org_xyz

Full list of Brand Kit REST APIs

Sitecore API Catalog lists all the REST APIs plus sample code on how to integrate with them. Below is a snapshot of the list of operations at the time of writing this post:

Ensure you are using the correct Brand Management server. Visit Sitecore API catalog for list of all the servers. Below is a snapshot of the list at the time of writing this post:

Next steps

Have you started integrating Sitecore Stream Brand Management APIs yet? I hope this step-by-step guide helps you start exploring the REST APIs so you can integrate them with your systems.

Stay tuned for future posts, feel free to leave us comments and feedback as well.