File search does not work well

Then directly, always call queryProducts and have him take care of returning the products? The file_search would then be deleted? because I also tried adding the file to the thread but it didn’t work either…

1 Like

If you only use file_search for that, I think that you would no longer need it. What you need to do is make a tool that returns the “most probably items” given a for example item_name. Not only the best match because you don´t know if that is what the user want, then let the assistant handle the rest. If you are worry about mispelled names, don´t be, because the assistant would most likely correct it before calling the tool, or call the tool multiple times in a single run.

2 Likes

tthanks for helping me!!:grin:

2 Likes

Anytime, i´m sure you would be able to solve it :raised_hands:

1 Like

Hi,
API chat completions and assistants are sometimes very lazy guys. I found the same problem, and opted for adding a reminder to each message that needs the assistant to read a document to force it to read it.
Presently, for me is the only solution that works.
Regards.

1 Like

File search does not support JSONL

If you are really struggling there is a guaranteed way to make it work.

Set up another agent and drop your data into its instructions. Then underneath that tell it that it’s primary task is to help your original agent by providing it with any data or request it asks for help with.

Then in your original agent, instead of telling it to call file retrieval, tell it to make a function call to the second agent seeking the info it needs. In the function call, just set up a really simple schema that is just a question string. In your back end code, monitor for the function name and when it gets called and passed to the second agent, pass the second agents response back to the first agent in the tool_outputs (this could be configured to be a structured JSON or not). Then you have an AI agent doing your retrieval rather than RAG, and you can also utilise this second agent (or other agents for other helpful tasks to assist the first agent). And you also have an agent network :slightly_smiling_face: !