def METHOD_NAME(self, documents: list, resource_id: str, mode_api_key: str = None,
                                  model_source: str = ""):
    """
    Saves a document to the vector store.
    :param documents: The documents to save to the vector store.
    :param resource_id: The resource id to use when saving the documents to the vector store.
    :param mode_api_key: The mode api key to use when creating embedding to the vector store.
    """
    from llama_index import VectorStoreIndex, StorageContext
    if ModelSourceType.GooglePalm.value in model_source or ModelSourceType.Replicate.value in model_source:
        logger.info("Resource embedding not supported for Google Palm..")
        return
    import openai
    openai.api_key = get_config("OPENAI_API_KEY") or mode_api_key
    os.environ["OPENAI_API_KEY"] = get_config("OPENAI_API_KEY", "") or mode_api_key
    for docs in documents:
        if docs.metadata is None:
            docs.metadata = {}
        docs.metadata["agent_id"] = str(self.agent_id)
        docs.metadata["resource_id"] = resource_id
    vector_store = None
    storage_context = None
    vector_store_name = VectorStoreType.get_vector_store_type(get_config("RESOURCE_VECTOR_STORE") or "Redis")
    vector_store_index_name = get_config("RESOURCE_VECTOR_STORE_INDEX_NAME") or "super-agent-index"
    try:
        vector_store = LlamaVectorStoreFactory(vector_store_name, vector_store_index_name).get_vector_store()
        storage_context = StorageContext.from_defaults(vector_store=vector_store)
    except ValueError as e:
        logger.error(f"Vector store not found{e}")
    try:
        index = VectorStoreIndex.from_documents(documents, storage_context=storage_context)
        index.set_index_id(f'Agent {self.agent_id}')
    except Exception as e:
        logger.error("save_document_to_vector_store - unable to create documents from vector", e)
    # persisting the data in case of redis
    if vector_store_name == VectorStoreType.REDIS:
        vector_store.persist(persist_path="")