Slide 1

Slide 1 text

APIs for AI How to deliver APIs for Agentic AI Zdeněk “Z” Němec, superface.ai, December ’24

Slide 2

Slide 2 text

Zdeněk “Z” Němec • designed an API description language • pioneered API-design & API-first • built APIs with the largest enterprises • building API infrastructure for AI agents • building AI agents Founder and CTO of Superface.ai • DSL director Apiary.io → Oracle • Founder of Good API consulting • Enterprise API strategy and execution superface.ai

Slide 3

Slide 3 text

APIs are enabling AI to take actions superface.ai

Slide 4

Slide 4 text

superface.ai Good APIs can make a dumb AI smarter Poor APIs make any AI fail

Slide 5

Slide 5 text

Three levels of AI maturity Current business drivers for AI are “safe”: Assisting and augmenting workforce superface.ai

Slide 6

Slide 6 text

Superface Agentic AI

Slide 7

Slide 7 text

Agentic AI superface.ai

Slide 8

Slide 8 text

Agentic AI LLM-powered agents • An agent is a software that acts on behalf of user or another program • LLM-powered agents can independently • make decisions • perform tasks • interact with other systems • Agent needs tools to be able to do meaningful things superface.ai

Slide 9

Slide 9 text

Tools Used by agents • Agents are only as good as the tools they have • computation • databases • API calls • LLM works more like a human • It’s able to fi gure out what endpoints to call from API documentation • Agents are more resilient to API changes LLM-powered Agent Memory Planning Tools APIs superface.ai

Slide 10

Slide 10 text

API product & API design are critical for the success of agents

Slide 11

Slide 11 text

Chapter 1: API Product superface.ai

Slide 12

Slide 12 text

You would think the APIs are the best things for agents superface.ai

Slide 13

Slide 13 text

In many situations it is easier, faster and cheaper to access data and perform actions via UI over API. Often, it is the only way. superface.ai

Slide 14

Slide 14 text

LinkedIn A minute vs. several weeks • LinkedIn API exists • It is not easily accessible to developers • The functionality is limited • Using 3rd party (scraping) service • Connect my agent to LinkedIn in one minute superface.ai

Slide 15

Slide 15 text

Accessing a Salesforce instance of a biggest HW maker Deal or no deal • Entering data into CRM • The case was saving 38hrs / week • Agent did not get the API access to the CRM • Entering the data using web actor (scraper) works superface.ai

Slide 16

Slide 16 text

There are many more similar stories • No access to API for agent developers • Legacy APIs (WS/RPC) • API can do only fraction of what UI can superface.ai

Slide 17

Slide 17 text

Chapter 2: API Design superface.ai

Slide 18

Slide 18 text

LLM function calling • Mechanism that LLM uses to recognize a and call a function (tool) • Ideally, we would give an API to LLM and it would fi gure it out • The more atomic and abstract the API is the harder it is to use LLM detects function requirements Structured function input Execution of the function Returning the result API call LLM function calling repeat multiple times superface.ai

Slide 19

Slide 19 text

Documentation Use descriptions to control and hint the LLM: • to pick the tool • what others tools to call • instruct to use fi lters • describe out-of-the-band knowledge Describe everything Example: Salesforce CRM superface.ai

Slide 20

Slide 20 text

Less is more • Return only what is necessary • GraphQL shines here! • Bundle API calls • when descriptions are not enough or context would be too big • Create endpoints to serve speci fi c agentic use-cases • also helps for weaker LLMs Mind the Context Size Example: Google Mail superface.ai

Slide 21

Slide 21 text

Flat parameters are better • Nesting is hard for LLMs • More complex objects can be tough for LLM to correctly fi ll Minimize nesting Example: Google Sheets superface.ai

Slide 22

Slide 22 text

• If your API is abstract agent developers needs to design their tool interfaces • LLM will not fi gure it out Avoid abstraction Extremely di ff i cult for LLMs Example: Notion Notion API: you need to get the database, then blocks in the database, and then iterate through the blocks superface.ai

Slide 23

Slide 23 text

• Return messages relevant to actual error • APIs error handling often sucks • Respect status codes • Most agents can use error message to fi x the request (in 400 cases) • Good error messages are the di ff erence between a failure and success Error handling design it to be useful superface.ai

Slide 24

Slide 24 text

• To prevent hallucinations • Tools need to communicate any relations between parameters • Ideally using JSON Schema (and not description) • Correctly named, described, including format (e.g. timestamps), and default values • De fi ne parameters as enums where possible Required fields must be designed well Example: Scrapin superface.ai

Slide 25

Slide 25 text

• Can take away attention from required fi elds • Not a concern when you are working with one tool Optional fields avoid too many Example: Google Maps superface.ai

Slide 26

Slide 26 text

• Custom GPT limit is 30 • We think the sweet spot is only 15-20 • We are are using hierarchy to fi lter hundreds of tools • Isolated agent can help select the right tool Number of tools keep it very, very low superface.ai

Slide 27

Slide 27 text

What it means for your API? • Follow conventions, don’t get too creative • Keep it simple • Focus on documentation, description and naming • Streamline API access: OIDC/OAuth is a must • Have API AI PO: API- fi rst, API Design for AI superface.ai

Slide 28

Slide 28 text

AI just highlighted the API pains we’ve had for decades. superface.ai

Slide 29

Slide 29 text

Provide Agentic SDK Stripe: API with over 90 endpoints superface.ai

Slide 30

Slide 30 text

APIs are built for the old world • Agents are your new best friends • As API provider / product owner go out and look • The API consumption will be 80% agents and 20% humans superface.ai

Slide 31

Slide 31 text

superface.ai The way humans and software are interacting has changed.

Slide 32

Slide 32 text

Get APIs right or people will either use UI or walk away. ( and agents ) superface.ai

Slide 33

Slide 33 text

Thank you! Let’s talk Zdenek “Z” Nemec 
 Twitter/X: @zdne LinkedIn: https://www.linkedin.com/in/zdne/ superface.ai superface.ai

Slide 34

Slide 34 text

No content