AI Integration · Databases & Applications

AI database integration on the data you already govern

AI database integration connects AI models and agents to your databases, data warehouses and business applications, so they can retrieve, interpret and use business information without anyone exporting a spreadsheet first. Twopir Consulting designs the access layer in between: approved queries, APIs and MCP servers, read-only where it should be, with your permissions enforced on every request. Your data stays where it is. The AI gets only what it is allowed to see.

Governed AI Data Access
AI APPLICATIONS & AGENTS Assistants & Agents OpenAI · Claude · Bedrock · Vertex Business Users Questions in plain language Natural-Language Query AI Reporting Agent Workflows TWOPIR GOVERNED ACCESS LAYER MCP Servers Approved tools Resources · Prompts Scoped APIs Named operations Auth · Rate limits Middleware MuleSoft · Workato Multi-system flows READ-ONLY BY DEFAULT · ROW-LEVEL PERMISSIONS · EVERY CALL LOGGED 2πr YOUR DATA, WHERE IT LIVES Databases PostgreSQL · MySQL SQL Server · MongoDB Warehouses Cloud data platforms on AWS · Google Cloud Applications CRM · ERP · Custom and legacy systems DISCOVER · DESIGN · BUILD · VALIDATE · LAUNCH · OPERATE
500+
Clients Served Across Global Markets
12+
Years of Salesforce & HubSpot delivery
10+
Countries Served
15+
Certified Platform Partnerships

Trusted by 500+ organizations, including technology, SaaS and professional-services companies connecting their CRM, data and AI with Twopir Consulting.

Platform9
Mitratech
Spinify
Hey Market
Fix Stream
Kacific
LegalZoom
Ultra Consultant

Platforms We Connect

  • Salesforce Partner
  • HubSpot Partner
  • Model Context Protocol
  • OpenAI
  • Anthropic Claude
  • AWS
  • Google Cloud
  • MuleSoft
  • Workato
Where AI Projects Stall

The model is ready. The data access is not.

Most AI pilots work in a demo because someone pasted the data in by hand. They stall when the same assistant has to reach a production database, a warehouse and three business applications on its own, safely, every day. These are the six gaps we are most often asked to close.

Answers still start with an export

Someone runs a report, downloads a CSV and uploads it to a chat window. The answer is only as current as the file, the file now lives outside your controls, and the work repeats tomorrow.

One powerful credential for everything

The fastest prototype connects the AI with an admin login. That account can read every table and change every row, so the model's reach is now wider than any single user who asks it a question.

Generated SQL nobody checks

A model writing free-form queries against production can join the wrong tables, scan millions of rows or return a confident number built on a misread column. Without validation, nobody notices until a decision is made on it.

Sensitive fields reach the prompt

Salaries, health details, card or bank data and personal contact fields sit in the same tables as the useful columns. If the access layer does not exclude or mask them, they travel to the model with everything else.

The systems that matter have no API

Custom-built applications and legacy systems often hold the operational truth, yet expose nothing an AI agent can call. Teams either leave them out of the answer or let the model reach straight into the database underneath.

No record of who asked what

When an answer is questioned, nobody can show which tool ran, which query it sent, whose permissions applied or what data came back. Without that trail, security and compliance teams stop the rollout, and they are right to.

Definition

AI database integration, defined

AI database integration is the work of connecting AI models and AI agents to an organization's databases, data warehouses and business applications, so they can retrieve, interpret and act on business information through controlled access, instead of relying on data someone exported by hand. It covers how the AI reaches each system (directly, through an API, through a Model Context Protocol server or through middleware), which operations it is allowed to perform, whose permissions apply to each request, how sensitive fields are protected, and how every call is validated and logged.

Three parties are involved, and it helps to keep them apart. The model providers, such as OpenAI, Anthropic, AWS and Google Cloud, supply the models and the tool-calling interfaces that let a model request data. Your data platforms, such as PostgreSQL, MySQL, Microsoft SQL Server, MongoDB and your warehouse, store the data and enforce their own roles and security policies. Twopir Consulting designs and builds the layer in between: the connectors, APIs and MCP servers, the access model and the safeguards described on this page. The open standard for that layer is described in the Model Context Protocol documentation.

What changes once it is in place? A sales lead asks for an account's open orders and gets them from the ERP and the CRM in one answer. A finance manager asks how this quarter's renewals compare with last year's and the query runs against the warehouse, under their own access, without a ticket to the data team. The data never moves to a new platform, and the AI sees only what the person asking is allowed to see.

This page covers the data and application layer. For the wider programme, including use-case selection, model choice and AI inside your CRM, see our AI integration services.

Integration Patterns

Four ways to connect AI with enterprise data

There is no single right connection. Each pattern trades speed of setup against control, and most production estates use two or three of them side by side. This is how we decide which one each system gets.

Direct, API, MCP and middleware connectivity compared. The access design records which pattern each system uses and why.
PatternHow it worksBest suited toWhat has to be controlled
Direct database connectivityThe AI application holds a database connection and runs SQL or database queries itself, often generated by the model from the question.Analytics on a read replica or warehouse, internal prototypes, and well-modelled reporting schemas.A read-only role, a replica rather than the primary, row-level security, statement timeouts and row limits, and validation of every generated query before it runs.
API-based integrationThe AI calls named operations on a service you own, such as "get open orders for account", and the service runs the query it was written to run.Production systems, write operations, custom and legacy applications, and any data with strict business rules.Authentication per user or service, scopes per operation, input validation, rate limits and versioning. The model never sees the SQL.
MCP-based connectivityAn MCP server exposes approved tools, resources and prompts through the open Model Context Protocol, so any MCP-capable AI client can discover and call them in a standard way.Several AI assistants or agents sharing the same data operations, and teams that want one governed interface rather than one integration per model.Which tools exist and what each may do, server authorization, the identity passed through to the data source, and human approval for anything that changes data.
Middleware-based integrationAn integration platform such as MuleSoft or Workato sits between the AI and many systems, orchestrating calls, transforming data and applying shared policies.Answers that need several systems at once, estates that already run an integration platform, and processes with retries, queues and approvals.Policies on the exposed endpoints, connector credentials, data mapping between systems, and monitoring of each flow the AI can trigger.
Our Default

Named operations before open queries

For production data we start with APIs or MCP tools that run reviewed, parameterised queries. The model chooses which approved operation to call and supplies the parameters; it does not write the query.

That keeps the behaviour predictable, testable and easy to audit.

When Open Queries Fit

Natural language to SQL, fenced in

Exploratory questions against a warehouse are where generated SQL earns its place. We give it a curated, documented schema, a read-only role and a replica or warehouse, then validate and limit every statement before it runs.

The flexibility stays; the blast radius does not.

What We Connect

From the database layer to the business application

Six workstreams make up most engagements. Each starts from the system as it is today, and none of them requires moving your data to a new platform before the AI can use it.

Relational & Document Databases

AI access to PostgreSQL, MySQL, Microsoft SQL Server and MongoDB, through a dedicated read-only identity, a replica where load matters, and the database's own row and column controls.

  • Dedicated AI roles with least privilege
  • Read replicas for analytical load
  • Row-level security and column exclusions
  • Curated views instead of raw tables
  • Statement timeouts and row limits

Warehouses & Cloud Data Platforms

Natural-language and AI-assisted analysis on the warehouse your reporting already trusts, on AWS, Google Cloud or elsewhere, with a documented semantic layer so the model reads metrics the way finance does.

  • Curated datasets and metric definitions
  • Business glossary the model can read
  • Cost and scan limits on AI queries
  • Dataset-level access by role
  • Lineage back to the source system

APIs & MCP Servers

Approved database operations and application functions exposed to AI agents as named tools, through APIs you own or MCP servers any MCP-capable client can use, each with its own scope and tests.

  • Tool catalogue designed per use case
  • Parameterised, reviewed queries
  • Server authorization and identity pass-through
  • Approval steps for any write operation
  • Versioned tools with automated tests

Internal, Custom & Legacy Applications

A safe interface for the systems that never had one: an API or MCP layer in front of a custom-built application or legacy database, so agents can use it without touching its tables directly.

  • Wrapper APIs for systems without one
  • Business rules kept in the service, not the prompt
  • Load protection for older systems
  • Read-only first, writes added deliberately
  • Documentation for your own developers

CRM & Business Software

AI that reads and updates the systems teams work in every day, Salesforce first, with HubSpot, ERP and finance systems connected, so an answer about a customer includes what the CRM and the back office both know.

  • Salesforce and HubSpot data access by profile
  • ERP, billing and support system lookups
  • Record updates through approved actions
  • Sharing rules respected end to end
  • Activity logged on the record

Middleware & Multi-System Flows

Several databases and applications joined behind one governed interface on an integration platform such as MuleSoft or Workato, so the AI asks once and the platform handles the systems, mappings and retries.

  • AI-callable endpoints on your existing platform
  • Cross-system data mapping
  • Shared policies and connector credentials
  • Queues and retries for slow systems
  • Flow-level monitoring and alerts
Security & Governance

Every request answers to your existing permissions

An AI integration should never become a second, looser way into your data. We layer the controls your databases already provide with checks in the access layer, so the model can only do what the person or process behind it is allowed to do.

ControlWhat it enforces
Read-only by defaultAI identities get read access only, granted through the database's own roles (for example SELECT-only grants in MySQL or a read role in MongoDB). Write access is added per operation, never as a blanket grant.
Authentication & least privilegeEach AI application or agent has its own identity and scoped credentials held in a secrets store, never a shared admin login or a key inside a prompt.
Row-level permissionsUsers see only their rows, enforced in the database where it supports it, such as PostgreSQL row security policies and SQL Server Row-Level Security, or in the API when it does not. AI roles never own the tables or carry a bypass privilege, which would skip the policies.
Sensitive informationPersonal, financial and health fields are excluded from AI views, or redacted before results leave the access layer. Masking features such as SQL Server dynamic data masking help, but Microsoft documents them as one layer among several, so we never rely on masking alone.
Query restrictionsAllow-listed operations and curated views, parameterised queries, statement timeouts, row limits and scan limits, so no single question can overload a production system.
Query validationGenerated SQL is parsed and checked before it runs: read statements only, approved schemas only, limits applied, and anything else rejected with a reason.
Audit & access governanceEvery tool call is logged with who asked, which operation ran, under which permissions and what came back, and access is reviewed on the same cycle as your other systems.
Use-Case Blueprints

What connected AI does with your data

The same access layer supports very different work. These are the patterns we build most often, and what each one decides about sources, access and output.

Natural-Language Questions on Governed Data

Managers ask business questions in plain language and get answers from the warehouse, without writing SQL or waiting for an analyst.

Reads from
Curated warehouse datasets and metric definitions
Access
The asker's own dataset and row permissions
Output
The answer, the query behind it and its source

AI-Powered Reporting & BI

Recurring reports explained in words: what moved, by how much and where to look next, written from the same numbers the dashboard shows.

Reads from
Reporting tables and BI models
Access
A read-only reporting identity per audience
Output
Scheduled summaries and drill-down answers

Customer Answers Inside the CRM

A rep or agent asks about an account and gets orders, invoices and open cases from the systems that hold them, without leaving Salesforce or HubSpot.

Reads from
CRM records plus ERP, billing and support systems
Access
CRM sharing rules carried through to each source
Output
One account view, cited by system

Agent Actions in Business Applications

AI agents that do more than read: create a case, update a record or raise a request, through approved operations with a person confirming where it matters.

Acts on
Named write operations in APIs or MCP tools
Access
Per-action scopes and human approval steps
Output
The change, logged on the record it touched

Operations Answers from Internal Systems

Operations and support teams query custom-built and legacy applications in plain language, through a service layer that protects the system underneath.

Reads from
Internal applications through wrapper APIs
Access
Read-only, rate-limited, team-scoped
Output
Status, history and next steps in one reply

Cross-System Retrieval Through Middleware

Questions that span many systems, answered through one governed endpoint on your integration platform instead of a separate connection per source.

Reads from
Databases and applications behind MuleSoft or Workato
Access
Platform policies and per-connector credentials
Output
A merged, mapped result the model can explain
Platforms & Data Flows

The models, clouds and platforms we connect

We work with the AI and data platforms you already use rather than asking you to standardise on ours. This is what each one contributes and what moves across the connection.

OpenAI + your data

OpenAI models call functions you define and, through the Responses API, remote MCP servers. Questions go out as tool calls; your access layer runs them and returns only the approved result. We keep OpenAI's approval and allowed-tools controls switched on.

Anthropic Claude + your data

Claude uses tools that run in your application, or remote MCP servers through Anthropic's MCP connector. For read-only assistants we expose read tools only and leave write tools out, as Anthropic itself recommends.

AWS + Amazon Bedrock

Amazon Bedrock Knowledge Bases can connect to structured data stores and turn a user's question into a query, so data held in AWS answers in plain language without being converted first. Results return to the application under its IAM role.

Google Cloud + BigQuery

Gemini in BigQuery generates SQL from plain-English prompts, and Google's open-source MCP Toolbox for Databases exposes BigQuery, PostgreSQL, MySQL, SQL Server and more to AI agents as tools. Generated SQL is reviewed before it is trusted.

MuleSoft + AI agents

MuleSoft's MCP Connector lets a Mule application act as an MCP server, so APIs, legacy systems and SaaS applications you already run on Anypoint become tools an AI client can call, with no separate hosting. See our MuleSoft integration work.

Workato + AI agents

Workato MCP servers give agents a curated set of tools over databases, APIs and business applications, and can act on each user's own credentials instead of a shared token. Tools are marked read-only or destructive. See our Workato services.

Salesforce + external data

Customer context flows from Salesforce to the AI, and order, billing and product data flows back from the systems that own it, so agents and reps answer from both. Grounding Agentforce on outside data is covered in Agentforce data integration.

HubSpot + business systems

Contact, company and deal records give the AI its customer context, while ERP, finance and product databases supply what HubSpot does not hold. Updates the AI proposes return to HubSpot through approved actions only.

Configuration

Use what the platforms already provide

Native connectors, existing integration-platform connectors, warehouse roles and the database's own row and masking features. Where a platform already solves part of the problem, we configure it rather than rebuild it.

Less custom code means less for your team to maintain.

Development

Build only the governed layer

Custom MCP servers, wrapper APIs for systems without one, query validation services, identity pass-through and the tests that prove each tool returns only what it should.

Everything we build is documented and handed over, so your developers can extend it.

Delivery Process

Six phases from first question to production access

The size of the project depends on how many systems are connected, whether they already have APIs, and whether the AI only reads or also acts. We start narrow, with one use case on read-only access, and widen from evidence rather than ambition.

Phase 01

Use-Case & Data Discovery

We agree the questions and tasks the AI must handle, then map which systems hold the answer, who owns them, how they are secured today and which fields are sensitive.

DeliverableUse-case list, source map and data classification

Phase 02

Access Architecture

For each system: the connection pattern, the identities and roles, the tool catalogue, the row and column rules, and what needs human approval. Your security team signs this off.

DeliverableSigned-off access design

Phase 03

Build Connectors & Tools

Database roles and views, APIs, MCP servers and middleware flows, built in a non-production environment against masked or test data, never directly against production.

DeliverableWorking tools, demoed per use case

Phase 04

Validate & Stress-Test

Accuracy tests against known answers, permission tests with users of different roles, attempts to reach data the AI should not see, and load tests on the systems it reads from.

DeliverableTest evidence and accuracy baseline

Phase 05

Controlled Launch

A pilot group first, with logging and feedback switched on, then a staged rollout. Write operations are enabled only after the read path has proven itself in production.

DeliverablePilot review and rollout plan

Phase 06

Operate & Improve

Monitoring of tool usage, errors, latency and cost, regular access reviews, and new tools added as teams find new questions. Schema changes are caught before they break an answer.

DeliverableRunbook, dashboards and handover

Why Twopir

An integration partner for the data behind the AI

Connecting a model to a database takes an afternoon. Connecting it to production data that is secured, reliable and trusted by your security team is integration work. We help growing and mid-market companies solve complex CRM, integration, and business system challenges, and AI data access is now one of them.

The architecture comes first

We design the access model, identities and tool catalogue before writing a connector, and record every decision, so the integration still makes sense when the second and third AI use case arrive.

Salesforce-first, with HubSpot and connected platforms

Most business questions involve a customer, so most AI integrations end up touching the CRM. We know its data model, sharing rules and APIs, in AI in Salesforce and AI in HubSpot projects alike.

Multi-system integration is the day job

ERP, finance, warehouse and custom-application integrations on MuleSoft, Workato and direct APIs are the core of our integration services. AI is a new caller on infrastructure we already build.

Real implementation experience

We build the data foundations AI depends on. For a US asset management firm we replaced four disconnected CSV pipelines with a BigQuery data foundation that cut cost per analytics cycle by 61%; for a US legal tech platform, OpenAI-powered email processing creates a Salesforce case note in under 60 seconds.

Senior-led, specialist execution

Senior architects lead the design and stay on the work, with specialists in databases, integration platforms and AI on each build. You get documented tools your own team can maintain, not a black box.

Common Questions

AI database integration questions, answered plainly

AI database integration connects AI models and AI agents to an organization's databases, data warehouses and business applications, so they can retrieve and use business information through controlled access instead of manual exports. It covers the connection pattern for each system, the operations the AI may perform, whose permissions apply, how sensitive fields are protected, and how every request is validated and logged.

With direct connectivity, the AI application runs queries against the database itself, which suits read-only analytics on a replica or warehouse. With API-based integration, the AI calls named operations on a service you own and never sees the query. MCP-based connectivity exposes approved tools and resources through the open Model Context Protocol, so several AI clients can share one governed interface. Middleware-based integration puts a platform such as MuleSoft or Workato between the AI and many systems to orchestrate, map and govern the calls. Most production estates combine two or three of these.

It can be, when the access is designed for it. We give the AI its own read-only identity, point analytical questions at a replica or warehouse rather than the primary database, enforce row-level permissions and column exclusions, validate every generated query, apply timeouts and row limits, and log each call. For production systems we prefer approved, parameterised operations over free-form queries, and any write operation needs its own scope and, where it matters, a human approval step.

An MCP server is a service that exposes tools, resources and prompts to AI applications through the Model Context Protocol, an open standard for connecting AI applications to external systems. You need one when several AI assistants or agents should share the same governed data operations, or when you want a standard interface rather than a separate integration per model. A single application calling a single API may not need one.

Yes. When a system has no API, we build a service layer in front of it, either a wrapper API or an MCP server, that exposes a small set of approved operations. Agents use those operations instead of reaching into the database underneath, which protects older systems from unexpected load and keeps business rules in one place.

We connect models from OpenAI and Anthropic, as well as AI services on AWS and Google Cloud, with PostgreSQL, MySQL, Microsoft SQL Server, MongoDB, cloud data warehouses and business applications such as Salesforce, HubSpot and ERP systems. Where an integration platform is already in place, such as MuleSoft or Workato, we build on it rather than around it.

No. The data stays in the databases and applications where it lives today, and the AI reaches it through governed connections. A consolidated warehouse or curated views can improve answer quality for analytical questions, and we recommend them where they help, but they are not a precondition for a first read-only use case.

Next Step

Show us your data, we will map the safe path

A first conversation covers the questions you want AI to answer, the databases and applications that hold the answers, and how they are secured today: enough to say which connection pattern fits each system and what a first read-only use case would take. No obligation to proceed.

Talk to an architect who connects AI with enterprise data