🔥Scrape an entire website in 3 lines of code
AI systems love neatly formatted data—Markdowns, Structured data, HTML, etc.
And now it is easier than ever to produce LLM-digestible data!
Firecrawl takes a website URL, crawls the entire website (including subpages), and converts it into a clean markdown or structured format in just 3 lines of code. Check the code above.
Thanks to Firecrawl for partnering today!
Build a Multi-agent Network with Agent2Agent Protocol
Agentic applications require both A2A and MCP.
MCP provides agents with access to tools.
A2A allows agents to connect with other agents and collaborate.
Check this visual to understand where A2A fits in the ecosystem:
Today, let us show you how to build an Agent network and communicate with Agents using the Agent2Agent Protocol.
We’ll build three Agents and serve them locally.
We’ll talk to them via the Agent2Agent protocol.
The code is linked later in the issue.
Let’s begin!
Serve an Agent
Here's how an Agent provider should serve/host their Agent.
Create an Agent class inherited from A2AServer.
Decorate the class with the agent decorator. Also specify the agent name, description, and version.
Each Agent has some skills that it can expose to other Agents. So the class must declare a method with the @skill
decorator.
For instance, a skill of our SineAgent is that it can compute the Sine of a number. This is implemented below:
In this method, you can add your Agent’s execution loop.
Moving on, an Agent can have multiple skills. Thus, a handle_task
method accepts the input task, uses the available skills, and returns the output.
In our case, we simply invoke the Sine skill method after parsing the input.
Finally, in the main body of the agent, we deploy the Agent:
We repeat the same process to build and deploy a Cosine Agent as well:
Finally, we repeat the same process to build and deploy a Tangent Agent:
Client-side Agent integration
Now that Agents have been hosted and deployed, a client can integrate them into their existing applications.
We also add a router to intelligently direct queries.
Query Agent network
With that, we can send a query to our network and see if it is routed to the appropriate Agent.
Below, we have a query to compute the Tangent, and our router directed it correctly to the Tangent Agent:
Below, we send another query and get the correct output again.
And that's how you can build and deploy your own Agent network and communicate with other Agents using the A2A protocol.
To recap:
MCP provides agents with access to tools.
While A2A allows agents to connect with other agents and collaborate.
We intentionally kept this simple for explainability. We’ll make this more practical in an upcoming issue. Stay tuned!
If you want to learn more about the basics of Agent2Agent Protocol, we covered it in this newsletter issue →
The code for today's issue is available in this repo →
Thanks for reading, and we’ll see you next week!
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) that align with such topics.
Here are some of them:
Learn how to build Agentic systems in an ongoing crash course with 13 parts.
Learn how to build real-world RAG apps and evaluate and scale them in this crash course.
Learn sophisticated graph architectures and how to train them on graph data.
So many real-world NLP systems rely on pairwise context scoring. Learn scalable approaches here.
Learn how to run large models on small devices using Quantization techniques.
Learn how to generate prediction intervals or sets with strong statistical guarantees for increasing trust using Conformal Predictions.
Learn how to identify causal relationships and answer business questions using causal inference in this crash course.
Learn how to scale and implement ML model training in this practical guide.
Learn techniques to reliably test new models in production.
Learn how to build privacy-first ML systems using Federated Learning.
Learn 6 techniques with implementation to compress ML models.
All these resources will help you cultivate key skills that businesses and companies care about the most.