# Querying on llama-index Weaviate Vector Store

**URL:** <https://forum.weaviate.io/t/querying-on-llama-index-weaviate-vector-store/332>\
**Category:** General\
**Created:** [July 6, 2023, 7:17am UTC](https://forum.weaviate.io/t/querying-on-llama-index-weaviate-vector-store/332 "2023-07-06T07:17:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vruti\_Dobariya](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/vruti_dobariya/32/145_2.png) [@Vruti\_Dobariya](https://forum.weaviate.io/u/Vruti_Dobariya)\
**Post date:** [July 6, 2023, 7:17am UTC](https://forum.weaviate.io/t/querying-on-llama-index-weaviate-vector-store/332/1 "2023-07-06T07:17:42Z")

</div>

Hey everyone!  
I have a query regarding the llama-index loader for Weaviate, if anyone can help me with that?

```auto
vector_store = WeaviateVectorStore(weaviate_client=client)
storage_context = StorageContext.from_defaults(vector_store=vector_store)
index = VectorStoreIndex.from_documents(data, storage_context=storage_context)
query_engine = index.as_query_engine()
response = query_engine.query(
        "xyz")

print(response)

```

I am loading data into the Weaviate vector store using Llama-index in the code above. The problem is that every time I ask for the query, the data is loaded repeatedly in Weavite. What I want is that once the data is indexed and stored in Weaviate, when I run the query, I want to get access to the already loaded data instead of indexing it all over again. How can I solve this issue?

---

<div class="post-metadata">

**Author:** ![jphwang](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jphwang/32/38_2.png) [@jphwang](https://forum.weaviate.io/u/jphwang)\
**Post date:** [July 6, 2023, 1:08pm UTC](https://forum.weaviate.io/t/querying-on-llama-index-weaviate-vector-store/332/2 "2023-07-06T13:08:57Z")

</div>

Hi @Vruti_Dobariya - I don’t have any experience with Llamaindex so I’m not sure exactly what’s going on here. But typically if something like this is happening, you might be repeating the data ingestion process.

Can you see in your code if you might be doing that multiple times?

Also - hey @erika-cardenas - would you know what’s going on here?

---

<div class="post-metadata">

**Author:** ![Vruti\_Dobariya](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/vruti_dobariya/32/145_2.png) [@Vruti\_Dobariya](https://forum.weaviate.io/u/Vruti_Dobariya)\
**Post date:** [July 6, 2023, 1:44pm UTC](https://forum.weaviate.io/t/querying-on-llama-index-weaviate-vector-store/332/3 "2023-07-06T13:44:06Z")

</div>

So, here in the code, I am loading the data and indexing it in the first three lines. Now to answer the query, the index is retrieved, and the query is answered accordingly. Now, llama-index provides a feature to store this index on local storage, and we can access it without the need to load the data again. But what I want is that once the data is stored and indexed in Weraviate, I can raise a query directly on Weavite instead of storing the index on my local machine without the need of reuploading the data.

---

<div class="post-metadata">

**Author:** ![Vruti\_Dobariya](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/vruti_dobariya/32/145_2.png) [@Vruti\_Dobariya](https://forum.weaviate.io/u/Vruti_Dobariya)\
**Post date:** [July 7, 2023, 6:58am UTC](https://forum.weaviate.io/t/querying-on-llama-index-weaviate-vector-store/332/4 "2023-07-07T06:58:21Z")

</div>

For example, in the documentation below:

 ![Screenshot 2023-07-07 at 12.25.03 PM](https://canada1.discourse-cdn.com/flex027/uploads/weaviate/original/1X/5f15fdabd7fe51ed45aeb867f5ce66ba2468c179.png)

They showed how if the data is already loaded in Pinecone, they can access it directly without needing to store it in local storage. Do we have the same for Weaviate? If we do, then can you please let me know how to implement that?

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/weaviate/original/1X/2b453e95c12d6c8d1412a4adb69e4e63df2c466c.png)

---

<div class="post-metadata">

**Author:** ![younis\_Bashir](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/younis_bashir/32/3592_2.png) [@younis\_Bashir](https://forum.weaviate.io/u/younis_Bashir)\
**Post date:** [March 9, 2025, 12:17pm UTC](https://forum.weaviate.io/t/querying-on-llama-index-weaviate-vector-store/332/5 "2025-03-09T12:17:39Z")

</div>

I implement this function it’s work perfect

```auto

def get_index():
    """
    Retrieve the Index context for Weaviate index.
    """
    vector_store = WeaviateVectorStore(get_weaviate_client(), index_name="LlamaIndex_docs")
    index = VectorStoreIndex.from_vector_store(vector_store, storage_context=get_storage_context())
    return index

```
