-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add example for using retriever with agents #795
Comments
@tom-leamon, you can use a |
That does work, but it seems to take significantly longer to use the tool and respond compared to using a ContextChatEngine. Is this a limitation of function calling APIs? Or is there a way avoid tool use but still perform retrieval? |
@himself65 @marcusschiesser is it possible to have agents use a retriever without a QueryEngineTool? With If the agent could use the retriever without an additional tool call, like Without this capability I am forced to have users manually choose if they want an agent or not, depending on if they need it to perform tool use (like searching the web) or provide the highest quality answer in the shortest time. I would prefer to have a single paradigm that both always has full context and can use tools. Is this something that is already possible, or perhaps could be added to the roadmap? |
@tom-leamon to reduce the latency, you can use a tool that directly calls the retriever. I added an example to the examples folder, see https://github.com/run-llama/LlamaIndexTS/blob/main/examples/agent/retriever_openai_agent.ts (compare with the same example using the query engine tool: https://github.com/run-llama/LlamaIndexTS/blob/main/examples/agent/query_openai_agent.ts) The differences are:
You can see the difference at run-time by adding the In the simple use case, both approaches lead to the same result - Would be great to get some feedback from your use case! |
Currently, there are no examples in the documentation which illustrate how to use retrievers with agents in order to leverage expanded context through embeddings. It's not immediately clear if this is even possible, though the types suggest it is.
If it's not currently available, implementing this feature would be hugely beneficial in increasing the performance of agents.
The text was updated successfully, but these errors were encountered: