from ragatouille import RAGPretrainedModel myrag = RAGPretrainedModel.from_index("ragatouille/colbert/indexes/cofindex_vector_db_nosplit/") def get_similar_profiles(profile, prefix, rag_engine = myrag, k=20): query = prefix + profile raw_results = rag_engine.search(str(query), k=k) results = [] for result in raw_results: if result["content"] == profile: print("ah") else: results.append(result["content"]) final_md = "" for result in results: final_md += "### " + result[1:] return final_md