Hey champs
I’m working on a client’s project involving assistants API now and curious how you deal with the fact that if you try to work with several assistants in 1 thread they seem to be unaware of the other ones.
Example of a thread:
-
user: hi
-
assistant 1: Hello! How can I assist you today?
-
user: create blog post page
-
assistant 1: The blog post page has been created for you.
-
assistant 2: To proceed, I need some information to create the content for your blog post. Could you please provide the following details:
Topic:
Target Audience:
Blog Post Goal:
Supportive Examples:
Call to Action:
-
user: who wrote “Hello! How can I assist you today?”?
-
assistant 2: I generated that message to greet you at the beginning of our conversation. If you have any questions or need assistance, feel free to ask!
This kind of lack of understanding creates all kids of problems when using multi-agent approach.
How do you deal with this?
maybe have a response extraction like ( const [dialog, rest1] = response.split(‘/aaaa/’) to specifically filter and store assistants’ messages in separate data strctures ( dialogHistory.push(Assistant 1: ${assistant1Dialog}
);), and pass them all in the master prompt call for (let i = 0; i < dialogHistory.length; i += 2) {
const assistant1Dialog = dialogHistory[i];
const assistant2Dialog = dialogHistory[i + 1];
or etc. …
-Alexi
1 Like
Thank you for the answer Alexi!
Do you mean to have separate threads for each assistant and the pass others’ threads as context for the next assistants?
I think what I suggested was to build a dialogHistory for each assistant by extracting and pushing their updates to it (assistant1History, assistant2History, assistantXHistory …) and then when you want to make the chat call, either stich them together in the order they spoke or pass the individual histories unconcatinated (perhaps with hh/mm/ss tags so the context for when response was sent is captured by API, and then have it generate the next response for X assistant, based on what you need next.
Seems like a cool application what are you working on?
I have recently started thinking about multi-agent solutions - though have not yet gotten around to implementing it. I am considering going down to a path of having a moderator assistant that maintains overall coordination and that dynamically calls on other assistants to contribute. Under that approach I would try to maintain a master thread that contains the conversation history including contributions from the individual assistants.
1 Like