Skip to main content
AI and APIs:
Peanut butter and jelly
Platform Summit, 2024
I champion intent
Andrew I. Carlson
Principal Field Architect at Apollo
linkedin.com/in/andrewicarlson/
andrew@apollographql.com
My name is Andrew Carlson,
and I’m an AI skeptic
My name is Andrew Carlson,
and I’m an AI skeptic
Blind-faith in AI is risky
My turning point:
A local LLM + my own data
My turning point:
A local LLM + my own data
Using data in LLM-driven
experiences is straightforward
Vector databases Raw SQL queries
But most experiences need
more than just data
Who played
Laena in House
of the Dragon?
When will my
order arrive?
vs.
But most experiences need
more than just data
Who played
Laena in House
of the Dragon?
When will my
order arrive?
vs.
Nanna Vondell
But most experiences need
more than just data
Who played
Laena in House
of the Dragon?
When will my
order arrive?
vs.
Nanna Vondell
User
But most experiences need
more than just data
Who played
Laena in House
of the Dragon?
When will my
order arrive?
vs.
Nanna Vondell
User Order
But most experiences need
more than just data
Who played
Laena in House
of the Dragon?
When will my
order arrive?
vs.
Nanna Vondell
User Order Inventory
But most experiences need
more than just data
Who played
Laena in House
of the Dragon?
When will my
order arrive?
vs.
Nanna Vondell
Inventory
User Order Shipper
Today at 3pm
Take action on
behalf of the user
Meaningful experiences need to
take action
Take action on
behalf of the user
Meaningful experiences need to
perform business logic
Perform
business logic
Perform
business logic
Take action on
behalf of the user
Rapidly add
capabilities
Meaningful experiences need to
evolve
Meaningful experiences need APIs
>30% of the increase in demand
for APIs will come from AI and
LLMs by 2026
GARTNER PREDICTS
Supply and demand
Producer and consumer
API and client
A LLM is just another client
Android Web iOS Watch
A LLM is just another client
LLM
Android Web iOS Watch
How?
Client API
API Access
How?
Client API
Today’s approaches don’t solve this
Raw SQL
● LLM generates
SQL script
● Direct db
access
Trade-offs:
Today’s approaches don’t solve this
Raw SQL
● LLM generates
SQL script
● Direct db
access
Today’s approaches don’t solve this
Simple RAG
● Vector dbs
MongoDB,
pgVector)
● Often
one-step
Raw SQL
● LLM generates
SQL script
● Direct db
access
Today’s approaches don’t solve this
Simple RAG
● Vector dbs
MongoDB,
pgVector)
● Often
one-step
Raw SQL
● LLM generates
SQL script
● Direct db
access
Trade-offs:
1. Data consistency
concerns when
synchronizing data
2. Must maintain data
integrity between SoR
and vector database
3. Returning static data
Extensions
Today’s approaches don’t solve this
● “Function
callingˮ APIs
● Plugins
Simple RAG
● Vector dbs
MongoDB,
pgVector)
● Often
one-step
Raw SQL
● LLM generates
SQL script
● Direct db
access
Extensions
Today’s approaches don’t solve this
● “Function
callingˮ APIs
● Plugins
Simple RAG
● Vector dbs
MongoDB,
pgVector)
● Often
one-step
Raw SQL
● LLM generates
SQL script
● Direct db
access
Trade-offs:
1. Client-side API orchestration
2. New backend-for-frontend APIs to write and
maintain
3. Re-deploy for each new capability
My favorite approach:
a little bit of everything
For API access: use multiple methods
+
Extensions:
Make an API
request
Simple RAG
Whatʼs available
and where
Extensions:
Make an API
request
For API access: use multiple methods
Simple RAG
Whatʼs available
and where
GraphQL
Query plan across
many APIs
+ +
With federated GraphQL:
Many APIs from a single endpoint
AI / LLM
Experience
Federated
GraphQL
User
Inventory
Product
APIs
AI / LLM
Experience
Federated
GraphQL
APIs
Safelisted Persisted
Queries
📄
Contracts
📄
With federated GraphQL:
Secure access with contracts and PQs
User
Inventory
Product
AI / LLM
Experience
Federated
GraphQL
Reviews
APIs
Safelisted Persisted
Queries
📄
Contracts
📄
With federated GraphQL:
Ship new capabilities without a deploy
User
Inventory
Product
Customer LLM
query
{…} Router
Asks a
question
Products
Cart
Collections
Review
Checkout
APIs
Query-planned
API Access
Customer LLM
query
{…} Router
Asks a
question
Products
Cart
Collections
Review
Checkout
APIs
Safelisted
operations
Vector DB
Similarity
search
With
intentional
governance
Demo
Meaningful experiences need APIs
Using federated GraphQL for AI and API
data access
Simple access
to APIs
Trusted access
to data
Rapid iteration
Try it for yourself
Demo Github Guide
Thank you