That's a good question! Prisma (not to single it out, basically any ORM on the market) struggle with composition. What this means is that an innocently looking API call in your ORM can translate into a multitude of actual SQL queries sent to the server one by one. This just balloons the database latency of your backend degrading quality of service everywhere.
EdgeDB's TypeScript query builder gives you the same type safety benefit that Prisma gives you, but its main feature is that it builds EdgeQL for you. And EdgeQL is very, very good for composition and pipelining multiple operations in one single query. You can select multiple unrelated object hierarchies, update / insert them, introspect your schema, all in one query easily.
Embeddings are created using OpenAI's ada model. They are stored in Supabase with the vector extension, which offers a simple way to compute vector similarities. Then the associated sections are added to the prompt context.
The way it went is: we built this as part of Motif for the past month, and our users loved it. Many asked for a way to add this feature to their existing sites, so we made a standalone platform that streamlines the process, and open sourced it :)
Haven't made a comparison yet but would love to hear about any findings. So far, for the intended use cases, meaning narrative docs with lots of text, images and code, it works really well. We're still breaking up the Markdown into sections and comparing embeddings as this strikes a good balance between performance and cost, but will also plan to let users experiment with other approaches, such as sending entire corpuses of text to GPT-4.
Nice work! Regarding your question on how to handle undoing a command on a shape that doesn't exist anymore, is there a way we could automatically recreate the shape?
It's technically possible by caching only deleted shapes if any operations in the undo stack are associated with them. But is it really the UX we want every time it's happening?
Let's imagine that we work together on a design file that contains hundreds of icons. I'm responsible for adjusting the color palette while you're removing the old icons that are not used anymore. If I undo my last color update on all icons, I probably don't want to recreate the icon inadvertently and override the triage you're doing! So IMO, it's more of UX question than a technical question. Is there a better default solution that we can find to improve these edge cases? My initial thought is to have a small "toast" letting the user know that the undo operation couldn't be applied because X does not exist anymore, with a link to the version history panel to allow him to reinsert X if it wants to.