Live data from Hacker News

Multi AI agent systems using OpenAI's assistants API

github.com

41–50 of 87 posts

Re: Multi AI agent systems using OpenAI's assistants API

#41
post #36

Assistants API is promising, but earlier versions have many issues, especially with how it calculates the costs. As per OpenAI docs, you pay for data storage, a fixed price per API call, + token usage. It sounds straightforward until you start using it. Here is how it works. When you upload attachments, in my case a very large PDF, it chunks that PDF into small parts and stores them in a vector database. It seems lik…

[deleted]

Re: Multi AI agent systems using OpenAI's assistants API

#45
post #4

I'd be interested in knowing if anyone is seriously using the assistants API, it feels like such a lock in to OpenAIs platform when your can alternatively just use completions that are much more easily interchanged.

I know at least one team is at work is using the Assistants API, and I'm talking with another team that is leaning pretty heavily towards using it over building a custom RAG solution themselves, or even over other in-house frameworks.

Re: Multi AI agent systems using OpenAI's assistants API

#46
I don’t understand the comment about server send events not being async friendly.

What is unfriendly about this?

  import OpenAI from 'openai';

  const openai = new OpenAI();

  async function main() {
    const stream = await openai.chat.completions.create({
      model: 'gpt-4',
      messages: [{ role: 'user', content: 'Say this is a test' }],
      stream: true,
  });
    for await (const chunk of stream) {
    process.stdout.write(chunk.choices[0]?.delta?.content || '');
    }
  }

  main();
It’s easy to collect the streaming output and return it all when the llm’s response is done.

Re: Multi AI agent systems using OpenAI's assistants API

#47
post #44

Anyone recommend the best way to use AI to search all of my documents for a project. I've got specifications, blueprints, emails, forms, etc. Would be great to be able to ask it, 'have we completed the X process with contractor Y yet?'

Try h2ogpt:

https://github.com/h2oai/h2ogpt

Re: Multi AI agent systems using OpenAI's assistants API

#48
post #5

From the website linked in the readme: “A lot of research has been doing in this are and we can expect a lot more in 2024 in this space. I promise to share some clarity around where I think this industry is headed. In personal talks I have warned that multi-agent systems are complex and hard to get right. I've seen little evidence of real-world use cases too” These assistant systems fascinate me, but I just don’t hav…

We tried using a multi-agent system for a complex NLP-type task and we found: - Too many errors that just propogate on top of each other, if a single agent in the chain generates something even a little bit off then the whole system goes off the rails. - You often end up having to pass a massive amount of shared context to every agent which just increases the cost dramatically. Curiously enough we had an architect fr…

we do multistep programs in louie.ai via a variety of agents/tools, like "get X data from DB Y, wrangle cols A+B in Python, and then draw an interactive map + graph"

The ultimate answer is fairly short if you are a senior python data scientist, like 50loc. The agents will wander and iterate until they push through. You might correct & tweak if a bit off.

Importantly, this does agents opposite of the way Devin AI engineer replacements are presented. Here, you get it to do a few steps, and then move on to the next few steps. The agents still crank away a ton and do all sorts of clever things for you... to get you more reliably to the next step, vs something big & wrong.

Re: Multi AI agent systems using OpenAI's assistants API

#49

I don’t understand the comment about server send events not being async friendly. What is unfriendly about this? import OpenAI from 'openai'; const openai = new OpenAI(); async function main() { const stream = await openai.chat.completions.create({ model: 'gpt-4', messages: [{ role: 'user', content: 'Say this is a test' }], stream: true, }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.d…

[deleted]

Re: Multi AI agent systems using OpenAI's assistants API

#50

I don’t understand the comment about server send events not being async friendly. What is unfriendly about this? import OpenAI from 'openai'; const openai = new OpenAI(); async function main() { const stream = await openai.chat.completions.create({ model: 'gpt-4', messages: [{ role: 'user', content: 'Say this is a test' }], stream: true, }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.d…

They’re referring to the:

> assistant.on("textDelta”, () => …

Callbacks, which are not async and can’t be streamed that way directly without wrapping it in some helper function.

(Which does seem obvious; I’m also not sure why they called it out specifically as not being async friendly? I guess most callback style functions these days have async equivalents in popular libraries and these ones don’t)

Post reply on HN