Skip to content

Load Pandas dataframe into VectorStore Index - For OpenAI Agent Query Planning #14009

Answered by dosubot bot
mraguth asked this question in Q&A
Discussion options

You must be logged in to vote

The text column in the example is not the same as the DataFrame's index. Instead, it is a column that contains the text data you want to convert into Document objects. The DataFrame's index is a separate entity that uniquely identifies each row, while the text column holds the actual content of the documents.

To save the vectorized DataFrame in a Chroma vector database, you can follow these steps:

  1. Convert the DataFrame to a list of Document objects:

    import pandas as pd
    from llama_index.core.schema import Document
    
    # Sample DataFrame
    df = pd.DataFrame({
        'text': ["Document 1 text", "Document 2 text", "Document 3 text"],
        'metadata': [{'id': 1}, {'id': 2}, {'id': 3}]
    })
    
    # Function…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@mraguth
Comment options

@dosubot
Comment options

@mraguth
Comment options

@dosubot
Comment options

Comment options

You must be logged in to vote
1 reply
@dosubot
Comment options

Answer selected by mraguth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant