Multi-Agent Systems
Learn how to build a production-grade multi-agent system built with LangGraph and LangChain, featuring a web search agent and a Celo blockchain agent powered by Googleβs Gemini.Features
- π€ Supervisor agent that orchestrates specialized agents
- π Web search agent for retrieving real-time information
- βοΈ Blockchain agent for fetching Celo blockchain data
- π Memory management for conversation history
- π€ Gemini AI for intelligent agent capabilities
- π§΅ Thread support for maintaining conversation state
What are Multi-Agent Systems?
Sure! Hereβs a simplified and accessible concept module-style intro to multiagent systems, tailored to fit the Celo Docs style:What Are Multiagent Systems?
Multiagent systems (MAS) are groups of independent software agents that work together to solve complex problems. Instead of relying on one big, centralized program, MAS use many smaller agentsβeach with their own goals and responsibilities. These agents can collaborate, compete, or coordinate to get things done more efficiently. In Web3, this is especially powerful. Agents can perform tasks like:- Optimizing DeFi yields
- Voting in governance protocols
- Bridging assets across blockchains
- Managing liquidity in real-time
Architecture
The system uses a hierarchical multi-agent architecture with a supervisor agent orchestrating specialized agents.
Setup
- Clone the repository
- Install dependencies:
- Set up environment variables:
.env
file in the project root (the application uses python-dotenv to load variables automatically).
Usage
Run the main application:Project Structure
How It Works
- The Supervisor Agent analyzes user queries and determines which specialized agent to use
- For blockchain-related queries, the Blockchain Agent fetches real-time data from the Celo blockchain
- For information retrieval, the Search Agent uses Tavily to search the web for relevant information
- All conversation state is maintained using thread IDs for coherent multi-turn interactions
- The system uses Googleβs Gemini models for intelligent natural language understanding and generation