Lately, we have done quite a few demos where we built multi-agent systems (we’ll link them towards the end of this issue).
Today, let’s do another demo, wherein we’ll build a multi-agent financial analyst using Microsoft’s Autogen and Llama3-70B:
Here’s our tech stack for this demo:
Microsoft’s Autogen, which is an open-source framework for building AI agent systems
Qualcomm’s Cloud AI 100 ultra for serving Llama 3-70B.
We’ll have two agents in this multi-agent app:
Code executor agent → Orchestrates code execution as follows:
Accepts user query
Collaborates with code writer agent (discussed below)
Executes the code locally
Collects final results
Code writer agent → Uses an LLM to generate code based on user instructions and collaborates with the code executor agent.
If you prefer to watch, we have added a video demo above.
It demonstrates what we’re building today and a quick walkthrough of Qualcomm’s playground to help you get started with everything.
Prerequisites
Get your API keys and free playground access to run Llama 3.1-8B, 70B here →
Next, install the following dependencies and add your API keys obtained from the playground to the .env
file.
Define code executor
The LocalCommandLineCodeExecutor
runs the AI-generated code and saves all files and results in the specified directory.
Define code executor agent
Code executor agent orchestrates code execution:
Accepts user query
Collaborates with code writer agent (implemented below)
Executes the code locally using the code executor defined above
Collects final results
Define code writer agent
It uses an LLM to generate code based on user instructions and collaborates with the code executor agent.
Almost done!
Start stock analysis
Finally, we provide a query and let the agents collaborate:
Display final results
Recall that we configured the LocalCommandLineCodeExecutor
above to save all files and results in the specified directory.
Let’s display the stock analysis chart:
Perfect!
It produces the desired result.
You can find all the code and instructions to run in this GitHub repo: AI Engineering Hub.
We launched this repo recently, wherein we’ll publish the code for such hands-on AI engineering newsletter issues.
This repository will be dedicated to:
In-depth tutorials on LLMs and RAGs.
Real-world AI agent applications.
Examples to implement, adapt, and scale in your projects.
Find it here: AI Engineering Hub (and do star it).
🙌 Also, a big thanks to Qualcomm for partnering with us and letting us use one of the fastest LLM inference engines they provide for today’s newsletter issue.
👉 Over to you: What other topics would you like to learn about?
P.S. For those wanting to develop “Industry ML” expertise:
At the end of the day, all businesses care about impact. That’s it!
Can you reduce costs?
Drive revenue?
Can you scale ML models?
Predict trends before they happen?
We have discussed several other topics (with implementations) in the past that align with such topics.
Here are some of them:
Learn sophisticated graph architectures and how to train them on graph data: A Crash Course on Graph Neural Networks – Part 1.
So many real-world NLP systems rely on pairwise context scoring. Learn scalable approaches here: Bi-encoders and Cross-encoders for Sentence Pair Similarity Scoring – Part 1.
Learn techniques to run large models on small devices: Quantization: Optimize ML Models to Run Them on Tiny Hardware.
Learn how to generate prediction intervals or sets with strong statistical guarantees for increasing trust: Conformal Predictions: Build Confidence in Your ML Model’s Predictions.
Learn how to identify causal relationships and answer business questions: A Crash Course on Causality – Part 1
Learn how to scale ML model training: A Practical Guide to Scaling ML Model Training.
Learn techniques to reliably roll out new models in production: 5 Must-Know Ways to Test ML Models in Production (Implementation Included)
Learn how to build privacy-first ML systems: Federated Learning: A Critical Step Towards Privacy-Preserving Machine Learning.
Learn how to compress ML models and reduce costs: Model Compression: A Critical Step Towards Efficient Machine Learning.
All these resources will help you cultivate key skills that businesses and companies care about the most.
SPONSOR US
Get your product in front of 115,000+ data scientists and machine learning professionals.
Our newsletter puts your products and services directly in front of an audience that matters — thousands of leaders, senior data scientists, machine learning engineers, data analysts, etc., who have influence over significant tech decisions and big purchases.
To ensure your product reaches this influential audience, reserve your space here or reply to this email to ensure your product reaches this influential audience.
Share this post