There's an embeddings API for text/code/images that can bed used for the similar snippets stuff if you bring your own vector search engine like milvus etc, but eventually I'll support uploading sets of documents and do the finding relevant snippets behind the scenes so you can ask these kinds of questions e.g. so people can do custom site specific FAQ answering bots etc.
There's an example in the playground of shorter autocomplete which is another way of helping agents too that it supports