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?