def search(self, query, k=5):
        """Perform a similarity search on the vector store using the query and return LangChain documents."""
        query_embedding = self.embeddings.embed_query(query)
        results = self.collection.query(query_embeddings=[query_embedding], n_results=k)

        # Create documents and deduplicate based on page_content
        unique_docs = {}
        for doc_text, metadata in zip(results["documents"][0], results["metadatas"][0]):
            if doc_text not in unique_docs:
                unique_docs[doc_text] = Document(page_content=doc_text, metadata=metadata)

        docs = list(unique_docs.values())
        return docs
Perform a similarity search on the vector store using the query and return LangChain documents.
examples/expositional/use_cases/snowflake-ai-stack/src/retrieval.py