Find answers from the community

Updated 2 months ago

Is it possible to create a query engine object without index?

@kapa.ai Is it possible to create a query engine object without index?
k
2 comments
Please stand by @larrygzlb as I search the knowledge base. I normally take about 15 seconds or so. :wave:
----------------------
No, it is not possible to create a query engine object without an index in LlamaIndex. The index is a crucial component for the query engine as it is used to power the query engine over the data. The index is created from documents and then used to build the query engine. Here is an example of how to create an index and then use it to build a query engine:

Plain Text
from llama_index.core import VectorStoreIndex

# build index
index = VectorStoreIndex.from_documents(documents)

# build query engine from index
query_engine = index.as_query_engine()


You can find more details in the LlamaIndex documentation ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Add a reply
Sign up and join the conversation on Discord