This project demonstrates a multi-agent system using Autogen that assists with Kubernetes configuration tasks by combining popular frameworks such as Autogen, langchain and shortly to be added too MCP.
The agents collaborate to research, modify, and apply YAML configurations.
The system comprises four specialized agents:
- PlanningAgent: Decomposes complex tasks into smaller subtasks and delegates them to other agents.
- WebSearchAgent: Gathers information from the web using DuckDuckGo search.
- FixerAgent: Creates, modifies, or corrects YAML files based on gathered information and best practices.
- RunnerAgent: Executes commands on the terminal, such as applying YAML configurations using
kubectl.
-
Clone the repository:
git clone https://github.com/rinormaloku/autogen-langchain-mcp-mix.git cd autogen-langchain-mcp-mix -
Install dependencies in a
venv:python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt
-
Set up environment variables:
Copy the values from
.env.exampleto a new file named.env:cp .env.example .envUpdate the environment variables in the
.envfile as needed.
Setup a k8s environment and run the main script:
kind create cluster
istioctl install -y
python main.pyThis will start the multi-agent system and initiate a conversation based on the predefined user_question in main.py. The agents will collaborate to address the issue related to the Istio VirtualService configuration.
- This project is a demonstration and may require adjustments for real-world applications.
- The
RunnerAgent's ability to execute commands depends on the environment and permissions. - The termination condition is based on a maximum message count (30) or the mention of the word "TERMINATE".
- Ensure that you have
kubectlconfigured correctly if you intend to apply the generated YAML configurations.