← All AI Engineer talks

AI Engineer Code 2025

Building Intelligent Research Agents with Manus

Ivan Leo· Manus1:21:30

About this talk

Ivan Leo demonstrates Manus 1.5 and the Manus API in a hands-on workshop on building research and workflow agents. He introduces Manus applications across Slack, browsers, email, and generated web apps, then works through asynchronous tasks, polling, file uploads, webhook processing with Modal, and a Slack bot that maintains task context across conversation threads. The session ends with audience questions and practical guidance about Manus integrations.

Chapters

  1. 0:00Workshop introduction and Manus 1.5 overview
  2. 3:40Product demos, browser automation, and integrations
  3. 15:47Manus API polling and file management
  4. 31:49Webhooks, Modal endpoints, and Slack integration
  5. 59:34Thread-aware agent tasks, audience questions, and closing

Talk transcript

  1. 0:00

    [on-hold music] Yeah, I think I can just start.

  2. 0:22

    Um, so the way this workshop would just be run is we'll show a few demos of what we've, uh, we built with Manus, uh, what we have at the moment.

  3. 0:30

    And then, um, if you guys have any questions at any point in time, feel free to stop me. Um, throughout this whole workshop, what we're gonna be using is the new Manus API, and then we'll go...

  4. 0:38

    basically we'll reproduce our original Slack bot. Um, so if you use our new Manus app, you can actually now use Manus in Slack. Uh, so hopefully it works. Uh, since I'm doing it live, I'm a little worried, but, uh, let's see. [laughs]

  5. 0:51

    So I think a common question that a lot of people are asking is what is Manus and what does Manus actually do, right? Which is quite fair because, uh, at this point we kinda do everything.

  6. 1:03

    If you go to our website, uh, you see this really long description that says, "Manus is the action engine that goes beyond answers to execute tasks, automate workflows, extend human reach."

  7. 1:14

    Um, if you search for what is Manus and the new announcements that we've made, you may have seen Manus 1.5, Manus 1.5 Lite saying that we're now faster, um, there's an increase in quality gain, some user satisfaction increase, and that we've re-architected our models.

  8. 1:31

    Um, or you might just seen a lot of stuff that we talked about, where we talked about the fact that building AI agents is just really difficult, right? And it's something we've learned as we scaled the number of conversations that we have every day to millions and, and beyond, right?

  9. 1:44

    Because now we have things like infrastructure, we have sandboxes, we have reliability, and all these different, like, considerations to take care of.

  10. 1:52

    But really what we wanna do at Manus is build a general AI agent that you'll wanna use in a variety of different ways, and we really wanna meet users where they're at.

  11. 2:00

    And from day one, we've been designing Manus with this in mind. Whether you like to use Manus in your mailbox, whether you like it in Slack, whether you have your own custom programmatic workflow, or you just like to use the iOS app on the go, which I quite enjoy, um, we've kind of built Manus to do that.

  12. 2:17

    And because of that, um, we have a lot of different ways to use Manus. Currently, we have the web and application, we have the Slack app, we have the API that we just launched, which we'll be working through today.

  13. 2:30

    We have a new browser operator. We have... Two days ago we launched the new, uh, Microsoft three sixty-five, uh, integration, which means that in the far future, or in the near future hopefully, um, when you're writing a Word document or you're doing a presentation or you're doing anything in, in the Microsoft suite, if you just add Manus,

  14. 2:47

    uh, we'll edit your PowerPoints, we'll fix your ja- your janky Excel, uh, templates or, you know, just whatever needs to be done. And lastly, we also have Mail Manus.

  15. 2:58

    And so I'll just be walking through four different demos that we built with Manus, and you can kind of see what we've been building for the last few months since we launched Manus 1.5.

  16. 3:09

    One of the things that I... Let me see if this works. Right. So I've been learning French for about a year, and honestly speaking, I am pretty bad at it. [laughs]

  17. 3:20

    It's not an easy language. And what I really wanted to do was to find a way whereby I could practice it every day. So I asked Manus to build me an application where, you know, I could practice this.

  18. 3:31

    And so the way it works is that, you know, throughout my day on my, on my phone, I'm just gonna key in a bunch of random prompts or random things in mind, like, "Hey, today I had this thought.

  19. 3:40

    Today I'm stressed about this workshop that I'm currently conducting." And once you key this in, Manus then takes a language model and finds the exact problems with what I've written.

  20. 3:50

    For example, over here you can see that there's an inline correction here whereby, you know, life is lived forward but understood backwards, right? And Manus is nice enough to give me a entire corrected version.

  21. 4:01

    But let's say, for example, I don't quite know what this word means. Well, I can just add it over here and say, "What is défi?"

  22. 4:09

    Right? And this is because every single Manus web application ships with a fully featured language, uh, model that you can call, whether it's, uh, structured outputs that you wanna use, whether it's Whisper to transcribe audio, or even in this case, just, you know, inline corrections with structured outputs.

  23. 4:27

    Um, you can even integrate any sort of provider you care about. In this case, I chose to use ElevenLabs because I had some extra credits and...

  24. 4:36

    Hope this works.

  25. 4:37

    "La vie doit être vécue en regardant vers l'avant, mais on ne la comprend qu'en regardant en arrière."

  26. 4:42

    So the beauty about this is that I didn't do, uh, a single thing, and actually, the, the cool part that I enjoy is that as I'm interacting with this, it kind of creates a profile for me.

  27. 4:51

    It seems that you're [REDACTED:age] working at Manus where you build agents. And hey, like, you know, you- your biggest strength is your willingness to tackle a lot of these abstract ideas and...

  28. 5:01

    but you're really bad at anything related to distance and time, which I get. [laughs]

  29. 5:05

    But the beauty about this is that with, you know, Manus, like with the new one point... Manus 1.5, you're able to build these really complex operations from scratch.

  30. 5:14

    And, you know, I think that's pretty cool. I would never have bothered to code this up. Uh, sir?

  31. 5:19

    Was that part of Manus's settings or the app?

  32. 5:22

    Uh, so this was just me prompting Manus on the go as I was bored in between talks at AIE. Um, so... [laughs]

  33. 5:29

    Oh, your user preference.

  34. 5:31

    Yeah. So that's just me. I just told Manus, "Hey, can you keep in mind..." Because, you know, I would say things about myself like, "Oh, I have a dog," whatnot.

  35. 5:38

    But in languages like French, you know, you need to bear in mind, like, what's your gender. You need to have all these, like, agreements. And it's kind of nice when you get, like, writing ideas on top that Manus gives every day or the language model we invoke every day, um, that gives you suggestions on what to write.

  36. 5:54

    And so this is an example of what the new web development platform can do. Let me just back to my slides. So another thing that we can do with Mail Manus where we can use word or app.

  37. 6:05

    So for example, if I'm using my phone, uh, let me try to connect it right now. So say for example here, let's say we connect to my phone, and we go, like, let's say I have a morning task at Datadog, right?

  38. 6:18

    Um, and you can just do things like maybe I just want to forward this to reply and just say like,

  39. 6:26

    uh, I think my keyboard is kind of disabled on the screen sharing for some weird reason. But basically, um, you're able to essentially take a lot of these tasks and get Manus to do them for you, right?

  40. 6:36

    And this is an exa- example of how, you know, we're able to meet users where they're at. The newest one, which I think is pretty cool, is our new browser operator.

  41. 6:46

    And so I think let me just boot up the Manus application. And so as an example, we can say, "Hey, Manus. I'm currently at the AWS Hang twenty-seven in New York.

  42. 6:59

    I would love to get a coffee after this. I'm jet lagged from Singapore where I flew in over twenty hours, and I just want something really general. Uh, just a really simple coffee.

  43. 7:06

    I just want to drop by and, and grab something. I, I'm not really... I, I kind of just want something simple, maybe an Americano, and that should be good."

  44. 7:16

    Right. And so what you actually see is that as Manus is executing a lot of this with the new remote browser operator, um, it'll think for a while, it'll go through a bunch of different things, and it'll actually kicks out a browser tab on my computer that I've set it up on.

  45. 7:30

    So what this means is that for you, if you're using any sort of thing like LinkedIn, if you're using like, um, you know, your Instagram, you have all these like platforms you're logged in that you can't access through a sandbox browser like BrowserBase, this completely changes like everything that you're using, right?

  46. 7:46

    Because now... Oh, I got... Hey, Manus doesn't listen. My bad. Uh, Manus, can you use my browser, please? Thank you.

  47. 8:00

    Oh, yeah, so actually this, uh, by right, Manus should have used like a browser that I have on my computer.

  48. 8:07

    Uh, let's give it a bit of time to run.

  49. 8:14

    Yeah, and so this actually kick-starts a tab on my computer, right? And so for a specific task whereby you need to use these authenticated platforms, just

  50. 8:25

    give... Uh, it's been a while for the computer to boot up.

  51. 8:32

    Yeah, so you can see that it actually opened a tab on my computer over here. It looked on Google Maps. It pulled it up, right? And what we're seeing this actually mean is that what's really cool about this is you spin up multiple instances of this in parallel, right?

  52. 8:43

    So you can imagine for someone with a Mac Mini running it in their basement, all you gotta do is just say, every day a scheduled task, "Hey, Manus, use this," and it'll get it done for you.

  53. 8:51

    And these are all things that you can do through the API, right? Because we built a general AI agent first and then web development capability second, we can also do some pretty crazy things.

  54. 9:02

    For example, um, if you look at the,

  55. 9:06

    this, uh, demo that I built over here. So one of the things that I found really confusing about the AIE is that there's a lot of different events. I kind of want to make sure I hit all of them, right?

  56. 9:18

    And, uh, I found the website a bit confusing [laughs] personally. And so what I, I told Manus to do was, "Hey, Manus, can you go to the website? Can you open the browser?

  57. 9:28

    Can you open a single event, and then can you scrape everything there for me?" And so what Manus did is that it actually scraped every single thing on the single brow...

  58. 9:36

    on the website. It put it in the JSON file, and then it loaded it into this website for me. Um, you may notice a very brutalist theme, and that's because I really like, uh, Chroma's website design, so everything I build looks like Chroma to some degree.

  59. 9:48

    But what you get out of this is that, let's say I am interested in twenty twenty-six, the year the IDE died. Well, you can see that the description has been scraped.

  60. 9:57

    I can add to my Google Calendar in one click, and I also have similar events over here, right? For example, if I'm interested in the year the IDE died, maybe I want to check out MCode or AGI: The Path Forward.

  61. 10:08

    Everything that I did over here was just built by me prompting Manus because I was like, "Hey, I like this event. Anything else I should pay attention to?" Right?

  62. 10:16

    Everything here is because Manus can build in with external platforms such as Chroma. Um, and all I did was give it a Chroma API key, an OpenAI key so it can do embeddings, and now we have this.

  63. 10:27

    Now, my favorite feature is that after starring everything that I'm curious about, I can scroll up, I can go to my timeline, and then instantly I see a list of everything over here that is happening for the day custom to me.

  64. 10:42

    And so yesterday, I was really happy to actually check out the new talks by Will Brown and the Applied Compute guys, which were really technical. And this is an example of what you can build with the web development framework that we've put together.

  65. 10:54

    We also have support for things like Stripe, which because we ship with a full Docker image, you can install anything on it. Uh, some of my favorite examples, you've, you've used anything a bit more complex, uh, you need a Redis queue.

  66. 11:05

    You can actually just install Redis on the web app and use BullMQ, and you're good to go, right? Um, Stripe integrations, if you use a lot of other platforms, because they're not full Docker images, they're not full applications, they're just giving you a nice front end.

  67. 11:20

    You're not actually able to do things like webhooks or more complex integrations. But we can support that. And if you use our Stripe integration, for example, um, we automatically set up webhooks for you.

  68. 11:29

    We have ways to test it, right? Manus can receive the webhooks. And in the future, we'll be rolling out things like auto-scaling, warm deployments, and all the important things that you need in order to essentially build a single MVP idea, right?

  69. 11:43

    You can integrate anything you want. You can add any packages you want. And please don't abuse this platform, guys. I kind of like my job. [laughs]

  70. 11:51

    Uh, we s- uh, it's, it's been, uh, we've, we've worked very hard to try to keep it, uh, good and cheap for everybody, you know? Um, but most importantly, it's like, it really is the fact that if you build a general AI agent instead of verticalized, um, products, you can do so much more.

  71. 12:04

    And I think that's kind of what I'm driving at here, right? Imagine building this six months ago. I would have to build a web application. After I built the web application, then I need to set up my Chroma account.

  72. 12:14

    I need to get my Chroma DB set up. Then I need to maybe find cloud code, boot it up. After I put it together, I now need to think about, hey, where do I deploy it?

  73. 12:23

    But with Manus it kind of just works, and that's kind of the beauty of it. And things will get better, right? Uh, so I've talked a lot about what Manus is, uh, and so I guess I should move on a little bit to the Manus API, which is what most people came here for.

  74. 12:37

    And so what is the Manus API? Well, earlier you've seen a few different examples whereby, you know, you've used Manus to build websites. We've used Manus to do things like remote browser operation and, you know, Manus also ships with the ability to query things like your Notion, your custom MSPs, whatever sort of like, you know, code they

  75. 12:56

    need written because every single Manus chat ships with its own sandbox. And so you get the exact same things with the API. So some-- so what are some things that we built internally, right?

  76. 13:08

    The Slack bot is the thing that's public-facing. Our Zapier integration is built on our API. Our n8n integration is also built on our, on our API. And we built a lot of our own support bots in-house, whereby before anyone looks at it, if it's something that's important, Manus can go to the chat, click on every single message,

  77. 13:27

    and at the end it gives a full report with screenshots, because it has a browser, of everything that you can do. And so I really liked what I built internally, and so I thought, "Why don't we build it together?"

  78. 13:38

    Right? Um, this is a very complicated, and I, I kind of hope Stripe and Modal work nicely with. So we'll see. Uh, hopefully, fingers crossed. Um, but through this we're gonna work through a lot of the simple ideas.

  79. 13:49

    Um, we'll be looking at a few different notebooks. If you wanna sort of, um, see the notebooks, um, I have them over here at this link. So tinyurl/ManusAPIworkshop. And so in order for you to get started with that, you'll need a Manus API key.

  80. 14:05

    Um, if you have a normal Manus account, the billing for the API is exactly the same as if, if you took a chat. So whatever you would spend for the same query in a Manus chat on a web app, the API would cost the same.

  81. 14:16

    And really for now, this is a, this is what we want you to do, 'cause we want Manus to meet you where you're at, right? We don't want you have to worry about if I use the API, is it more expensive or less expensive?

  82. 14:27

    Is the chat different? Should I use the Slack integration? We want you to be able to-- We wanna provide a customal-- customizable way for you to be able to work with Manus.

  83. 14:36

    And so, um, this is the tiny URL link, and I'm just gonna proceed on to the next bit.

  84. 14:44

    So the first thing we're gonna do is we're gonna look at some of the API fundamentals. Um, so I have the API over here. Um, you need these three environment variables.

  85. 14:53

    I've tried to make it very easy for you to set up, uh, Slack, even though it is a pain in the ass. Um, so here are the five notebooks that we're working through, and if you scroll down a fair bit, I have the screenshots on how you can actually get your own Slack tokens.

  86. 15:07

    Um, so let's begin. So the first thing you need is basically a Manus API key. And once you have the API key, you need to put it in this .env, uh, .env form.

  87. 15:21

    I've provided basically the env variables you need in a .env.example. But you basically need a Manus API key, a Slack bot token, and a Slack signing secret.

  88. 15:31

    So let's load it in. Okay, I kind of need to...

  89. 15:36

    Holy shit, that was tough. Um, so you can see that now that we've loaded it in from our env file, um, let's test it out. So

  90. 15:47

    we're just gonna check what files we've uploaded prior to this, and because this is a fresh account, we haven't uploaded any files. Um, you're just gonna get object lists, even though normally you have a data property.

  91. 15:56

    And so this means that our API key is working as intended. Um, one of the benefits of using the Manus account is that we often have a lot of clients that come to us saying that, "I have sensitive files.

  92. 16:06

    I have things that, you know, I wanna make sure no one else is able to see." And so every file that you upload to the Manus API, files API, is basically gonna be deleted automatically in forty-eight hours.

  93. 16:16

    And so that means that whatever sort of, um, temporary file you're using, if you delete the session, you can delete the file at any time. But if you forget, like, "Oh, I upload this file, maybe I wanna use it later," we will delete it for you.

  94. 16:27

    Right? But you have to delete the session for the file to be gone.

  95. 16:32

    Okay, cool. So we validated that the API key works. So let's create our first task. Um, I'm just gonna be using the pure request here, where I make a call request.

  96. 16:41

    But in our documentation at open.Manus.ai, we do also have support for things like the OpenAI responses SDK, if that's something you're using. Um, if you're using any sort of AI framework, I, I've heard a few at this conference like AI SDK, Copilot AGUI or something like that.

  97. 16:58

    Um, there are a whole bunch of them. Uh, please feel free to reach out to me. Um, I'm happy to try to see how we can make that work.

  98. 17:04

    So let's try our, our first query, right? Um, let's ask Manus: "What is two plus two? Please provide a brief answer." So let's

  99. 17:12

    run it. And when you run your first Manus API task, you see that you get a few things back. You get a task ID, you get a task title, and you also get a task URL.

  100. 17:23

    And so these three things are really important, particularly the task ID. The reason for that is that when you interact with Manus and you're using Manus as part of your workflow, part of your application, you might get things where Manus will ask you for certain bits of clarification like, "I'm sorry," like, "I need to understand a bit

  101. 17:38

    more. What do you exactly want?" Or it'll come back to you and with some sort of data and you wanna actually give some follow-up feedback. And so by keeping the task ID around, you're able to push to the same session.

  102. 17:49

    So let's click a bit on this task title that we've gotten back. [coughs]

  103. 17:54

    And... Do I need to-- Oh, did I use the wrong API key? I think I used the wrong API key, guys. I'm sorry. I will load a new API key for myself.

  104. 18:09

    I think it's this other one. Uh, yeah.

  105. 18:14

    Yeah, so you can see what is one, what is two plus two, and then you got four, right? So this is the... Basically, we-- when you don't specify a chat mode, we have a router on the back, and it tries to determine if you need to use basically simple chat or the full-fledged Manus agent.

  106. 18:29

    And I think this is something that's pretty, uh, simple. But if you want full fine-grained access, we can-- Those are parameters that you can set on the API.

  107. 18:38

    So if you've looked at the agent profile, right, the, basically the profile, the, uh, payload that we sent over, you may notice this agent profile, Manus one point five.

  108. 18:49

    We talked about it briefly at the start, but there are two kind of models that we sh-- currently use in Manus. One is Manus 1.5 and one is Manus 1.5 Lite.

  109. 18:58

    For a lot of these more complex tasks, we highly recommend using Manus 1.5. For example, both of the websites earlier were coded 1.5. If you have very simple queries, things that you want to execute a bit faster, we recommend 1.5 Lite.

  110. 19:10

    So for this workshop, we're going to be using 1.5 Lite because we want a faster response, but also a lot of the things that we are working with are not that complex.

  111. 19:18

    And so with this new agent, you have a lot of things like unlimited context management. So what that means that once you go beyond the sort of length context window of the normal model itself, like whatever model we're using under the hood, uh, we do a lot of smart context management.

  112. 19:33

    And because for us, when we designed Manus, we tried to make sure that the KB caching is very high. Uh, if you read our article on, you know, context management by Peek, our CTO, in, um, June.

  113. 19:44

    Um, also this means that for you, the responses are fast and quick. And so the easiest way is just to say you can just poll Manus, right? So let's start another task.

  114. 19:53

    Look up the weather in New York City and then ask me a question about it, right?

  115. 20:02

    Yeah, so you can see that the task was created successfully, and you get a task ID, a task title, and task URL. Now, if you wanna just poll this, it's pretty straightforward.

  116. 20:10

    Um, there are basically three states that the Manus agent can be in. They're gonna be either running, pending, completed, or error. Um, ideally, you never see error. [chuckles] Error is a very rare case.

  117. 20:24

    You also have completed, that means the Manus agent is done. Pending is when it's, it requires more input from you. And so currently we're polling over here, and we're seeing that the task is still running.

  118. 20:34

    The progress of this, the task, could you take a look at it?

  119. 20:40

    The weather in New York City over here.

  120. 20:43

    So Manus is currently waiting for a response from us. See, I've looked up the weather forecast. My question for you is, given the rainy forecast for Monday or Tuesday, would you prefer to plan an indoor activity or an outdoor activity for one of those days, right?

  121. 20:55

    So we see here's all the-- Here's what you get back when you actually query the information on the task. You get the credits you've used. Um, you get the response back.

  122. 21:03

    This is sort of similar to the OpenAI responses SDK, but basically we expose everything to you.

  123. 21:08

    And so you get back basically your messages and the messages that Manus sent to you.

  124. 21:13

    And so, let's say in this case, if we look at the original chat, Manus said that given the rainy forecast, would you prefer to plan an indoor activity or an outdoor activity for one of those days?

  125. 21:24

    And if so, which day and what kind of activity would you prefer? Well, I guess in this case, um,

  126. 21:30

    I guess I'll, I, I guess I'll prefer an indoor activity on Tuesday. Uh, probably choose probably an indoor activity on Tuesday.

  127. 21:41

    So we let it run for a bit.

  128. 21:44

    And you can see that the, the same sort of message was pushed to the same chat. And what this allows you to do is ensure that as you're running more and more complex workflows, you're able to ensure that all of your context is kept within the same chat.

  129. 21:57

    And so you can use the same polling interval. This is a very simple pattern. As you're prototyping in the Manus API, polling is the easiest way to get started.

  130. 22:05

    In the, in the third notebook, we're gonna look at basically how to use webhooks. Um, but for now, I think polling is pretty straightforward. Um, you basically just check to see what is the current status of the task, given the four sort of statuses that we talked about:

  131. 22:15

    running, pending, completed, and error. We take those, and you can determine what to do next in your application.

  132. 22:23

    So this is essentially the first core mechanic of the Manus API. We talked about authenticating your connection to the Manus API, creating your first task, managing the entire asynchronous life cycle from running a task, you know, really doing like the initial polling.

  133. 22:37

    And then we also talked about how to push to the same task. So what's really important when you work with any sort of language model is you need some sort of context, right?

  134. 22:46

    Um, sometimes that might be a PDF of your current policies. Sometimes that might be, you know, some sort of system prompt you wanna upload. And so we have three different ways to do so in the Manus API, right?

  135. 22:56

    Um, as usual, I've defined a small library over here, um, env.py, that does basically the same things that we did in the previous notebooks. So you can see over here, all we do is we just test given a files API, and then we return the env key.

  136. 23:12

    So let's see how this works. Let's load it in first.

  137. 23:18

    So now we have our API key and the base URL loaded in. So what I really love watching is Rick and Morty, and for a long time, it was one of the funniest shows that I enjoyed.

  138. 23:27

    And actually, they have a free API. And so what we can do is we can grab the first maybe hundred characters from Rick and Morty, and let's get Manus to figure out, like, what exactly Rick and Morty, how their characters have been.

  139. 23:39

    So we fetched everything, and we can just save it to a rickandmorty.json file, right? rickandmorty.json. So this is how it, how it looks like. We have every single character.

  140. 23:48

    We have the episodes that they've been alive for. And over here, you have Morty, you have Rick, their status, and you have the origin, their current location, and a short image about them, right?

  141. 24:00

    And so with the Manus, um, API, we support this thing-- we support file uploads, and this is much more useful if you have sensitive files, files that are much larger than normal.

  142. 24:09

    And so this, what we basically do is if you give us an API key, if you gave us, let's say, if you send a request to us and say, "Hey, I want to upload a file."

  143. 24:16

    In this case, it's called rickandmortycharacters.json. What we're gonna do is we're gonna check on our database, we're gonna save it, and then we're gonna give you an S3 link.

  144. 24:24

    And so what this allows you to do is to be able to upload much larger files. And all you gotta do is do a put request. So we've created this file, and you can see the file ID is basically file [REDACTED:generic_id].

  145. 24:35

    You get a file ID that starts a file, basically. And then we're gonna tell Manus, using the attached Rick and Morty character dataset, let's create a simple and visually appealing website.

  146. 24:45

    And so we've uploaded the file, and let's take a look at the Manus website over here.

  147. 24:59

    Just check. I think it's in my other account.

  148. 25:03

    Yeah, so you can see over here that basically Rick and Morty, uh, we've uploaded the file. If you upload any images, any PDFs, we already come out of the box support for things like parsing of PDFs, looking at handling all that multimodal, uh, content.

  149. 25:18

    So that's really useful for you, right? So let's, Manus is gonna run. It's gonna create this website. We'll check back in a bit. But this is basically the first files API.

  150. 25:27

    And if you have large files that, you know, you might want automatically deleted at some point, this is a really useful way to do so.

  151. 25:34

    The next way that you can do so, uh, you also have the ability to delete this file any point in time, and this is an API call that you can run.

  152. 25:40

    Next way you can do so is if, let's say, you're using a URL attachment, right? A lot of times you might have a URL that comes from something like CircleBack, right?

  153. 25:48

    You've, you've just done a call, you have a transcript, you want to send it over to Manus. And so we actually do support, um, raw call transcripts. So what I've done is I have basically created a fake transcript.

  154. 26:02

    Yeah. Uh, so I think this file was deleted by me accidentally.

  155. 26:07

    Uh, all is good. Warren Buffett. Uh, investor letter.

  156. 26:14

    So thankfully, Berkshire Hathaway releases like a bunch of investor letters, and so we can just provide a PDF link.

  157. 26:26

    So instead of a transcript, maybe this, we're just gonna just do like Warren Buffett.

  158. 26:31

    This should work. This works. And then maybe we wanna, at this point, we wanna analyze, given this investor letter that we have, can you help me parse out? Can you help me summarize it and give me some insights into

  159. 26:50

    what the company is looking to do? Right. So...

  160. 27:06

    So now we can start a task, um, that automatically out of the box works with these, uh, public URLs. One of the things that I actually wanted to show over here is that with a lot of these, um,

  161. 27:16

    basic tasks, um, any of the connections that you have in Manus, for example, Gmail, Notion, that you've already configured ahead of time, um, these all work out of the box and all you need to do is basically go to Manus.

  162. 27:26

    Um, let's say our website is over here. You look at the connection over here. If you go to Manage Connectors, you can use any of these connectors just by copying this UUID over here.

  163. 27:37

    If you copy the UUID and you add it as part of the connector's payload, um, it'll work out of the box for you.

  164. 27:43

    We also support things like Base64. Um, so this example over here, we just had a simple four-oh-four page. Um, this was a screenshot that I took of a page that Manus created.

  165. 27:53

    And so what we wanna do over here is, uh, create a automatic bug-- automa-automated bug investigation task, right? A user's reported that the settings page isn't working. Uh, let's give this Base64 encoded image to Manus, and let's see how it can figure it out, right?

  166. 28:06

    Can you be Thara? Here's a website that we've created ahead of time. And can you figure out what exactly are the problems with this, right?

  167. 28:15

    So this is a simple Manus web app that I've created. Um, actually, if you go to the settings page, you get a four-oh-four. There are also an other few pages that also have four-oh-fours.

  168. 28:23

    So let's see how Manus performs in a bit. Right. So if you look at our Rick and Morty character dataset, Manus has sort of characterized all of this in a pretty cool, uh, website, right?

  169. 28:33

    You have the gender distribution, you have male, female, unknown. Rick Sanchez is obviously alive, as is Morty, uh, since it's Rick and Morty. And you have all these other characters that's, that are uniquely sort of characterized and visualized over here.

  170. 28:47

    For a lot of these internal tools, you can imagine that if you have a lot of data you wanna churn through, you can create a simple website just to visualize all of them out of the box, and that's pretty useful.

  171. 28:56

    Similarly, for this, uh, investor letter, you can see that

  172. 29:00

    we uploaded it, and Manus actually detected that even though I called it calltranscript.json, it looked and said that the file is a PDF, not a JSON text. And then it completed a analysis of Warren Buffett's investor letter, and it gave like this whole analysis at the end.

  173. 29:16

    One pretty cool thing is that we can take this, um, simple,

  174. 29:22

    uh... We have the task ID, and so we go back to basics over here. Previously, we had a thing whereby we said we go to request.geturl.

  175. 29:46

    Let's see. I think let me just grab this picture instead.

  176. 29:58

    This. Um, this is not working as I thought it would. Um,

  177. 30:14

    what I wanted to show was actually that if we go to this specific, um, one over here, if we go to Manus, it will actually return-

  178. 30:25

    Just wanna show, like, the... It's not JSON.

  179. 30:37

    Yeah, so actually, if you look at the output over here, you can notice that over there Manus created a markdown file. And based off the markdown file, you can actually-- you get back the full file URL, the file name, the MIME type.

  180. 30:49

    This is really useful if you wanna do some sort of processing down the line with it, right? And so with this we've covered things like how to use the files API.

  181. 30:56

    We've looked at basically how to up-- use publicly available URLs with Manus. And we've also talked about how to basically be able to use basic info encoded images. And so let's think a bit about webhooks, right?

  182. 31:07

    So in the previous example, we created a task with Manus, we uploaded some files, and the way that we tried to determine that, you know, the, the thing was basically completed was that we pulled it every twenty seconds.

  183. 31:19

    As you're scaling out to more and more tasks, what you really want is what's called a webhook. What a webhook does is that when your task is completed, we'll send you an API, um, request, and that will basically notify you that the task is done.

  184. 31:32

    So a really easy pattern over here is that you wanna wait for the task to be completed, you get the webhook, and you get all the information about the current task.

  185. 31:39

    So in this case, this is really useful because if you're building any sort of complex application, if you wanna use this task at scale, it's not really viable for you to be able to sit there and just keep pulling the API.

  186. 31:49

    It's gonna be a bit complicated, and I think not the best practice for you. You're gonna basically have a lot of work as sitting. But if you use, like, webhooks, uh, this is a much more sustainable way for you to do whatever sort of agent you're building at a much cheaper cost.

  187. 32:02

    Okay. So I'm gonna just use Modal over here because it's a bit simpler. I'll have the Modal code on the right, and then I'll have the Manus, uh, notebook on the left.

  188. 32:12

    Let me just load up my virtual environment.

  189. 32:15

    And basically what Modal provides is it provides you the ability to deploy simple, like, um, Python applications. Um, in this case, it's a FastAPI endpoint. And so

  190. 32:28

    Modal serve server.py. So what you can see if you run Modal serve server.py is that we now get a public endpoint that we can use, right? And this is pretty straightforward.

  191. 32:38

    Um, if you run it on your own computer with Modal, if you sign up for an account, you get five dollars free. This basically gives you, like, an endpoint that you can now hit, right?

  192. 32:46

    And so let's get the... Oh, I think someone already hit my endpoint. [laughs]

  193. 32:52

    Oh, that's a bit stressful. Okay, guys, please be nice to my endpoint. Um, but you can see that over here, um, in the sub over here... Oh, wow, another person's hitting my endpoint.

  194. 33:01

    Uh, all right, guys. Anyway.

  195. 33:03

    Chroma.

  196. 33:04

    Maybe it's streaming in. Uh, that's kinda awkward. But, uh, anyway, yes. So, um, if you basically wanna register an endpoint webhook with Manus and you register a webhook with us, when a task is created or when a task is stopped, we will send you two webhooks.

  197. 33:18

    And what this allows you to do on the front end is that then you know when you send a request to us, whether we started processing a task and when your task has been completed.

  198. 33:26

    Um, the typical Manus task is gonna take roughly three to five minutes, and if you have something that's a bit more complicated, uh, this is gonna be... You're not gonna wanna sit and pull, and so the webhooks are a good way to do so.

  199. 33:36

    So let's see over here how we can mimic a webhook that Manus would send. Over here you have a test payload, message ended. I think that's what people were running, uh, with my, uh, URL. [laughs]

  200. 33:46

    And so, um, you can see now that this is a really useful pattern because if I'm building and I have like a hundred Manus tasks running at once, right?

  201. 33:53

    I don't wanna keep polling for all of them. And so with a webhook, I can easily receive a lot of these, um, notifications as they're running.

  202. 34:00

    So let's register this webhook with Manus. So all we gotta do is basically post to Manus. Um, I'll-- You have a base URL that we have, uh, manus dot...

  203. 34:11

    api.manus.im/ai. Let me just double-check. I think I have that.

  204. 34:17

    The base URL is api.manus.ai/v1. And so if you post that, then you will register a webhook successfully. And in this specific case, the webhook we wanna register is this one over here.

  205. 34:29

    If you go to the Manus, um, connector setting, uh, over here, Integrations, Built with Manus API, um, you see that this is-- It will appear basically over here, the new webhook that you've, uh, registered.

  206. 34:42

    And so whenever you create a task, it will automatically send you a notification over there.

  207. 34:47

    So let's create a simple task and... Oh, wow, people are still sending me stuff. Um, and so let's create a simple, uh, task over here. And then

  208. 34:58

    try to get it, uh, working. Yeah. So we've created, "What is two plus two?" Provide a brief answer. This is over here. We've seen that the task is running, and this is gonna think a little.

  209. 35:11

    Then it kinda just runs like echo two plus two, VC or whatever that is. And then it will send you an answer. And so you can see over here that now that the task is completed, you get the full, uh, payload over here.

  210. 35:24

    This is kinda what it looks like. And if, let's say, we paste this.

  211. 35:31

    JSON. Okay. But basically you get back, um, at this point, you get the ID of-- that you have.

  212. 35:49

    So what this means is if, if you have multiple sort of Manus tasks that are running, you can identify them by the task ID. You can also get back the current task URL.

  213. 35:57

    You get the output of it, which in this case the status is completed. We sent it. We sent to Manus, "What is two plus two? Please provide a brief answer."

  214. 36:05

    And then we said, "Let me com-- calculate that for you." Yeah, people are really running it quite a fair bit.

  215. 36:11

    Um, and so now that we've actually processed the webhook, uh, notification, um, what we might wanna do is we wanna just get the entire conversation history. And so to do so, we can set a simple secret over here.

  216. 36:24

    And so what this allows you to do is that when you're running your Modal server, you basically are able to make a request to the Manus API and get back, um, a list of every single- Um, chat message that's been happening in there.

  217. 36:34

    I've done this ahead of time, and so we can just

  218. 36:39

    put this over here. So all this does is that if it's done, it'll just get a full request, and it gets task details. And so what you saw with there was basically what happens, uh, when we do this ahead of time.

  219. 36:52

    So now let's, um... So that is basically, uh, webhooks.

  220. 36:56

    Yeah.

  221. 36:57

    So in the previous-- So right now we've looked at how to create a task. Uh, we've looked at basically how to upload files, and then we've also covered, like, how to use a webhook.

  222. 37:06

    Um, so let's now look at basically how to use Slack, which I think will be a lot more fun. So, uh, in the previous notebook, we looked at how to use webhooks.

  223. 37:14

    This case, we're gonna start integrating on Slack. I've created a Slack workspace for myself. Uh, it's just called Ivan Personal. And so in this small channel over here, we're gonna be interacting with our Manus chatbot.

  224. 37:26

    So first thing you wanna do is you wanna make sure that you have your Slack, um, signing secrets. Uh, these are basically-- I have instructions on the Read Me on how to get the bot signing secrets.

  225. 37:37

    Then you wanna basically test it. Slack provides a off-test, uh, so in Ivan Personal for the bot Mani, you can basically test to see that your secrets are working as intended.

  226. 37:47

    And so this is really important because if your environment variables are not correctly set up, then you're not gonna be able to do this.

  227. 37:55

    Okay, cool. Let's run this bit by bit. So we're gonna just start by defining a simple, um, Slack, uh, simple bot over here. Just gonna call this

  228. 38:08

    chatbot dot py. And so let's run modo serve chatbot py.

  229. 38:17

    And so when you run this slack dot ipyb, you'll find that what you need to do then is

  230. 38:27

    we've initialized a simple modal app. We've added some dependencies. We have to use Slack secret over here that we stored ahead of time. And then we just have a single endpoint over here that's called slash webhook slash Slack.

  231. 38:37

    And so you will have something like this where you have, like, a simple, like, endpoint that you can hit. And so in my case, um, this will be the endpoint that I have, right?

  232. 38:47

    And so you can see that if we hit this endpoint over here,

  233. 38:55

    it takes a while to run, but basically you get back status two hundred okay. And so what this means is this is a publicly available, like, uh, endpoint for you to hit.

  234. 39:04

    So when you mention anyone in Slack, for example, over here, um, before our bot is configured, if you just something Mani, like, what's up,

  235. 39:11

    um, you're gonna get a message from Slack. Similar to how the Manus API worked, you're gonna get a webhook with some sort of payload. And this enables you to essentially be able to, um, look at the input, and you're gonna get something like, um...

  236. 39:28

    So you're gonna get, like, some sort of information from Slack, right? So we have this, um,

  237. 39:35

    over here. Let's go to Slack API dot Slack dot apps,

  238. 39:40

    right? So we wanna just make sure that--

  239. 39:46

    So previously, we made sure that the Slack-- that our, that our server was able to receive a response. And so the next step that we're gonna do is we're gonna make sure that our server is able to be registered as a webhook on Slack.

  240. 39:55

    When you actually make a request to Slack, you need to make sure that when you respond, you actually get back, you get back a challenge URL. So

  241. 40:03

    this is what you can see. We'll just rerun this, and we have this URL over here, and then we're just gonna put

  242. 40:12

    inside the event subscription. Right. So this is verified, and what happened was that, you know, Slack basically sent us an API request, and we were able to successfully respond to it for the challenge.

  243. 40:32

    And so if you see, like, a verified over here, you just need to save the changes, and that should work for you.

  244. 40:42

    Let's see. Right. Then once you've done this,

  245. 41:00

    we mention our bot in Slack. Let me just check. We should get a API request from Slack. And so you can see that this was the mention over here.

  246. 41:16

    So over here I said, [REDACTED:username], what's up? And over here you see here's a text, what's up, right?

  247. 41:22

    And what you find is that if you just get the raw text, you're gonna get the user ID, and that is something that you wanna parse out in the response.

  248. 41:30

    Cool. So let's try to figure out how to respond to Slack over here, right? If-- I'm just gonna copy and paste this entire Slack event that we previously had.

  249. 41:49

    So this is the Slack. I'm just gonna paste the Slack event over here so that we're able to

  250. 41:55

    have it for context and when we wanna send a response back to Slack, what we need is basically the channel that was sent in, the thread TS, and so that's how Slack identifies the right item.

  251. 42:07

    And so let's get it from-- You can basically get it over here. So

  252. 42:13

    you wanna get the channel. Then you wanna get the event TS, right?

  253. 42:24

    So let's send a response, and you can see that in Slack over here, we got a response that said, "Hello, world." And so this is really kind of how your application will work, uh, if you're building a Slack bot.

  254. 42:34

    You get a, you get a API request from Slack, and then once you get the API request from Slack, you do something, and then you return it back. Uh, one of the things to note when you're building on Slack is just that, uh, you need to send a response in roughly, like, three seconds.

  255. 42:45

    Uh, if not, they're gonna try again. And so if you're building any sort of Slack bot, you wanna ideally keep some sort of server warm.

  256. 42:54

    So let's try again to maybe... You know, in this case, we're gonna send some files over here. So let's say we wanna send the Berkshire Way- Berkshire Hathaway twenty twenty-five investor letter.

  257. 43:08

    Well, with Slack what you can do is you can basically just upload the file first. And so let's try uploading it to the right channel.

  258. 43:19

    And let's upload it here. Cool. So now we have it uploaded to the channel. We have a ID, and we can actually post the same message over it.

  259. 43:35

    Looks out of the box. So I've added-- So previously you saw that we got a Slack file ID, and then when you have the Slack file ID, when you post a message, you just upload a file, we get back a list of file IDs, and that is included as part of the attachment itself.

  260. 43:47

    And so let's say over here, we're gonna take this, the channel that we previously used.

  261. 43:54

    The event TS. This does not find. Yeah.

  262. 44:12

    So if we look back at this, uh, chat over here, you can see that we sent-- we essentially, first one over here, uploaded it to the channel, and then the second one at the bottom over here, basically sent the same thing over there with Hello World.

  263. 44:22

    Um, one of the problems you find over here is that we actually didn't upload it to the right, uh, thread, right? We uploaded to the channel. And so when you're working with files in Slack, you need to make sure that you keep this in mind.

  264. 44:32

    And so this is, um, basically how you work with files in Slack. And so let's now try to get Manus involved over here.

  265. 44:42

    Okay. So now we're gonna build Slack integration.

  266. 45:02

    So previously up ahead, we had these, uh, functions over here, and so we can just use them to just add it in.

  267. 45:24

    Okay. We're gonna add this, uh, Slack message over here.

  268. 45:48

    Use a @mention event. That's from the Slack SDK. Um,

  269. 45:58

    yeah. So we previously defined a function called post Slack message, and so let's make sure that we have that running.

  270. 46:25

    Then we had a bunch of different helper functions up here. So let's, uh, make sure that we also copy them.

  271. 46:34

    Great. So data class is not defined. All you need to do over here is just define a data class. And then file ID, file ID.

  272. 46:50

    Cool. So now that we've added in a whole bunch of these different things that we previously had, um,

  273. 46:56

    let's see how this works on the main Slack, uh, application.

  274. 47:04

    We're gonna just add this, uh, small portion up here.

  275. 47:18

    Cool. So with this, what our goal is, is basically to reproduce what we did in the notebook manually. So let's try to see if this works out. Uh, Manus secret was not defined.

  276. 47:47

    So now that we've started up, then... Post here. Stop.

  277. 48:02

    Cool. So we had a small bug over there. And so previously what we did in the previous portion was that we tried to basically, uh, get Slack working, uh, with a web.

  278. 48:11

    And so what I did wrongly was just that if I--

  279. 48:17

    I didn't define, like, the Manus URL, and so let's just have it run over here.

  280. 48:24

    So you can see that now we have a response of what we did manually, just, uh, copying it bit by bit, right? And so this mean-- With this, we've now figured out how to basically work with Slack.

  281. 48:33

    If I send a message, I can get a webhook, and I can process it with my modal server, right? This is a really simple sort of approach, but it's really useful when it comes to doing anything else.

  282. 48:42

    You can imagine that for you, if let's say you're doing some sort of, uh, complex processing, you might get the user's information- Gets us some metadata from the user, fetch the prior conversation DB, and then actually start sending the task over to Manus to start executing.

  283. 48:56

    So let's now see how we can actually get this running with Manus. So

  284. 49:02

    I have a function over here called create_manus_task. It does something very similar to what we did previously, which was that we'll post a request to Manus. We would have a basically an environment variable that we send it along with, and then we would then, in this case, just send a prompt.

  285. 49:14

    Right? So let's test it out. Create a Manus task. Uh, and then instead of this over here,

  286. 49:22

    we're gonna create a Manus task. Then we're gonna take in event.

  287. 49:39

    Task ID is like this, and then we'll see if I'll create it successfully. You can view it here.

  288. 49:44

    So I'm just gonna add a simple, um, wake-up function so that we can just wake this, um, server up as we need.

  289. 49:53

    So let me just go back to the web app.

  290. 49:57

    Sure it's running, it's woken up, and then let's try to kick off a task in Manus.

  291. 50:02

    So, "Mani, what's the status in New York?"

  292. 50:15

    Cool. So now we've, uh, got a post request, and Manus replies with the fact that, "Hey, we've created a task successfully with Manus." So let's ch- take a look at this task and see how it's been.

  293. 50:26

    Task should appear inside here. What's the weather in New York, right? So one thing you've noticed is that we don't actually get the response, right? We can send these, um, current task over to Manus.

  294. 50:34

    We can kick some of these tasks off, but we don't get the response. So let's see how we can

  295. 50:42

    fix that. Yeah. So what we're gonna be doing is we're just gonna be

  296. 50:55

    checking over here. [softly]

  297. 50:56

    Post a personal.

  298. 50:59

    Sorry, let me, let me go back. Sorry, guys, I'm just a bit stressed out today. [chuckles] Okay. Anyway, one thing that, um, we saw just now over there was that this is kind of an ugly setup.

  299. 51:07

    And so what we're gonna be doing is just making it a little bit prettier. Um, if you notice in the text, you get the basically ID of the, um, user.

  300. 51:14

    In this case, when I tag Mani, [REDACTED:username]. You saw that there was this really ugly section over here where it said, um, you look at the text, you get this zero nine FDL.

  301. 51:24

    Um, if you use the Slack API, what you find is that you're basically able to get a list of all the users, and you can then do some parsing.

  302. 51:29

    You might have some ad- additional data on, like, what exactly that this user represents in your database. But over here, we're just trying to make it a bit prettier for now.

  303. 51:38

    So we're gonna update the post Slack, okay?

  304. 51:42

    Post Slack message. So we're gonna just update this message over here.

  305. 51:54

    Uh, then we have a bunch of these different types, so we just need to update them. Then from typing, we'll just add optional.

  306. 52:07

    Then the Slack response up here. A Slack response.

  307. 52:13

    Yeah. We just need to import the Slack response so we get something that's typed, and that should be good to go.

  308. 52:21

    And so now we post the message. We have blocks, um...

  309. 52:54

    So we're just gonna make this a little bit nicer over here with Manus. And so what this means is that over here, Slack has this wonderful thing they ship called Slack Block Kit.

  310. 53:02

    So you can cust-- If you've used a lot of these, uh, Slack bots, uh, previously, you'll find that they ship these nice little buttons. Um, and so you can actually do that out of the box with this thing called Block Kit.

  311. 53:11

    So what we'll be doing over here is we're just gonna add this thing called we started working on our request. And then we'll add the URL over here and a little emoji called View on Web.

  312. 53:18

    And the URL over here would just be the task URL that we have. And so with the post Slack message, we can just add blocks to be blocks.

  313. 53:27

    And so since the blocks will be sent over, I think we can... Let's see if this works. Let's hope this works.

  314. 53:37

    And then I'm just gonna go back and remove the original. Since we're no longer using the text, we can just use the box. And so let's remove that. Okay, let's wake up our server a fair bit over here.

  315. 53:52

    Let's wake up our server, make sure it's running.

  316. 54:00

    And then I'm just gonna ping, "What's up?"

  317. 54:08

    Cool. And so... Oh, there's an argument. So I'll just put... I think over here we can just put, like, text

  318. 54:17

    was created. Uh, I think we don't need a text over here because it's good to go. Yeah. Let me try it again.

  319. 54:37

    Cool. So this, um, essentially, you can see that now we have a much nicer, enriched sort of UI. And if you click on this, um, you'll be able to essentially see, like a, a message over here.

  320. 54:47

    "Hey, I'm Manus. I'm your friendly UI, your friendly, um, chat assistant. What do you need from me today?" Right? Cool. So with this, we walked through how to create a Slack, um, task.

  321. 54:58

    Manus can now actually receive a message from Slack. And so one thing that's pretty useful if you've looked at basically any of our, our Slack bot is that it can take multiple conversations.

  322. 55:06

    I send a message, Manus responds, I send another message. Um, yeah, so what you wanna do is you wanna just enable multi-turn conversations. And so the way you wanna be able to, uh, to do so is that, uh, you want a way just basically to store if you've seen this, uh, thread before, right?

  323. 55:21

    Because if every time you send a message and you wanna post to the same thread, you need to kinda keep track of that. And so what we'll be using over here is just a simple dictionary that Modo ships with.

  324. 55:30

    If you're using anything like Cloudflare, you can use like a- a KV store. If you're using some sort of database, these are things you can load into the database.

  325. 55:36

    But that's basically, um, what you can use out of the box.

  326. 55:40

    And so Modo has a pretty, uh, good dictionary, um, out of the box that we're gonna be using, but I think it's good to get a rough sense for how it sort of works.

  327. 55:48

    And so what we'll be doing is just be adding two simple endpoints, uh, that we can use to post and set, um, these requests.

  328. 55:57

    One set. And so we'll be adding them to our actual server.

  329. 56:02

    Let me just fix this. So we just need to make sure this, uh, demo dict is added inside this.

  330. 56:17

    Yeah. Okay, cool. So now we have added these two new endpoints, and so we'll kinda get a sense for how the Modo dict works before we actually start going into how to use it with the other chats.

  331. 56:28

    So- [sneezes] -over here, um, let's say when we get a chat, previously we talked about how you're gonna get some sort of response. You get a task ID, you get a task URL.

  332. 56:37

    But we also kinda wanna store things like what is the Slack channel, what is the Slack thread TS, what is the Slack user, what is the status of the current job, et cetera.

  333. 56:45

    And so by using something simple like a dictionary where we can serialize basic key value stores, we're able to do this quite simply out of the box.

  334. 56:54

    So let's see over here, um, let's say we start a simple Manus task, right? And we get back some of the task data. We get the...

  335. 57:07

    Over here, if you look at the stored value, uh, we stored the task. We just put a random, you know, like task ID over here, and then we store like task ID, task URL, Slack channel, et cetera.

  336. 57:17

    But you can also get back when you retrieve this, when you hit the same endpoint, right? This gives you back what you want. And so this is essentially how the Modo dictionary works, a simple KV store.

  337. 57:27

    And so that is a relatively simple way to use it. And so let's try to use this, uh, Modo dictionary so that we can actually push to the same task, right?

  338. 57:36

    So let's first delete these two, um, endpoints that we have.

  339. 57:45

    And then let's create a new task map over here

  340. 57:50

    that we can basically use, store basically a mapping of a thread ID, thread TS to a task.

  341. 58:00

    So let's, uh, we already have the function to create the Manus task. And so all we need to do is that, you know, um, up here, like what we mentioned earlier, when you actually mention a bot in Slack, right, you're gonna get this weird, um, thing.

  342. 58:15

    And so what we wanna do is we wanna just basically parse it out.

  343. 58:26

    Right. So here's a simple function that will just parse it out. Um, we'll then check in the thread map whether or not this thread ID has been seen before.

  344. 58:34

    And this is because when we get the webhook from Slack, we're gonna see the thread TS. And if we've seen this thread before, we wanna basically push it to the same task using task ID parameter, right?

  345. 58:44

    And if we've already seen it before, we're just gonna add a simple reaction over here, which is just, you know, the goo-- the eyes that you've seen a lot of Slack bots have.

  346. 58:51

    You know, if you, "Hey, I'm on it," notify, you know, this works out of the box. All right, cool. Let us copy this.

  347. 59:06

    Right. And then we have this new function called handle_manus_task.

  348. 59:12

    Hello Slack message. And so this will essentially replace what we previously had over here, right?

  349. 59:23

    Cool. Let me see if this works. I... Right? Let's-- We have a new server. Let's boot it up again. Let's go to Slack, and let's just say,

  350. 59:34

    "Hey, Manny, what's up?" Right. And then our server boots up, it will respond. You can see over here we created a new task for thread ID. And then let's say we go into this task itself, and we say that, okay, um, [REDACTED:username],

  351. 59:50

    what's the temperature in New York, right? And so we push it to the same task. So task ID, create_manus_task got an unexpected one. Okay, sorry, this is on me.

  352. 1:00:06

    Um, so all we need to do is we just need to update the create_manus_task, uh, over here, so it takes a task ID parameter.

  353. 1:00:34

    And what we wanna do is we just wanna take this JSON over here. We're gonna make sure that if, let's say, we provide a task ID, we add it to the JSON payload that we send along.

  354. 1:00:59

    Let's call it on. Set. Cool. Let's, uh, give it a while for our server to restart. Let's boot it up again, and then let's give this a shot. We could just send the same thing again, wouldn't issue.

  355. 1:01:15

    So, this will hopefully-- You can see that right now we have this reaction. That means that, you know, we've referenced the dictionary. We've seen that this is a thread that we've seen before, and basically what we do is we push it to the same task using this, this task ID, right?

  356. 1:01:31

    So let's take a look at the live tasks that are currently being executed. You can see that this is essentially we've s-with our first message. We then push it the same follow-up message over to the same thread.

  357. 1:01:42

    And this allows you to basically be able to work with a lot of these, uh, simple integrations, like out of the box.

  358. 1:01:53

    And so right now, um, one of the problems is that, you know, the final answer never makes it back to the user in Slack. And so what we need to do is what we did previously, um, when we were basically, you know, working with webhooks, is that when we get a webhook address from Manus, we need to

  359. 1:02:09

    make sure that we push it, um, make a-- essentially, we, we post it back, right, over to the same thread and so that we respond correctly. And so just give me a while, let me code it up, and then we can walk through the code.

  360. 1:02:21

    Cool. Then...

  361. 1:02:36

    Then

  362. 1:03:13

    the last bit, we just need to upload the-- Let's just say Upload files.

  363. 1:03:19

    And that should work, hopefully. Upload files just need to be uploaded, so it also takes in a thread. Yes.

  364. 1:03:27

    Over here. Okay, cool. So the entire-- So and then we just need to add the final endpoint.

  365. 1:03:45

    Sorry, please bear with me for a bit, and then we can walk through the code for a while.

  366. 1:03:51

    Cool. Cool. So with this now, we have a, a way whereby, you know, when Manus actually gives a response, it's actually able to respond to you. And so let's, let's try it, let's try it out, and then we're gonna walk through the code of what we've exactly implemented, like step-by-step over here.

  367. 1:04:11

    So as usual, um, let's wake up the server a little bit, and then we're just gonna say, "[REDACTED:username] what's up?"

  368. 1:04:23

    Right. Um, same thing as usual. It's gonna hit our endpoint, and we're gonna create a new task, and we get a response over here, right? Started working a task.

  369. 1:04:31

    Task ID is this, and view the live task. It's just gonna execute, um, as usual. And then once it's had a response, we should get back the webhook Slack.

  370. 1:04:45

    Mm. Let me just see what's going on. Should be getting back this response at webhook/Manus.

  371. 1:04:55

    Oops. Let me just, uh, debug this for a bit.

  372. 1:05:04

    Uh. I'm just gonna bounce ahead over here.

  373. 1:05:19

    I feel like I'm encountering some technical difficulties, but I just [laughs] wanna explain a little bit of what I'm happening. I'm truly sorry. Um, basically what's happening over here is that we have a simple, um, Slack bot, right?

  374. 1:05:28

    And as Ma-as Manus is sending us a response, it's basically gonna be able to have, um, what we essentially are all of the different, um, bits of markdown that Manus is giving and sending back to us.

  375. 1:05:40

    Right? So this is really useful because a lot of times Manus will output markdown such as tables, text, images, et cetera, and you really wanna make sure that's, uh, rendered nicely.

  376. 1:05:49

    Uh, it's a bit complex in Stripe to be able-- I'm sorry, a bit complex in Slack to be able to do this. And so what you have to do is do a bit of transformation.

  377. 1:05:57

    And so what we've essentially done, if you look at the notebook, is first, when we actually create a new task, we save it inside this task info map, right?

  378. 1:06:07

    Uh, we then convert it over to a Slack markdown format. And what this does is that it basically just passes us all the existing markdown, and so that it's compatible with, with Str- with, uh, Slack.

  379. 1:06:17

    Slack has some unique markdown formatting issues, and so we just need to make sure it's consistent. And then we then take this markdown and format it into Slack blocks.

  380. 1:06:25

    Uh, we then also up-- Previously, we had a upload file as a function. And what you notice that we uploaded a file, it was always uploaded to the main, uh, channel, but not to the thread.

  381. 1:06:34

    And so how you can solve this is by passing in basically both a thread and a channel, um, parameter. And so what this means is that when Slack uploads the file, it will go not only to the channel, but the right thread.

  382. 1:06:46

    So this is really useful in that sense.

  383. 1:06:49

    So I think in the next portion, we're just gonna try to implement it so that, uh, you can sort of, um, basically have it, uh, process an invoice. Uh, I'm just gonna use the final, um, code that I've written ahead of time so that, you know, in case of any technical difficulties again.

  384. 1:07:03

    Um, but I just wanted to pause here and see if there's any iss-- any questions about how to work with the API.

  385. 1:07:12

    Cool.

  386. 1:07:48

    Uh.

  387. 1:08:13

    So let me just test to see if this is working. Uh, I'm just gonna maybe take...

  388. 1:08:22

    I think I had a bunch of, uh, images that I gave previously. So I'm just gonna take a-- take this, uh, picture of a bunch of bagels that I bought previously. [laughs]

  389. 1:08:33

    Uh, been eating a lot of bagels since I've gotten here. [laughs] [laughs] So these are pretty good actually, 'cause, uh, act-- like, I was really surprised by, um, how good a lot of the bagels were.

  390. 1:08:42

    Um, but the other day I feel like I got, I got scammed a little 'cause I, I ate a bagel that was, like, ninety percent cream cheese, like, [chuckles] ten percent salmon, and I was a bit sad about that.

  391. 1:08:51

    And so, [chuckles] um, yeah. So really, like, what this does is that if you look over here, the first thing that we get is you get a Slack webhook. Uh, you create the file, you create the Manus event, and then we're gonna post a reply.

  392. 1:09:05

    And over here you can see, "Hey, we've started working on your request." Um, if we go over to the Manus app over here, um, you see that we have this thing called a connector, right?

  393. 1:09:14

    And this is basically Notion that's out of the box. What I've done is that I've created... Oh, sorry, this file, actually. Let me just create and go to the fake one.

  394. 1:09:27

    Yeah. Anyway. Um, so we actually have a, a Notion where we have, like, the, these, like, company policies, and I've created, like, a fake company policy for you to reference.

  395. 1:09:35

    And so what you see over here is you have all this information, like, uh, the company home, like, what exactly is happening. And Manus is actually able to look at the Notion, look at the connectors, and actually give a response for how exactly this, um, is sort of related to my actual, like, claims policy.

  396. 1:09:50

    And this is really useful if you're building anything related to some sort of internal deep research sort of API, because you're constantly gonna wanna be able to reference certain things that you have.

  397. 1:09:59

    You can see that the file over here was uploaded successfully, and then Manus is able to use OCR to basically extract all the details on the receipt. In some of the previous tests that, you know, you can, you can see that there were a lot of tests.

  398. 1:10:14

    Um, you can basically see that, you know, I just spent, like, uh, thirty dollars on cats in New York. It's the cupboard. And Manus is basically able to respond, look at the company policy that's in Notion, which, you know, anyone in your company can edit, right?

  399. 1:10:26

    Notion is a pretty accessible sort of platform. And then you can take that and actually edit it out of the box. So as Manus is generating its response, we're waiting for the final webhook to be sent.

  400. 1:10:36

    And so let's give it a bit of time.

  401. 1:10:42

    Yeah. And so what you kinda expect to see is that if you give, let's say, "Can you help me update this basic invoice? Can you find the shop details, please?

  402. 1:10:49

    Thank you." And then Manus is gonna ask, "Hey, can you give me a bit updates?" Well,

  403. 1:10:54

    this one over here, you can see, like, if you look at the invoice, you know, what are the summary details, the merchant, Tompkins Square Bagels, um, what's the amount.

  404. 1:11:02

    Can you update it using a markdown table instead? And it was basically able to go to the, the right page over here, realize that, you know, the exact receipt that I had was basically from dates of, like, eighteenth to the twenty-eighth, and then also to update the right Notion page and basically say that, "Hey, these are all

  405. 1:11:18

    of the different expense-- These are actually my expenses for the last few days." [chuckles] Um, and it can break it down based on this fictitious, uh, company policy. So I think this was, uh, a bit of a more complex, uh, project, and I think at the end there were some issues with, uh, live coding.

  406. 1:11:34

    But I, I just wanna basically bring it back and try to say that, um, the Manus API is, is basically a really easy way for you to build a lot of these complex, um, applications out of the box, right?

  407. 1:11:46

    Um, if you look at the Rick and Morty dashboard that we had, um, you can see that this is pretty, pretty cool, right? Like... And if you look at the-- Let's go back to the slides.

  408. 1:11:59

    Let me slide somewhere. Yeah. So a lot of what you can actually build out of the box with the Manus API is that these are things that we've done out of the box, scaling the number of conversations that we deal with every day to millions of conversations, right?

  409. 1:12:21

    So what this means is that if you use the Manus API, you do have the ability to use any sort of integration that we ship with. You can provide your own sort of keys.

  410. 1:12:30

    You can really just, you know, um, add any sort of custom code that you have, upload these files, toolkits for Manus to use. And this means that without you having to deal with all that stuff, you can actually focus on the core business logic that you care about.

  411. 1:12:42

    And so, um, if you have any API qu- inquiries about the Manus API, um, feel free to reach me at [REDACTED:email_address]. And then if you're interested in joining the Manus team, uh, we are hiring, uh, right now.

  412. 1:12:55

    Um, and so, uh, feel free to reach out to me, uh, or just chat with me here. I'm happy to take any questions about the API and, um, thanks so much for taking the time to listen to this.

  413. 1:13:04

    I'm curious how you think about educating people about all the possible use cases for the API and how to stitch all these things together to solve their problems. 'Cause I imagine a lot of this is new to people, and it doesn't quite click immediately that, "Oh, I could use the Manus API to solve my problems."

  414. 1:13:22

    Yeah, I think the easiest way to get started before you move to the API is actually the PlayFab web app, because the web app has everything nicely set up.

  415. 1:13:29

    You know, you don't need to do webhooks, you don't do integration. And so a lot of times what I recommend doing is saying, "Hey, I have a problem or something I'm repeatedly doing."

  416. 1:13:37

    Um, you look at the, basically the web app, you try a few times, Manus can get it done pretty well. And then you wanna start looking at the API, testing a bunch of these requests, seeing how, what you need to provide, what sort of context, and then getting that nailed down consistently.

  417. 1:13:50

    Um, I think the-- that's how I would approach it. Uh, so use a really simple way, a simple sandbox, and use that to basically get started. Yeah.

  418. 1:13:59

    Um, is there any other questions that I can help with?

  419. 1:14:02

    Yeah. Yeah, absolutely. No, you can go ahead.

  420. 1:14:06

    So, so no question on the API, but can you tell us very quickly how you created that site? What were the steps? The, the conference site, you redid that, right?

  421. 1:14:17

    I actually did.

  422. 1:14:18

    Uh, so if you can talk a little bit about that.

  423. 1:14:20

    Uh, sure. I can show the Manus chat, actually. I think that's more fun. Um...

  424. 1:14:29

    Can you see it?

  425. 1:14:37

    Screen. Yeah, just give it a while for the site to load, I think. Uh, so we can see, like, this is basically the full chat that's, uh, running. Uh, it'll take a while to load because there's quite a lot of conversations that need to be loaded up.

  426. 1:14:50

    But basically what I did is I just said like, "Hey, can you start with this? Can you scrape all the events?" There should be like seventy-plus talks, I think.

  427. 1:14:56

    The time is on, like, EST. Can you build a website that's, like, clean, brutalist design, search bar at the top? Uh, like, add to calendar. Let me star events and then make it work on mobile too.

  428. 1:15:06

    And actually I tried to use, like, a bunch-- [laughs]

  429. 1:15:09

    Manus has a lot of cute, like, emojis, but I tried to use a lot of these different, like, services, like Mixbred for a while, and then I looked at Chroma, and then it just gave you, like, API key.

  430. 1:15:18

    Um, but really what you can see over here is that this is a iterative process where you're using Manus as a way to basically, um, handle a lot of these complex edge cases that a simple, uh, agent might work out of the box for simple websites might not be able to do.

  431. 1:15:32

    Right? And so after I gave it, like, a full set of, uh, events, you can see, like, Manus just wrote a simple Python script. It converted all of the individual, uh, PM, AM stuff, whatnot, and it just converted it all to UTC, and then it just scraped everything in the end.

  432. 1:15:49

    And one of the things that was really cool that I saw was just that, um, if you look at the page, uh, it kind of tried to expand...

  433. 1:15:59

    Hmm. Scrolling, scrolling, reading far. Yeah, so basically it ran a lot of JavaScript. It tried to match, like, what it expanded. It read the HTML, and then from there it was able to actually get the right set of events.

  434. 1:16:11

    And so I think over here you can see a very specific use case I had in mind. I wanna make sense of events. Um, and I think the best way to work with a lot of these is just to have, just try, see what the Manus agent can do, and then thereafter, like, try to put it together.

  435. 1:16:26

    Yeah.

  436. 1:16:29

    Can I follow up?

  437. 1:16:30

    No, no. Go ahead. You can ask. Sure.

  438. 1:16:33

    Uh, so thanks, Ivan. Amazing demo, and thanks for such a tidy and clean notebook. Uh, I'm gonna go back and try it straight away in my own company 'cause, like, I've been meaning to do support agents, and this is an amazing demo.

  439. 1:16:44

    I just wanted to ask, uh, where does all this information-- 'cause it's all so sensitive. Where does it live? And can we, like, get it deleted later or anything like that?

  440. 1:16:53

    Sorry, what do you mean by where does it live?

  441. 1:16:54

    Oh, like right now, who's reading my transcripts?

  442. 1:16:57

    Oh. I think, like, when it comes to... If you say, like, who's reading your transcripts, you mean, like, all these chats?

  443. 1:17:02

    Yeah.

  444. 1:17:03

    Uh, so, like, user privacy is really important for us, and so for us, like, we can't read any of the chats. Yeah, the only chats we read are when you share about, like, "Hey, Manus isn't working," and, and we go in and check it out.

  445. 1:17:13

    Um, I think all of your data is housed in the US, and so there's no sort of, like, worry about that. Yeah.

  446. 1:17:19

    Thanks for the answer. Thanks.

  447. 1:17:23

    Can I start with that?

  448. 1:17:24

    Sure. [laughs]

  449. 1:17:27

    All right. So I know you built this really cool page. What would be really cool, like, if you could have those events, like, put it in directly into your calendar.

  450. 1:17:36

    So... And also my other question was like,

  451. 1:17:39

    like, what's the most interesting use case you have seen the Manus people using the Manus API or just the platform?

  452. 1:17:48

    API is pretty new, so I think we're sort of, like, exploring and seeing what people are using it for. A lot of people are using it for research, trying to, like, really access a lot of, like, to make sense of a lot of data, and I think, like, that is basically, like, leaning a lot of the advantages

  453. 1:18:01

    that Manus has. Um, in terms of the sort of, uh, advantages that Manus, I think, like, the cool things, um, I really like pickleball. I don't know if anyone here plays it, but it's, like, pretty popular.

  454. 1:18:11

    Um, but it's really competitive in Singapore to basically get, like, pickleball slots, and you can only book them through the government. Uh, it's a Singapore thing. And so what I got Manus to do is they wrote, like, a Python script that spun up, like, six Selenium instances and it scraped, like, the entire government website.

  455. 1:18:26

    And then it said, like, "In two weeks you can play pickleball at this location." And, and I thought that was pretty cool because I think that's one of the benefits you get by using a general agent with its own sandbox, with its own ability to basically spin up these, like, code to run it, to test it.

  456. 1:18:39

    Um, and if you use the API, that's what you get out of the box. Yeah.

  457. 1:18:43

    Is it possible to use the my browser through the API? And if so, how would it determine which browser to use?

  458. 1:18:51

    Yeah. I think, um, when it comes to my browser, I think, um, that will be, uh, something that we'll look into. So 'cause my browser requires you to not only choose the browser, but also approve it, 'cause you don't wanna randomly spin up tabs on your browser.

  459. 1:19:03

    Um, so we'll be working on basically improving the permission system, so you can do things like the pl- um, like by research, um, the browser and all these other bits of things that you need to authorize.

  460. 1:19:13

    Um, because user permissions is something that we wanna try to think carefully about, and so we wanna make sure we have it done well before we ship it out, but that's in the roadmap soon.

  461. 1:19:21

    Uh, we also have, um, in a f- maybe two weeks, um, you'll be able to, let's say Manus generates like a markdown or Manus generates like slides for you- Um, they will all be able to be converted, uh, to the same format as you see on the UI.

  462. 1:19:33

    So what this means is that, let's say, uh, you give Manus say, "Hey, I'm really interested... I would like to pitch my company. I would like to pitch something to someone."

  463. 1:19:40

    Right? It does all the research, puts the slides together, and using the same API, you can download a full PPTX file. You can export it however you want as a PDF.

  464. 1:19:49

    I think that's really useful, or even like Markdown to PDF. And so we have a lot of these same, uh, reque- um, features in mind to ensure feature parity, um, so that you get essentially the same experience on the API and the UI.

  465. 1:20:02

    Yeah.

  466. 1:20:03

    Uh, that was really, uh, informative. Thanks very much. So my question is about like, uh, say if I'm doing some research on some topics, I don't want always to like give it like the background, the context, um, in every conversation.

  467. 1:20:16

    Since it's linked to like, uh, you know, my account's API keys, um, my question was, um, if it's possible to, like, remember its, you know, mem- have like a memory or like for me to decide like in every conversation do I want to, you know, remember, um, you know, just draw memory from like my other conversations or,

  468. 1:20:37

    um, you know, like a temporary mode, stuff like that?

  469. 1:20:40

    Uh, yeah, I think, um, memory is something that's really interesting. Uh, it's something that we're actively looking at. Um, and so I think for now it's not possible, but maybe in the near future.

  470. 1:20:49

    So for now you have to be a bit more explicit when working with Manus, unfortunately. Yeah. Um, are there any que- other questions that I can help with?

  471. 1:20:58

    Uh, cool. If not, then, uh, I'll just be over here at the front. Uh, we also have another colleague from Manus, uh, Yesti over there, if you need like any help with AP- with the API or just asking questions on Manus in general.

  472. 1:21:08

    Uh, thank you so much for taking the time to listen to me today, and sorry about the technical difficulties. [upbeat music]