An AI generated sample of this is in the new file john checked in called /analyzer/batch_analyzer.py.
However the AI generated code goes too far by trying to group all the splits of up to 20 documents at a time into one call to embed_documents() rather than sending them one at a time with embed_query(). I haven't tested it yet, but I bet our documents would exceed the limit of what you can send to embed_documents() in one call.