Increasing the maximum number of files that can be attached to an assistant

I would love to index our help center in the assistants api! But sadly I am unable to do so as we have >20 articles and the max number of files we can attach to a given assistant is 20.

If you don’t mind me asking, what are you trying to upload? Could you combine the files together or selectively upload them based on the conversation?

Nothing too crazy, just a few hundred small text files. Combining isn’t difficult, but our pipeline would be much cleaner if we could have distinct files per help center article.

1 Like

FYI, I’ve found that combining documents can lead to errors in the RAG. I’m not sure if there is some metadata being added to the chunks when they move them into the vector store, or how it works, but I find much better performance when relevant content is separated into its own file. Might be application specific.

1 Like

Bummer! Another reason I would really love to be able to separate these per article.

Uploading files is just an option so you don’t have to store them yourself. If you have more than 20 files that you need to upload, it’s a better to set up a function call/action to retrieve these from your own database when needed. This way you can have as many files as you want :hugs:

2 Likes

Oo excellent call! It seems like your suggestion is:

  1. Expose an endpoint to run indexed searches against our help center that return the top K documents (our content is indexed in elastic so this is easy)
  2. Add an action connecting that endpoint into our assistant

I’ll play around with this and report back on the thread how it goes.

2 Likes

That is exactly what I’m suggesting my friend!

Remember to add some authentication if you don’t want to expose your data to the rest of the world :laughing:

1 Like

Perhaps there’s something specific about @stunningkrueger 's use case, but at this point why not just precompute embeddings and store them in your database? Then you can provide matching chunks to the assistant directly.

The function call seems like it would work if it’s always clear in the user’s query which files are needed, but most of the time the user would be asking a natural language question anyways, right?

1 Like

The open ai models are quite good at calling the appropriate functions along with parameters reflecting the semantic meaning of the user’s natural language query.

Presumably the function would perform a semantic search based on the embedding of the function call query parameter against a table of the pre-calced embeddings of the file chunks.

So yeah.

Sure, assistant api aside, you might be able to achieve that without function calls but function calls are a very nice structured approach and have some efficiency benefit.

Using basic Completions, you could take the embedding of the user query and package close chunks into the prompt proactively but I wonder how cost efficient that would be?

But in any case, with the assistant API you need to work with uploaded files or functions.

Oh interesting - is this to say I can have the assistant select from my pre-uploaded files using a function call so I don’t need to generate my own embeddings?

It’s not clear how I can do that here. Can you elaborate?: https://platform.openai.com/docs/assistants/tools/function-calling

I could have done with pleasure if you had included the word ‘please’ :stuck_out_tongue:

No, see:

https://platform.openai.com/docs/assistants/tools/file-search

Aha oops sorry - clearly I’m getting too used to LLMs giving me my answers… thank you for your last couple of responses :blush:

So the 20 file limit is now 10000 as stated in the docs you just shared (the method to list vector store files has a default limit of 20 though, which threw me initially), so my previous issue is now resolved and I can go back to using vector store files instead of embeddings.

Thanks for the help!

1 Like