Type something to search...
Reading Document and Coding Functions with Multi-Agent AI Systems using Magentic-One

Reading Document and Coding Functions with Multi-Agent AI Systems using Magentic-One

Magentic-One is designed to streamline complex tasks by leveraging multiple AI agents, each with specialized capabilities. One of my previous post also introduce Magentic-One. Recently, I embarked on a journey to develop a mobile app (named “MotionLab”) capable of connecting with BLE sensors, such as motion sensors, or utilizing the device’s built-in motion sensors like accelerometers.

However, during the development process, I encountered a challenge: decoding data received from a BLE sensor subscribed to a characteristic with a specific UUID as shown in following screenshot. This is where Magentic-One, a multi-agent AI system, came to my rescue.

Setup env for Magentic-One. Model is ‘gpt-4o-2024–08–06’.

export CHAT_COMPLETION_PROVIDER='openai'

export OPENAI_API_KEY="your_api_key_here"

Then just use exampe.py to execute. This time, I’ve included a feature to save screenshots, allowing us to observe some of the behind-the-scenes processes. python3 examples/example.py —logs_dir ./my_logs —save_screenshot

python3 examples/example.py --logs_dir ./my_logs --save_screenshot

Here is one prompt that used, also tried with some othe prompts.

As a software developer for a mobile app connected to a BLE motion wearable sensor, 
you can access the BLE sensor, subscribe to a characteristic with 
UUID 0x0000FFE4-0000-1000-8000-00805F9A34FB, and receive a list of 
twenty integer values when the sensor is in motion, 
here is one exmaple [85, 97, 119, 2, 168, 254, 146, 254, 6, 2, 48, 254, 205, 255, 248, 240, 83, 252, 171, 196]. 
These values may represent acceleration (x, y, z) at some points 
by decoding packet header, flag. To understand and interpret these values 
correctly, you need to decode them based on the Bluetooth 5.0 communication 
protocol of the wearable sensor. 
The protocol documentation can be found at https://wit-motion.gitbook.io/witmotion-sdk/ble-5.0-protocol/bluetooth-5.0-communication-protocol . 
Can you assist in decoding these values and translating them into meaningful data for the app?

Then userProxy get user prompt input.

Orchestrator get info and will do a plan.

Orchestrator makes a plan decision.

Orchestrator process final plan.

The WebSurfer agent is tasked with accessing the provided website to retrieve document information. It captures screenshots and utilizes OCR methods, leveraging large multimodal models, to extract the necessary details.

Orchestrator does reflection based on response, then decide next plan to focus on whether retrieve specific data interpretation section relevant with BLE data.

Orchestrator makes plan that asks Coder to write python script to decode BLE data based on BLE communication protocal that retrieved from website.

Coder writes one python function.

Then we check my_logs for saved screenshots during this process.

Magentic-One is designed to streamline complex tasks by leveraging multiple AI agents, each with specialized capabilities. By providing it with a website containing BLE sensor documentation, Magentic-One autonomously navigated the site, captured screenshots, and employed OCR technology to extract the Bluetooth 5.0 communication protocol details. With this information, the system’s coder agent drafted a Python function tailored to decode the sensor data, utilizing sample data I included in the prompt. This experience underscores the transformative impact of AI technologies in modern app development, paving the way for more innovative and intelligent applications.

Prompt, Prompt, Prompt

Throughout my experimentation with various prompts to replicate these tasks, I**’ve observed that the prompt and system message are the most crucial factors influencing the agents’ workflow and the final outcome.** While I haven’t delved into comparing different Large Multimodal Models (LMMs), my primary focus has been on optimizing workflows and refining prompt engineering. By honing these aspects, we can significantly enhance the efficiency and effectiveness of agent-based workflows.

Happy Coding, Happy Reading. Happy Thanksgiving.

Related Posts

10 Creative Ways to Use ChatGPT Search The Web Feature

10 Creative Ways to Use ChatGPT Search The Web Feature

For example, prompts and outputs Did you know you can use the “search the web” feature of ChatGPT for many tasks other than your basic web search? For those who don't know, ChatGPT’s new

Read More
📚 10 Must-Learn Skills to Stay Ahead in AI and Tech 🚀

📚 10 Must-Learn Skills to Stay Ahead in AI and Tech 🚀

In an industry as dynamic as AI and tech, staying ahead means constantly upgrading your skills. Whether you’re aiming to dive deep into AI model performance, master data analysis, or transform trad

Read More
10 Powerful Perplexity AI Prompts to Automate Your Marketing Tasks

10 Powerful Perplexity AI Prompts to Automate Your Marketing Tasks

In today’s fast-paced digital world, marketers are always looking for smarter ways to streamline their efforts. Imagine having a personal assistant who can create audience profiles, suggest mar

Read More
10+ Top ChatGPT Prompts for UI/UX Designers

10+ Top ChatGPT Prompts for UI/UX Designers

AI technologies, such as machine learning, natural language processing, and data analytics, are redefining traditional design methodologies. From automating repetitive tasks to enabling personal

Read More
100 AI Tools to Finish Months of Work in Minutes

100 AI Tools to Finish Months of Work in Minutes

The rapid advancements in artificial intelligence (AI) have transformed how businesses operate, allowing people to complete tasks that once took weeks or months in mere minutes. From content creat

Read More
17 Mindblowing GitHub Repositories You Never Knew Existed

17 Mindblowing GitHub Repositories You Never Knew Existed

Github Hidden Gems!! Repositories To Bookmark Right Away Learning to code is relatively easy, but mastering the art of writing better code is much tougher. GitHub serves as a treasur

Read More