Find answers from the community

I
IFED
Offline, last seen 3 months ago
Joined September 25, 2024
Hi, I'm building an agent using FunctionCallingAgent to use the customized tools.
The tools are all set to return_direct=True. Memory default as None

I ran the same user query 10 times. If the agent uses the tool correctly, it should retrieve information directly from my database. However, I discovered that out of the 10 user queries, some responses were directly from the tool, while others returned results without utilizing the tool and contained information from the previous tool-generated result.

Any idea of how to fix this?
2 comments
L
I
IFED
·

Hi Everyone,

Hi Everyone,
I have my data stored in the collection in the Qdrant vector database. The metadata(payload) schema for all points is predefined by myself. How do I use VectorStoreIndex.from_vector_store() to create a query engine? From my experiment, it seems that the data should be stored in a specific schema (defined by llamaindex) to successfully create the query engine based on from_vector_store().

Experiment 1: (Load data from a directory)
Plain Text
client = QdrantClient(host="localhost", port=6333)
vector_store = QdrantVectorStore(client=client, collection_name=collection_name)
storage_context = StorageContext.from_defaults(vector_store=vector_store)

  1. I first load documents (download from an example) with documents = SimpleDirectoryReader(<path/to/data>).load_data() and create an index with VectorStoreIndex.from_documents. With from_documents, it upserts the data into a predefined collection_name in Qdrant VB. After doing query_engine = index.as_query_engine(), I successfully query the data in Qdrant VB. I also tried to create the index with VectorStoreIndex.from_vector_store and successfully queried the data in Qdrant VB.
Experiment 2: Use my own data that I have already stored in the Qdrant VB
Plain Text
client = QdrantClient(url=<qdrant_vb_endpoint>, api_key=os.getenv("QDRANT_CLOUD_API_KEY"))

I create the index with VectorStoreIndex.from_vector_store. After doing query_engine = index.as_query_engine(), I try to query the query_engine and it failed.

Does anyone have an idea of how to get it to work? Thanks!
1 comment
L