I’m wanting to use the Knowledge Retrieval tool with a front end tool that helps users make notes on research. Every user will need the same files for the Knowledge Retrieval tool. When I look at the docs (https://platform.openai.com/docs/assistants/tools/knowledge-retrieval) it looks like I’m supposed to upload the same file every time. Is there a more efficient way to do this?
Thanks for all the help! I’m so excited about the possibilities for this project!
When you are using assistants, multiple users can interact with one “assistant”, which has behavior that is made from instructions, and the assistant itself can have text and documents added by use of a tool called “retrieval”.
So if you have a “answer about my company’s products” bot, you just configure one assistant with its files, and let many interact with it through many threads of messages (conversation sessions).
This also is the least costly method. The same file attached to multiple assistants or multiple messages multiplies the costs quickly.
How do multiple users interact with the same assistant if I have to create them on runtime in my next.js app? The docs show
const assistant = await openai.beta.assistants.create({
instructions: "You are a customer support chatbot. Use your knowledge base to best respond to customer queries.",
model: "gpt-4-turbo",
tools: [{"type": "retrieval"}]
});
If I have a user log in and I create an assistant with the needed files and then a different user logs in it looks like I’m supposed to create another assistant.
I can create an assistant in the Playground, should I try to connect my next.js app and then create a new thread for each user login? I just don’t see that in the docs so I wonder if I’m just missing something.
When you specify a run, to invoke an AI that will produce a response to the latest user message in a thread, you pass parameters for both the assistant ID and the thread ID.
User A gets their question placed as a user message in their prior chat history of a thread, and the assistant behavior answers. User B has their own thread, not affecting the first chat, where the assistant AI can use its behavior and resources to give an answer in the context of the second conversation.
So picture threads as the “chats” on the sidebar of ChatGPT. You can see and continue all of yours, but not another users. Then picture assistants as a “GPT” personality on ChatGPT Plus, with extra instructions or tools that may fit an application.
This of course requires database beyond what is provided, tracking user sessions, tracking user IDs and accounts, tracking user rights and credits, checking user moderations and bans, checking user customization, tracking user thread titles and thread statuses, tracking user metadata such as generated files or images that have expired from AI services…
Thus, besides providing an answer to “why doesn’t AI remember what I said” for beginners, a thread of an assistant offers little more than imprisonment of your data in a platform to prevent migration and management.
Thanks! That makes sense. So before I start tracking users threads, am I supposed to create a new assistant (with node for example), keep the id that gets returned (I guess as a env variable in my project) and then use that when creating and managing threads for individual users? When I was trying to do this via postman I was able to create a thread: