Skip to content
maxxby ScaleXRequest access
← All articles
AI, Honestly

Enterprise AI infrastructure for dummies

Part 1 follows a buyer’s chatbot question from a November invoice to the contract clause that settles the rate.

ScaleX paperback cover with Alex Rochlitz in a suit and tie, labeled Exhibit A.

Say you're a buyer with an invoice open, and you ask your trusty corporate chatbot, "What is my rate for this contract?" You've done the work, connected your contracts, you're feeling confident… You'll get a number. It can be a real number, copied correctly from a signed contract, and still be the wrong one. The complete answer for how to get this right is super complicated. In fact, my team and I have been spending the better part of our lives lately figuring it out! If I was going to summarize the “work” involved in doing this, I would say things like “database schema development” and “application inference” and “relational context.” There is AI involved, but there is also a lot of very traditional application building and database configuration work. If you understand how spreadsheets and pivot tables work, you can wrap your head around this stuff (I promise).

Here's a made-up example. Your master agreement sets a senior engineer at $140 an hour. Amendment 2 raised that to $150 on July 1. Amendment 3 is signed too, and it takes the rate to $156 on January 1. It's December, and an invoice for November work just came in. Which rate was in force?

It's $150. You got there because you know how amendments work. Software only gets there if somebody builds that in, and most of that work happens outside the model.

Everybody wants to talk about building AI or using AI, but most people don't understand how that's done. The main reason is that up until like a year ago there were “tech people” whose job it was to do this stuff, and then there was everyone else. Now “everyone else” is being asked to build AI without any basic technology and infrastructure education. So here are the parts, using that one rate as your ‘outsourcing example’.

A fictional signed contract amendment with USD 150.00 per hour highlighted, an invoice with November 16 circled, and a phone showing a chatbot reply of $150 an hour that cites Amendment 2, clause 1, page 1.
A mock-up with made-up documents. The chatbot's $150 comes from the clause highlighted on the signed page.

What you actually licensed

A model takes what you give it and generates a response. A prompt you send or a button you click can run the model once, several times or not at all. Each run is called inference. The model works through the text it was sent and writes a reply a small piece at a time, and that's the core of what you're paying for. Your license may also include a chat app and some connectors. It doesn't come with your contracts already organized.

The software around the model is called the harness. It gathers what the model needs to see, checks what comes back and decides when to stop. In one kind of agent, the model decides it needs a lookup and the harness runs the tool for it. Think of a “gated” agent built for one job, with limits on what it can look up or change. A general chatbot like the ChatGPT app on your phone can handle a wider range of questions. What either one can do depends on the tools and permissions you give it. The chatbot in this example always looks up the rate first, then gives the model that rate and the clause it came from.

The app and the code behind it

The interface is the screen where you ask the question and see the answer (e.g. your web browser page or desktop application). Behind it, the application handles the request and returns the result. Its source code sits in a repository, usually managed with Git (GitHub is cool), which keeps a history of changes. A release is one version of that code, packaged to go live. The runtime is the environment that runs it, and compute is the processing power and memory it uses.

So a fix can be sitting in the repository while everyone is still using last month's release. If the rate logic was fixed on Tuesday and the answer is still wrong on Thursday, ask your agent what's been released.

Building and hosting the chatbot

Say my team is building this chatbot. The chat screen is a small website on a static web host, a service that stores the page's files and sends them to your browser. When you ask about the invoice, the browser sends your question, the invoice line and a session token from sign-in to our backend over HTTPS. The database, its password and the model key never go to the browser.

The backend is the code we write, harness included, and on AWS it could run in a container on ECS Fargate. A container packages our code with the other software it needs, and Fargate supplies the computing power to run it. The backend checks your sign-in, then runs a rate lookup we wrote ahead of time. It runs a read-only SQL query, a request for specific rows in the database. It takes the supplier, role and work date, and returns the matching rate and its signed clause if you're allowed to see them.

Then the backend calls the model, which a provider hosts separately. The model gets your question, the $150 rate and the clause, and writes the reply. It has no database credentials. The backend controls which records it can see. The backend checks the reply against the rate and clause it looked up, then sends it to your screen with the source.

The signed PDFs could live in S3, with the rates and search index in RDS for PostgreSQL. When an amendment arrives, a separate job extracts a proposed rate and records where it found the clause. A person approves it before the new row becomes available for lookups. That runs separately, so a question in the chat can't change a rate.

For a release, we package the code from Git and test it in staging, a private copy of the setup. November has to come back as $150 and January as $156 before deployment puts that version in front of buyers. We keep the last one so we can roll back. The hosting here is an example. The rate lookup in the pictures did run, on a local computer with made-up data.

Flowchart of one chatbot question. It goes from a laptop through a sign-in check to the app server, which reads the rate rows and signed PDFs, sends them to a separately hosted model, checks the reply and returns $150 to the laptop. Separate dashed arrows show tested code being released to the server and a person approving new rates.
Follow the question out from the laptop and the answer back along the yellow arrows. The server looks up the rate and clause, gives both to the model, then checks its reply. The dashed arrows show what the team set up before the buyer asked.

The PDF, the field and the answer

The signed amendment is a PDF in file storage. That's the page you'd pull up if the supplier disagreed with you. The database holds the facts taken from it, in rows you can search and compare. One row says senior engineer, $150 an hour, starting July 1, 2026, from Amendment 2, clause 1. The model uses that row to write the reply you read. Ask about the same invoice tomorrow and the wording might change, but the rate and the clause should match.

A schema is the plan for the database. It defines which fields exist, what kind of value each one holds and how they connect. This part got really overwhelming for me while we were working on Maxx v3. One contract can have many rates, and each rate has its own type, location, currency and billing terms. A single rate field can't hold that. Rates need their own table, with every row tied to its contract, the amendment it came from and the dates it applies.

Contract start and end dates aren't the hardest thing to pull out. It gets hard when rates, service levels and services sit in different sections of one document, with a stack of amendments on top. Someone has to decide which clause wins, and the software needs that decision as a rule.

Finding the right page and the right supplier

Retrieval means finding relevant material and giving it to the model before it answers. It usually relies on an index, a searchable map of your documents. Search will find pages about engineer rates, and all three of ours qualify. Picking one still takes the dates and the amendment rule.

The invoice is in another system. An API is the defined way for one piece of software to request data or an action from another. A connector uses it to link the two. MCP, or Model Context Protocol, is a standard way to offer tools and data to AI applications, often with those same APIs underneath. Our rate lookup could be offered that way, so other AI apps could use it with the same access checks.

None of that tells you which vendor records belong to the same company. A customer described this to me recently. A single supplier can have a long list of IDs in their ERP, because each one maps to where a payment goes. Finance needs those IDs. The rate question also needs a canonical identity, one master supplier record they all point to.

Who can see it and what can change it

Authentication confirms who you are. Authorization decides what you can see and do. A buyer with access to this contract gets the $150. Someone without access can ask the same question, and the lookup should come back empty. The systems holding the data have to enforce that, and so does the search index. Telling the model to keep rates confidential won't protect them.

Now say Amendment 4 arrives with a new rate for next July. The harness can pass the permitted text to the model, which can propose a new row for the rate table, and I'd stop it there. One piece of ordinary code should be the only way to write to that table. Think of it as an approval gate. It checks that the amendment is signed, the supplier matches, the dates don't conflict and an authorized person approved the change. It also recognizes a repeat request, so a retry doesn't add the same rate twice. That's classic software development, and it's a big part of making AI safe to use.

Logs should record who asked, which records were used, which model and release ran, and what it cost. Model charges usually depend on how much text goes in and out, and compute, storage and search add to the bill. Rereading every amendment for each question will usually cost more than looking up a row that's already been checked. Logs help you see whether you're doing something that's productive or just doing something that's expensive.

What people mean by training

Say the app answers $156. You correct it in the chat and it apologizes. The model's weights, the numbers it learned during training, haven't changed. Where the fix goes depends on what broke.

The instructions and the clauses retrieved for this question are its context. They last for that call. If you want the app to remember a correction next week, it needs durable memory. That means saving the correction somewhere the app can look it up later, such as the case history in the database. If a new amendment arrives, the file and its search index need updating before the next lookup can find it.

If a start date is wrong, fix the database record. If the app ignored the dates, change the prompt or the code and save the new version in the repository. If the wrong person could approve a rate, change the configuration. Then add the question to your evals, the test cases you run before a release. Ours expects $150 for November and $156 for January.

Actual training changes the weights, or adds a smaller set of them called an adapter, which is usually saved separately. That can help with a repeated task, like reading your rate tables. I wouldn't use it to store a rate that changes in January.

A database query with three senior engineer rates: $140 from January 2025, $150 from July 2026 and $156 from January 2027. The $150 row is highlighted as the result for November 16, 2026, and the query returns $156 for January 4, 2027.
The same lookup run for two dates, on a local computer with made-up data. November work gets $150 and January work gets $156.

When you change models

You may replace the model next year. The contracts, rate table, supplier records, amendment rules, permissions, evals and logs should all still be there. That's your AI infrastructure, and most of it would help your team check that invoice with no model at all. So if somebody asks how the chatbot knew the rate, you can tell them. It checked who you were, found the rate for the date the work was done, gave the model that rate and its clause, and checked the reply before you saw it.

Technical references

Workflows and agents · Retrieval · AWS Lambda · Git

MCP architecture · Safe retries · MCP authorization · Database row permissions

Testing AI agents · How adapters are stored

Hosting containers on AWS Fargate · Managed PostgreSQL · S3 file storage

Glossary

TermDefinitionContext
APIapplication programming interface. A defined way for one piece of software to ask another for data or an action.The chatbot could use the invoice system's API to get the November work date.
Approval gateA check the application enforces before it allows a change. It can require a human to approve the exact record being saved.The chatbot can propose a new rate from Amendment 4. The gate checks the signed document and the reviewer’s approval before the rate becomes available to buyers.
Authentication and authorizationAuthentication checks who you are. Authorization checks whether that identity has permission to read a particular record or take an action.Two buyers can both sign in, but only the one with access to this contract gets the $150.
Backend and user interfaceThe interface is the screen you use. The backend is the code behind it that does the work out of sight.You type the rate question into the interface. The backend runs the lookup and calls the model.
Canonical supplier identityOne master record that ties together all the IDs a supplier has across your systems.The invoice may use one supplier ID and the contract another. The master record shows they're the same company.
Compute and runtimeCompute is the processing power and memory software uses. The runtime is the environment that runs the code.The backend needs both to run the rate lookup. If it's short on compute, your answer may be slow.
ConnectorSoftware that links two systems, usually through an API.A connector could bring the invoice line into the chatbot so you don't have to retype it.
ContainerA package that holds an app's code and the other software it needs to run.The container that passed the $150 test can be the same one that goes live.
Context and promptContext is the information available to the model on a call. A prompt is the request or instructions it receives, and can include supporting material.The prompt says to answer using the clause provided. The context also includes the $150 rate and the clause itself.
DatabaseAn organized store of facts that software can search, compare and update.It holds the $140, $150 and $156 rates with their start dates, so the lookup can compare them.
Durable memoryInformation an app saves outside the model so it's still there later. Developers may call it stored state.You correct a wrong $156 answer today. The saved case history lets the app find that correction next week.
ERPenterprise resource planning. The system a company uses to run finance, purchasing and other core operations.Finance may keep several IDs there for this supplier, each tied to where a payment goes.
EvalsShort for evaluations. These are test cases that check whether an AI app gives the answers you expect.Ask for the November rate and expect $150. Ask for January and expect $156.
File storageA place to keep whole files, such as PDFs, in their original form.It keeps the signed Amendment 2, so you can open the page if the supplier disputes the $150.
Git and repositoryA repository holds a project's code and its history. Git is the tool that tracks the changes.If the rate logic changes on Tuesday, you can see which lines changed and who changed them.
Harness and agentThe harness is software that supplies information, runs tools and checks replies. In an agent, the model can choose a tool to call within limits the harness enforces.If the model writes $156 for the November invoice, the harness can catch that it doesn't match the lookup.
HTTPSHypertext Transfer Protocol Secure. The secure way browsers and servers exchange data. It encrypts the data while it travels.It protects your question and invoice line on the way to the backend, and the answer on the way back.
InferenceRunning a trained model on new input to get a response.Once the backend has the $150 and its clause, inference turns them into the sentence you read.
LogsTime-stamped records of what a system did.If someone questions the $150, the logs can show who asked, which row was used and which release was running.
MCPModel Context Protocol. A shared standard for connecting AI apps to tools and data.A separate purchasing assistant could use the same rate lookup through MCP.
ModelThe trained part of an AI app that takes in information and generates a response.It writes the reply about your rate. The $150 itself comes from the database.
Release, deployment and rollbackA release is a version prepared for use. Deployment puts it into service. A rollback restores a previous version if the new one causes problems.If a new release starts answering $156 for November, the team can go back to the last one that got it right.
Retrieval and search indexRetrieval finds relevant material and gives it to the model. A search index is the map that helps find it quickly.A search for engineer rates finds all three documents. The work date and amendment rule narrow it to Amendment 2.
SchemaThe plan for a database. It sets which tables and fields exist and how they connect.It gives each rate a start date and a link to its amendment, which the lookup needs to choose between $150 and $156.
Session tokenA temporary credential that identifies a signed-in session. The backend checks it before trusting the identity attached to the request.It tells the backend the rate question came from you, without asking for your password again.
SQL queryA query is a request for specific records in a database. SQL, or Structured Query Language, is a common language for writing one.The lookup asks for this supplier's senior engineer rate on the November work date and gets the $150 row.
StagingA private copy of the app's setup where changes are tested before they go live.The team asks for the November rate here first, so a wrong answer can be fixed before a buyer sees it.
Static web hostA service that stores a website's ready-made files and sends them to your browser.It delivers the chat screen. The contract rates are stored separately in the database.
Table, row and fieldA table holds records of one kind. Each row is one record, and each field is one detail in it.One row in the rate table is for the senior engineer. Its rate field says $150 and its start date field says July 1.
Training and fine-tuningTraining uses examples to adjust a model's weights. Fine-tuning is extra training for a narrower task.Fine-tuning might help a model read the rate tables in amendments. The January change to $156 belongs in the database.
Weights and adapterWeights are the numbers a model learned in training. An adapter is a smaller set added to adjust how it responds.Telling the chatbot that $156 is wrong for November doesn't change either one. The fix may be a start date or the code.

Over to you

What's one AI term you've nodded along to in a meeting and still couldn't explain to someone else?

Reply to Alex by email