AIAI EngineerOct 8, 2024· 5:36

We accidentally made an AI platform: Jamie Turner

Jamie Turner, co-founder of Convex, explains how his company's backend platform accidentally became an AI platform because its reactive data flow paradigm—extending React's state reactivity to the server with subscribable queries and mutations—perfectly suits generative AI workflows. He describes Convex's architecture as seamlessly syncing state between backend steps and the application, enabling concurrent chains of tasks like automatic speech recognition, summarization, embedding generation, and finding related notes. Turner notes that post-ChatGPT, over 90% of Convex projects are generative AI. To support this shift, Convex added native vector indexes for schema fields and launched a startups program with discounts and exclusive forums. Upcoming high-level components will encapsulate state machines for sophisticated workflows. Turner presents Convex as a way for generative AI engineers to ship quickly and confidently.

Transcript

Intro0:00

Jamie Turner0:14

So, uh, originally I had this very fancy title for this talk, "Deterministic Workflow," and I don't know. But what I really want to title it is, "We accidentally made an AI platform, and what are we going to do about it?"

Convex's true mission, my company, is to replace traditional backend engineering, uh, all the kind of stuff that we do on backend engineering. Generative AI, by the way, thinks that fate limiting is one of those things. It's kind of cool.

Mission0:27

Jamie Turner0:40

Sounds ominous, but it is ominous, ominous,right? So we glue things to things, we configure stuff for different systems, we map data formats constantly, and a lot of times teams are spending a lot of their time, like half their time on this stuff, has nothing to do with your product.

Your users don't care, and they don't benefit. So we want to replace all this stuff with a high-level API, kind of functional interface that feels native to your application, similar to something like Firebase or Parse before it. So if you were doing this in the 2020s and it was a design exercise, what would you replace all that stuff with?

Functional API1:16

Jamie Turner1:16

What would that API look like? Well, for us, we took heavy inspiration from React and, really more generally, the way that kind of all applications are starting to have this functional, reactive data flow relationship to state. If you're not familiar with React, here's a little baby example.

You can create a state variable, it has a setter, and what React really empowers is it makes sure that whenever that state changes, all the places that depend on it are updated, re-rendered, refreshed. And so in this case, our app would have "Hi Olivia" in all caps.

The problem is this paradigm breaks down when the server gets involved. The server doesn't play the game this way. You still have to pull the server, you have to invalidate caches, you have to event your own push mechanisms.

So Convex fixes that. So Convex has queries and mutations like other frameworks you may be familiar with, but in Convex's case, it completely tracks pervasively data flow and dependencies through the backend. And so it extends the reactive paradigm into the backend.

AI Connection2:19

Jamie Turner2:19

Queries are these universally subscribable entities that applications can get updates from as soon as updates are available. So you might say, "What does this have to do with AI?" So what it has to do with is that some of the reacting entities are actually server-side actions.

It's not just the application. This may be a kind of architecture you've thought through before or played with. So something like a note taker, you know, maybe you're doing automatic speech recognition, and then you summarize it, and you generate embeddings and find related notes or whatever.

And along the way, these different checkpoints, the application sometimes needs to be brought in, show the summary, you know, show related notes, etc. But in practice, we find that apps are actually a lot more sophisticated than this. This is a developer named Web Dev Cody who's building an application on Convex that kind of like generates a first project plan, given a prompt.

Project Plan3:10

Jamie Turner3:10

So in this case, he is an app to track recipes, and when he hits create plan, running on Convex, this is sort of like, "Let's get a bunch of project names, let's get first feature requests, color palettes, icon ideas."

All of these, as you can imagine, are kind of concurrent chains that are running in the background, and all of them kind of flow into the application as they have results. It ends up that Convex is kind of a combination of like seamlessly syncing state between these backend steps, and the application is incredibly useful for a lot of generative AI apps.

Our Response3:45

Jamie Turner3:45

And for that reason, post ChatGPT boom, like 90 plus percent of projects on Convex are generative AI, and a lot of generative AI startups. So here's what we're doing about it. So the first thing we did is we got a lot of feedback from developers that one of those steps was always vector indexing, or quite often vector indexing.

So the developer said, "This is how you make a schema on Convex, it's just TypeScript, type completions, all that good stuff." They said, "Well, you already allow us to add indexes to our fields like this. Could you allow us to add vector indexes?"

And so we said, "Sure." And we rolled that out late last year, and it's being used very broadly now by projects on Convex. The second thing we just did, which is just kind of announcingright now, is we started a Convex for startups program.

Startup Program4:32

Jamie Turner4:32

Discount program, kind of access to startup-only forums and events and stuff like that. And the first batch, we just admitted tons and tons of generative AI companies in it. So again, this is sort of like the most engaged, excited customersright now.

And then very soon, we're releasing these kind of high-level components. We have this Convex components framework, which kind of encapsulates whole state machines in these building blocks you can easily drop into your app to have your backend encompass these sophisticated workflows that we've co-developed with customers very easily and rapidly.

So anyway, that's us. If you're building something cool in generative AI and you want to sort of ship with confidence and quickly, check us out at convex.dev. Thank you.