Company: Coderbyte
Difficulty: medium
Problem Description Create a simple document-level vector search system using ChromaDB. The system should load text documents, compute their embeddings, and perform a similarity search to find the most relevant documents for a given query. You are provided with a skeleton class DocumentVectorSearch . The class is already set up with self.documents (a list of text strings containing the loaded file contents) and self.collection (an initialized ChromaDB collection object). Your task is to implement the process_documents() and query() methods to build a functional search system. process_documents(self) : This method must iterate over the loaded text strings in self.documents and add them to the ChromaDB collection self.collection . It must generate unique IDs for each document using their stringified list index (e.g., "0" , "1" , "2" , etc.). query(self, question, num_results=3) : This method takes a query string and returns the num_results most similar documents from the collection. It m