Find answers from the community

s
F
Y
a
P
Updated last month

Thanks jerryjliu98 9313 I think I m

Thanks , I think I'm close...i was able to store a document in pinecone and retrieve the index, but I am confused by the gpt_index syntax around retrieval. For example if I want to do this in two separate API calls. For now I have something like this, which looks like it still needs to load the original documents? I am not a python dev so i may be missing somthing obvious here
Plain Text
    
index = pinecone.Index("<pinecone-index-name>")
index2 = GPTPineconeIndex(**documents**, pinecone_index=index)
response = index2.query("<my query string>?")
2
O
s
j
13 comments
you only need to call GPTPineconeIndex with documents when you actually need to index more documents, otherwise just pass it empty for the documents param to just interact with what's already stored in pinecone
Plain Text
pinecone_index = pinecone.Index("<pinecone-index-name>")

index = GPTPineconeIndex('', pinecone_index=pinecone_index)

response = index.query("some query about the documents you already indexed")
then for actually indexing new docs, it should probably be its own job process kicked off by another API or something
@Omar that is 1000% what I was looking for
thank you!! epic
Curious if there is a way to change the openAI model that is used in this example? I am trying to finetune the results as they seem a bit off base given the context document
Thank you for this! The docs does not mention this. May I know how you figured it out?
jerry can correct me if i'm inaccurate in this description, the GPTIndex classes are wrappers/interfaces that connect your Open AI Account (via your API key) with a particular index data store/structure.

With a service like pinecone, you don't need to load the index from file because it is all stored remotely by them. So to index documents every time you want to query is redundant if it is for the same Project + Pod. You only want to pass documents when you actually need to index new content to your vector pod
yeah you can persist an index over time
we also offer insert functionality so you can add new documents to an existing index
Doing this returns an empty response:

pi = pinecone.Index(self.index_name) indexer = GPTPineconeIndex('', pinecone_index=pi) response = indexer.query('what is Human capital') print(response)
Not sure if I'm missing anything?

cc: @Omar
Add a reply
Sign up and join the conversation on Discord