Skip to content
Join Post a project
How it works Sign in Post a project

Machine Learning

7 Steps to Choose the Right AI Architecture for a Business Application

7 Steps to Choose the Right AI Architecture for a Business Application

While poor quality AI may sometimes be an issue, typically lack of attention to the design of an optimised business ready AI architecture is where problems arise for businesses within both engineering and product disciplines.

Although it is feasible to produce good quality proof of concept AI using ‘prompting’ tools for access to strong LLM APIs, enhancement of that AI to meet enterprise requirements is much more involved.

Businesses will then start to implement the AI and utilise and analyse data. At the same time there is often high interest in AI. Poor AIs are readily recognised and this can lead to greater costs as well as/ or poorer performance and/or distasteful hallucinations.

Overly complicated processes can also cause problems. While many companies invest substantial resources in modifying AI and/or building autonomous (‘hive’) agents, often a well designed RAG and/or conventional non-AI based solution would have been both a faster and more cost effective option.

Below is a generic overview of 7 areas which can aid the delivery of a scalable, cost-effective and secure high value AI architecture.

7 Steps

  1. Understanding Business Requirements and Permissible Error: Define key business aims and permissible error levels.

  2. Data Analysis: Establish if your data is structured and/or unstructured, how up-to-date it is and to what extent it can be analysed and searched effectively by AI.

  3. Matching Business Requirement to Appropriate AI: Associate your business needs with one or more relevant AI options such as Prompt Engineering, RAG, Fine-Tuning and/or Agentic Workflows. Don’t blindly adhere to trends without suitable analysis.

  4. LLM and SLM and Internal and External Model Selection: Effectively move between Large and Small Language Models (LLMs and SLMs) and internal and external models.

  5. Rapid, Scalable and Software Integration: Decide upon real-time or batch processing and also embed AI into systems including CRM and ERP, amongst others.

  6. Security and Regulatory Adherence: Put in place mechanisms to manage permissions, to anonymise PII and to block prompt input. Plus, add ways of observing and analysing AI functioning.

  7. Review Total Cost, Ongoing Monitoring and Staffing: Examine additional cost considerations. Continually monitor the AI architecture and assess what needs to be developed, sourced and/or utilised.

What Is AI Application Architecture—and Why Does It Determine ROI?

An AI architecture is used to organise your data, AI and/or core models and search and control functionality so that they can effectively address a Business Need.

While AI was previously viewed as a monolithic ‘black box’, it is now commonly divided into six sections, which are organised and controlled via a bi-structure.

This approach should be adopted rather than purely utilising the best performing model available on an open source site. Indeed, even the most advanced model available can rapidly become outperformed (or be more costly by up to 70%) by another model within a short 6 month period.

By designing an AI architecture, models can easily be replaced. Sustained competitive advantage is then achieved using high calibre data, alongside precise control and evaluation and good integration with business processes.

Establish Business Need, Risk Tolerance and Required Performance

Although this stage does not involve ML and/or vector technology, it requires a specific definition of the business process/ies to be enhanced by AI. It also confirms whether generative and/or predictive AI is suitable for a given situation.

Where a problem can be addressed using clear mathematical or reference based methods (such as calculating sales tax and performing invoice calculations) standard computer software is invariably faster, cheaper and 100% accurate. AI should therefore be deployed for more complex areas involving judgement, abstraction, pattern recognition and/or language.

Establish Innovation and Risk Tolerance

Business functions can be plotted onto a matrix which shows the amount of innovation and the accompanying risk tolerance involved. This then establishes what degree of AI architecture is necessary:

High Innovation, Low Risk (internal marketing and innovation related functions): Usually a basic AI architecture will be appropriate. This will utilise a general LLM API and have well designed prompts together with basic verification facilities.

Low Innovation, High Risk (such as medical diagnosis, credit evaluation and legal document review): Strict control of AI is fundamental and must include enforced searching and referencing, solid verification, low-temperature generation, and mandatory Human In The Loop (HITL) approval.

High Volume, Well Defined Processes (for example, receiving 50,000 customer service transactions each day): Due to the high volume of work to be processed, inexpensive Small Language Models (SLM) and/or standard ML classifiers ought to be prioritised, rather than expensive cognitive models.

Pre-Code Development, Establish Precise KPIs

Teams evaluate an AI’s performance based on a handful of ad-hoc chatbot responses. It is key that you collaboratively define 4 precise metrics to ensure your AI is fit for purpose:

Process completion – Shows what percentage of processes can successfully and autonomously be completed.

Data quality and ‘allowable’ hallucination rate – This is the amount of incorrect information which can be produced. Ideally this should be under 1-2% whether this relates to consumer or regulatory data.

Time to generate a First Token (TTFT) – Ideally this should be under one second for live data. Broader timeframes must also be assessed.

Expenditure per process – Defines the maximum cost per transaction, including reasoning tokens and computation. Scalability and affordability are key.

Step 2: Review Your Data and Knowledge

While AI is advanced, if it is fed poor quality data (such as old PDFs; customers with duplicate entries and/or incorrectly formatted tables) it can confidently produce misleading information.

Data

Identify what data your AI architecture must assess.

Structured data (for example SQL, ERP and/or CRM) can be analysed using multiple tools such as Text-to-SQL and APIs. Similar to vector search, these tools further enrich analysis by enabling structured data to be queried and summarised. For example, this could identify a summary of EMEA revenue growth for quarter 3.

Semi and unstructured data (such as SOPs, guidance, Slack, PDFs and audio) can also be analysed using semantic methods. Keywords / BM25 and vector searches can then successfully be employed to search this data.

Timeliness of data

Assess how regularly your ‘source of truth’ is refreshed. If, for example, stock and/or price band information is refreshed every 5 minutes, it will not be possible to feed this into an already trained AI. Therefore either live data access or an API connection will need to be configured.

Importance of good data analysis and labelling

Generally around 60-70% of effort is dedicated to data analysis within an effective AI architecture. Efficient data analysis is especially key for unstructured data and is even more so when analysing complex data such as tables, and images together with multiple sub headings.

Intelligent tools such as OCR, vision and language analysis can be utilised in this process. Should data not be effectively analysed, key information is fragmented and therefore the search facility is unable to precisely locate that part of data which would accurately address an enquirer’s question.

Where bespoke labelling is required together with/or model training and/or stringent model testing within a particular industry, high quality test data is crucial. Usually this comprises manually checked good and bad quality example input and output data.

Should your internal engineering resources be restricted and therefore unable to effectively analyse, label and test large volumes of sector relevant data, then by utilising GigMint.AI’s AI Data Labeling experts, you can speed up your data analysis and thus release your engineers to further enhance your system.

Step 3: Choose Your Core Architectural Pattern (Prompting, RAG, Fine-Tuning, or Agents)

1. Prompt Engineering & Contextual Storage

Simple prompts can be enhanced with either a fine-tuned model and/or sample data. Building on a current model's capability to analyse and store information, high quality ‘playbooks’ and/or ‘style books’ can then effectively be made available.

Applicable for: MVPs, content production, analysis and basic categorisation. Particularly suitable where internal data can also be included within a prompt.

2. Retrieval-Augmented Generation

Your AI architecture can link to an external database (usually a combination of vector and keyword led search engine) and utilise this. As someone uses your AI, the most relevant and current content from relevant documents can be retrieved and then provided to the model as supplementary information.

Suitable for: Managing business information, customer services, policy creation and situations where it is important to reference information, as well as to have and share the latest information and avoid hallucinations. Remarkably, this does not require costly re-training of models.

3. Fine-Tuning

This is where a base model is fine tuned using high quality data. While it is commonly believed that fine-tuning is not generally the optimal method for including fast evolving factual information, it is highly effective for training AIs.

It can be used to direct an AI to utilise specific terminology within a particular industry and/or to replicate a company’s brand tone. It can be utilised to guarantee adherence to detailed requirements and also enable a large model to be condensed into a significantly smaller and quicker model, however which still retains the key elements of the original model’s operation.

Suitable for: Industry specific terminology (for example those relating to healthcare, law and financial services); advanced searching functionality; and also to cut costs and boost speed by fine-tuning a Small Language Model so that it can perform as well as a leading model – but, in just one functional area.

4. Agentic and Hybrid Working

As well as generating text, an AI agent can use a model to analyse and develop strategies. It is then able to call upon further facilities including API’s, databases and even the internet. Analysis of the outputs from these can then take place. This can continue in a cyclical fashion until the desired outcome is reached.

AI agents can often be difficult to manage and can sometimes be inconsistent. In addition, they can incur significant costs to run. Companies obtain optimum outcomes by using a hybrid AI architecture.

Within such an environment, code is utilised to manage an overarching state machine and agentic working is only implemented in situations where authentic human decision making and/or tool choice is fundamental.

Table 1: AI Architectural Pattern Comparison Matrix

Architecture

Benefits

Cost

Latency

Complexity

Use

Prompt Engineering & Contextual Storage

Fast delivery and usability

Very low

Low – Medium

Low

Marketing joint pilots, overview and quick MVP’s

RAG (Hybrid Search)

New and existing knowledge

Low – Medium

Medium

Medium (data sync)

Internal assistance, customer and legal research

Fine-Tuning

Aesthetic, organisation and speed

Medium – High

Very Low (for SLM’s)

High (retraining)

Extensive data access and niche industry classification

Agentic/Hybrid

Multi-level reasoning and tool application

High

Medium – High

High (guardrails)

Resolution of support issues, autonomous research and workflows

Step 4: Select Your Model Strategy (LLMs, SLMs, APIs, and Model Routing)

LLM’s and SLM’s

Despite frontier LLMs (hundreds of billions of parameters) being both innovative and skilled coders, using such a high calibre model to, for instance, analyse customer communications in terms of sentiment; or even to analyse receipts to obtain information, is overkill and wastes budget

SLM’s (usually 1B and up to 14B parameters) can often be used more cheaply and with much faster processing times. When appropriately prompted and/or where models are further adapted for certain business areas, they can work as well, if not better than higher-level general models. Cost of model inference can also be reduced by 80%+ and more.

Private APIs and/or On-premise Open-weight models

Table 2: Model type

Cloud

Deployment time

Cost

Data security and availability

Well suited for:

Private cloud APIs

Days

Charge for what is consumed (initial low set-up fee, then based on amount used)

Companies enter ZDR (Zero Data Retention) contracts with model providers

Entrepreneurs, SMEs and dynamic businesses. And for high-level cognitive processes.

Open-weight Self-hosted (VPC/On-prem)

Weeks/ Months

High set up expense for dedicated GPU hardware (however, economies of scale are seen at very large scale)

Complete data control – no external data dissemination

Highly regulated sectors, for instance, financial services and healthcare. Alongside high and regular numbers of queries.

Hybrid Function Dividing

2-4 weeks

Ideal choice (allowing cost-effective on-site processing of simple queries, with more involved ones conducted through API)

Confidential data is internally managed. Non-confidential processes are undertaken using API.

Developing and enterprise software in order to maximise investment and quality.

Implement an Intelligent Model Router (AI Gateway)

Rather than utilising a particular models supplier’s SDK, utilise an AI Gateway/Model Router which will sit between your AI architecture and the models suppliers.

Benefits of using an intelligent gateway include:

Analyse the complexity of an application’s request. Automatically send on 70-80% of an application’s simple requests to low cost and fast SLM models. More complex requests can then be sent to high quality LLM models.

Enable an automatic switch to an alternative models supplier if a main API is unavailable or has reached its API call quota.

Enable trialling of new models within a live AI architecture – again without needing to change your application. This also enables greater choice of model suppliers.

Step 5: Design for Latency, Scalability, and Integration Patterns

Real Time and Batch

There are two main methods of analysis:

Real Time – This includes Chatbots, Copilots and Search. People will then choose which of these is most effective at analysing in real time. In addition a token flow can be visualised. Semantic memory can then be used to allow immediate responses to frequently asked, semantically related queries. 

This does not increase the cost of tokens. As previously mentioned, this continues to boost performance, and also ensures that a response is provided in 200ms or under.

Batch, Document, Overnight and Lead Enrichment. Jobs can be added to a queue using solutions such as Kafka, SQS and/or Redis. Subsequently, your service providers will be able to utilise batch APIs. Despite being marginally less rapid than real time analysis, this is typically 50% more cost effective.

AI

Often there are excellent AIs available for utilisation. However, sometimes people are unaware of these. Rather than creating possibly uninteresting chatbots, create APIs, web-hooks and events so that your AI architecture can effectively be merged with other key areas of your business for example: CRM, ERP, helpdesk, Slack and/or website.

If you employ people who are either product and/or data science focused and require talented back and front end developers to construct high quality APIs, web-hooks and UI/UX for your AI architecture, then GigMint.AI’s Programming & Tech marketplace can be used to locate already checked suitable individuals. Excellent AI can then be incorporated.

Step 6: Bake In Governance, Security, and Compliance from Day One

Security and AI Architecture

Alongside using standards such as the NIST AI Risk Management Framework (AI RMF) and OWASP Top 10 for LLMs, there are options available for automated security related processes.

Permissions Aware Retrieval & Data Privacy

Information leakage is often considered a significant data security issue. Staff may for instance seek information from an AI about the current pay range for those in senior roles. Where your vector store contains HR data and there is inadequate control over data permissions, your AI architecture could then inadvertently share sensitive information with the incorrect person(s).

Document Level RBAC

Alongside enabling appropriate data access, this can also integrate with your existing Identity Provider (for example Okta and/or Azure AD etc.)

Remove PII

Basic data de-identification should occur prior to data being sent to external APIs. At all times therefore Personal Identifiable Information (which may encompass credit card details and/or Social Security Number (SSN) as well as medical data) should not be recognisable.

Zero Data retention (ZDR) and geographical restrictions

Within heavily regulated industries (such as those governed by GDPR, HIPAA, SOC 2 and the EU AI Act), high quality business class APIs which incorporate ZDR into their terms and conditions can be accessed. Alternatively, open weight models can be hosted within a specified geographical area. As previously noted, this can once more be achieved within a Virtual Private Cloud (VPC).

Guardrails, Least Privilege and Kill switches

Concerning AI agents:

Provide them with just view only access.

Implement guardrails to manage both data intake and output. This can then help to mitigate issues such as prompt injection, jail breaking and fake branding.

Although an AI agent is able to independently handle a refund and apply a $15 credit to a gift store account, additional expenditure of in excess of $100 must be authorised by a person. A physical button must be pressed in order to achieve this authorisation.

Persistent logging of prompts and associated sources and tools enables regulators to look back and review the reasoning underpinning particular outcomes, even several months post generation.

Step 7: Evaluate Total Cost of Ownership (TCO), Observability, and Execution Talent

How To Establish Your AI’s Total Cost Of Ownership

Alongside data analysis and distribution, prompt building, RAG, re-try and self governance can all result in increased token consumption of between 5-10x. As mentioned above, people will also use tokens.

Analysis & logging

Analysis and logging is integral for both the LLM-as-a-Judge and testing environments.

Engineering

As well as being able to amend prompts, the APIs that your AI consumes may not be compatible with previous model types. Data is also continuously evolving.

Design For Transparency & Analysis

While most computer programmes operate in a similar way, AI can be more variable. Small prompt amendments and/or suppliers not acknowledging that a model has been updated can result in small but significant adverse effects on AI functionality. However, this will not result in an HTTP 500 error.

Embed transparency into your go-to-market strategy.

Alongside assessing an AI’s functionality, it is also necessary to assess its speed. Analysis of token and lookup consumption is required. Customer views also need to be analysed.

As part of your CI/CD (Continuous Integration/Continuous Delivery), regression testing should be completed on your ‘golden’ dataset before new prompts and/or lookups and/or models are introduced.

By monitoring alterations to look-ups and customer interaction, you can ascertain whether there is potential for a decline in AI functionality. This in turn aids in ensuring that customers continue to receive good quality service.

Build, Outsource Or Hybridise And Suitable Staffing

Determine whether you are going to build and/or outsource AI functionality. Typically, non-core AI is outsourced. Core data and functions are internally created as this is where a firm’s competitive edge is.

There is no requirement to internally construct a vector database, alongside transparency and a base model. Consequently, engineering capacity can be focussed on aspects including data and customer experience coordination and analysis.

Specialist knowledge in AI architecture, engineering and data is integral to successfully completing the above 7 step process. Yet, it is often challenging to have complete specialist skills in these areas.

Usually it takes 4-6 months to obtain them. To help, numerous expanding businesses list AI architecture, chatbot(s) and/or integration functions on the GigMint.AI AI service marketplace. 

This means that you can interact with pre-screened individuals and there is further security through Stripe to manage payments (despite the fact that payments only actually occur following your approval of work). Architectural validation can thus be achieved in weeks not quarters.

AI Architecture Decision Matrix – For Common Business Situations

Below is an illustration of how the previously outlined 7 stage approach can be tailored for 4 typical use cases together with the recommended AI architecture:

Table 3 – Business Use Case To AI Architecture Cheat Sheet

Use Case

Pattern

Model and Routing

Security & Connectivity

Internal Knowledge Assistant (for example, for HR and IT helpdesk)

Hybrid RAG and Semantic Cache

SLM and middle-tier LLM API for enrichment

Real time per query RBAC security. Slack/Teams connectivity.

High Volume Data Input (for example, invoices and contracts)

Fine tuned SLM and/or Vision Language Model and batch queue

On-premise or batch API SLM to generate structured JSON data

Confidence metrics allow anomalous occurrences to be sent to a HITL queue.

Customer Support Bot

Standardised procedure with RAG and Focused Tool-calling Agent

Dual hybrid mechanism (initial categorisation using SLM and more detailed response generation using LLM)

Prompt injection. Read and write limitations on access to CRM and refund APIs.

Healthcare or Financial Compliance Analysis

RBAC RAG and Deterministic Validation

On-premise VPC and/or open weight model

No external data sharing. PII amendment. Extensive audit logging.

Frequently Asked Questions (FAQs)

Which AI am I implementing?

As well as utilising RAG, semantics and model routing, companies can avoid the potentially large costs of special equipment such as GPUs. Data can easily be managed and re-training of models is not needed. Common search requests can therefore be efficiently managed via low cost Small Language Models.

RAG or Fine Tune – which is optimum?

Choose RAG if up-to-date data, processes and/or knowledge needs to be accessed. Fine tune should be employed if there is a need to modify and standardise an AI’s response. It can also be used to ‘shrink’ a Large model and tailor it for a Small model.

When should I employ AI agents?

Agents are especially advantageous where there is a level of unknown. Highly flexible, agents can call a range of resources to provide detailed answers to enquiries about services. Generally speaking, companies prefer to follow formalised working methods. In comparison to agents, such methods are often not only cheaper but also faster and more trustworthy. AI is often included in these processes.

How can I prevent my AI from accessing sensitive information?

Role Based Access Control (RBAC) can be added to a search engine to control access to information. Automatically delete Personally Identifiable Information (PII) and then transfer information to third party APIs. High quality Zero Data Retention (ZDR) endpoints and/or a Virtual Private Cloud (VPC), can also be used for company information storage.

How long will it take me to deploy my AI?

Typically, a simple AI architecture including API provision along with basic governance and assessment features can generally be deployed within 2 to 4 weeks. More intricate AI systems including those handling personal information and connecting to Enterprise Resource Planning (ERP) software together with further refinement and/or rigorous compliance requirements are however likely to require 3-6 months for complete deployment.

Design and Deployment

Companies must decide on a suitable AI architecture in order to both manage expenses and ensure that AI is used effectively. Good processes, data cleaning and appropriate use of Prompting and/or RAG, Fine-tune and/or Bounded Agents plus suitable division of labour between Large and Small models together with appropriate governance and assessment can also support effective and cost efficient AI design and development.

Desire to transition from AI design to implementation? From requiring an AI engineer to set up a RAG system; a data expert to curate excellent test data; to a full stack developer to embed AI within your web site – you can both search our carefully selected talent pool and/or upload your own briefs onto GigMint.AI. Payments are processed securely via Stripe and are only released following your evaluation and sign off of the work undertaken.

 

All articles

More from the blog