From 81525e417f1d59827ca18c30b2ac7f29ec76fd66 Mon Sep 17 00:00:00 2001 From: "manthapavankumar11@gmail.com" Date: Tue, 7 Oct 2025 21:33:13 +0530 Subject: [PATCH] changed readme --- README.md | 227 +++++++++++++++++++++++++++++++++++--------------- playground.py | 1 - 2 files changed, 162 insertions(+), 66 deletions(-) delete mode 100644 playground.py diff --git a/README.md b/README.md index e37f88e..655df0e 100644 --- a/README.md +++ b/README.md @@ -1,89 +1,182 @@ -# DevOps Agent +# DevOps Agent πŸ€– -An AI-powered CLI tool to assist with DevOps tasks, log analysis, and infrastructure code generation. +An intelligent AI-powered CLI assistant for DevOps engineers, providing expert guidance on Kubernetes, Terraform, and DevOps best practices. Built with multi-agent architecture and supporting multiple LLM providers. -## Features +## ✨ Features -- πŸ“Š **Log Analysis**: Analyze log files and get actionable insights -- πŸ’¬ **Query Interface**: Ask questions about DevOps best practices, Terraform, Kubernetes, etc. -- πŸ› οΈ **Template Generation**: Generate infrastructure code templates -- πŸ€– **AI-Powered**: Leverages Claude AI for intelligent responses +- **Multi-Agent Architecture**: Specialized agents for DevOps, Kubernetes, and Terraform domains +- **Multi-LLM Support**: Choose between OpenAI, Anthropic (Claude), or Google (Gemini) +- **Interactive Mode**: Conversational interface for continuous assistance +- **Log Analysis**: Automated analysis of log files with insights and error detection +- **GitOps & Cloud-Native**: Expert knowledge of modern DevOps practices +- **Memory System**: Uses Qdrant vector database for contextual memory across sessions +- **POML Prompts**: Structured prompts using POML (Prompt Markup Language) for consistent agent behavior -## Installation +## πŸš€ Quick Start + +### Installation ```bash # Clone the repository git clone https://github.com/yourusername/devops-agent.git cd devops-agent -# Install in development mode +# Install dependencies pip install -e . - -# Or install from PyPI (when published) -pip install devops-agent ``` -## Configuration +### Configuration -Create a `.env` file in the project root: +Create a `.env` file in the project root with your API keys: ```env -ANTHROPIC_API_KEY=your_api_key_here +# Choose one or more providers +ANTHROPIC_API_KEY=your_anthropic_key_here +OPENAI_API_KEY=your_openai_key_here +GEMINI_API_KEY=your_gemini_key_here + +# Qdrant configuration (for memory) +QDRANT_URL=your_qdrant_url +QDRANT_API_KEY=your_qdrant_key ``` -## Usage +## πŸ“– Usage Examples -### Analyze Log Files +### 1. Interactive Mode with Anthropic (Recommended) ```bash -devops-agent run --log-file /path/to/app.log +devops-agent run --provider anthropic --interactive ``` -### Ask Questions +Start a conversation with the DevOps team. Ask multiple questions in sequence, and the agents will remember context across the session. + +### 2. Single Query with OpenAI ```bash -devops-agent run --query "I need terraform script to spin up Azure blob storage" -devops-agent run --query "How to increase my pod memory and CPU in k8s" +devops-agent run --provider openai --query "How do I set up a multi-region Kubernetes cluster on AWS EKS with GitOps?" ``` -### Generate Templates +Get immediate answers to specific DevOps questions without entering interactive mode. + +### 3. Terraform Infrastructure Code Generation ```bash -devops-agent template terraform -devops-agent template kubernetes -devops-agent template docker +devops-agent run --provider anthropic --query "Create a Terraform module for Azure AKS cluster with monitoring and auto-scaling" --output terraform-aks.tf --format text ``` -### Configuration +Generate infrastructure code and save it directly to a file. + +### 4. Kubernetes Troubleshooting + +```bash +devops-agent run --provider google --query "My pods are in CrashLoopBackOff state. How do I debug this issue systematically?" +``` + +Get step-by-step troubleshooting guidance for Kubernetes issues. + +### 5. Log File Analysis ```bash -devops-agent config +devops-agent run --provider anthropic --log-file ./logs/application.log ``` -## Examples +Analyze log files for critical errors, patterns, anomalies, and significant findings with AI-powered insights. + +### 6. Save Conversation to File ```bash -# Analyze application logs -devops-agent run --log-file ./logs/app.log --format json +devops-agent run --provider openai --query "Best practices for implementing GitOps with ArgoCD" --output gitops-guide.md --format markdown +``` -# Get Terraform help -devops-agent run --query "terraform script for AWS S3 bucket with versioning" +Export responses in text, JSON, or Markdown format for documentation. -# Kubernetes troubleshooting -devops-agent run --query "pod is in CrashLoopBackOff status, how to debug?" +## πŸ—οΈ Project Structure -# Save output to file -devops-agent run --query "docker-compose for nginx and postgres" --output docker-compose.yml ``` +devops-agent/ +β”œβ”€β”€ devops_agent/ +β”‚ β”œβ”€β”€ cli.py # Main CLI interface with Click +β”‚ β”œβ”€β”€ core/ # Core agent implementations +β”‚ β”‚ β”œβ”€β”€ master_agent.py # Orchestrator agent routing queries +β”‚ β”‚ β”œβ”€β”€ devops_agent.py # DevOps troubleshooting specialist +β”‚ β”‚ β”œβ”€β”€ kubernetes_agent.py # Kubernetes architecture expert +β”‚ β”‚ β”œβ”€β”€ terraform_agent.py # Terraform/IaC specialist +β”‚ β”‚ └── log_analysis_agent.py # Log file analysis agent +β”‚ β”œβ”€β”€ prompts/ # POML-based structured prompts +β”‚ β”‚ β”œβ”€β”€ devops.poml # DevOps troubleshooting instructions +β”‚ β”‚ β”œβ”€β”€ kubernetes.poml # Kubernetes architecture guidelines +β”‚ β”‚ └── terraform.poml # Terraform best practices +β”‚ └── utils/ # Utility functions +β”‚ └── prompt_generator_from_poml.py # POML to prompt converter +β”œβ”€β”€ setup.py # Package setup configuration +β”œβ”€β”€ pyproject.toml # Modern Python project config +β”œβ”€β”€ requirements.txt # Project dependencies +β”œβ”€β”€ .env # Environment variables (create this) +└── README.md # This file +``` + +### Key Components + +- **`cli.py`**: Command-line interface handling user input, interactive mode, and output formatting +- **`master_agent.py`**: Routes queries to specialized agents based on domain (DevOps, K8s, Terraform) +- **`devops_agent.py`**: Handles incident response, observability, and general DevOps troubleshooting +- **`kubernetes_agent.py`**: Kubernetes architecture, GitOps workflows, and cloud-native practices +- **`terraform_agent.py`**: Infrastructure as Code, state management, and multi-cloud deployments +- **`log_analysis_agent.py`**: Analyzes log files for errors, patterns, and anomalies +- **`.poml` files**: Structured prompt definitions using POML markup language -## Development +## πŸ› οΈ CLI Commands + +### Run Command ```bash -# Install development dependencies -pip install -e ".[dev]" +devops-agent run [OPTIONS] + +Options: + --provider TEXT LLM provider: openai, anthropic, or google + --query TEXT Single query to process + --log-file PATH Path to log file for analysis + --output PATH Save response to file + --format [text|json|markdown] Output format (default: text) + -i, --interactive Run in interactive conversation mode + --help Show help message +``` + +### Version + +```bash +devops-agent --version +``` + +## 🧠 How It Works + +1. **Query Routing**: Master agent analyzes your question and routes it to the appropriate specialist agent +2. **Domain Expertise**: Each agent uses specialized POML-defined knowledge for accurate responses +3. **Memory System**: Qdrant vector database stores conversation history for contextual awareness +4. **Multi-LLM**: Choose the best model for your needs - Claude Sonnet 4.5, GPT-5-mini, or Gemini 2.5 +5. **Streaming Responses**: See agent reasoning and responses in real-time + +## πŸ“‹ Requirements + +- Python >= 3.8 +- API key for at least one LLM provider (OpenAI, Anthropic, or Google) +- Optional: Qdrant instance for persistent memory (can use in-memory fallback) + +## 🀝 Contributing -# Run tests -pytest +We welcome contributions! Here's how you can help: + +1. **Fork the repository** +2. **Create a feature branch**: `git checkout -b feature/amazing-feature` +3. **Make your changes** and commit: `git commit -m 'Add amazing feature'` +4. **Push to the branch**: `git push origin feature/amazing-feature` +5. **Open a Pull Request** + +### Development Setup + +```bash +# Install with development dependencies +pip install -e ".[dev]" # Format code black devops_agent/ @@ -93,36 +186,40 @@ isort devops_agent/ flake8 devops_agent/ ``` -## Project Structure +### Contribution Guidelines -``` -devops-agent/ -β”œβ”€β”€ devops_agent/ # Main package -β”‚ β”œβ”€β”€ cli.py # CLI interface -β”‚ β”œβ”€β”€ core/ # Core functionality -β”‚ β”œβ”€β”€ templates/ # Template generators -β”‚ β”œβ”€β”€ utils/ # Utilities -β”‚ └── prompts/ # LLM prompts -└── docs/ # Documentation -``` +- Follow PEP 8 style guidelines +- Add tests for new features +- Update documentation as needed +- Keep commits atomic and well-described +- Ensure all tests pass before submitting PR + +## πŸ“ License + +This project is licensed under the **Apache License 2.0** - see the [LICENSE](LICENSE) file for details. -## Contributing +## πŸ™ Acknowledgments -Contributions are welcome! Please feel free to submit a Pull Request. +- Built with [Agno](https://github.com/agno-oss/agno) framework for multi-agent orchestration +- Uses [POML](https://github.com/poml-lang/poml) for structured prompt engineering +- Powered by Claude (Anthropic), GPT (OpenAI), and Gemini (Google) -## License +## πŸ“¬ Support -Apache2.0 License - see LICENSE file for details +- **Issues**: Report bugs or request features via [GitHub Issues](https://github.com/yourusername/devops-agent/issues) +- **Discussions**: Join conversations in [GitHub Discussions](https://github.com/yourusername/devops-agent/discussions) +- **Email**: manthapavankumar11@gmail.com -## Roadmap +## πŸ—ΊοΈ Roadmap -- [ ] Implement log analysis with pattern detection -- [ ] Add support for multiple LLM providers -- [ ] Create template library for common infrastructure patterns -- [ ] Add interactive mode -- [ ] Support for custom plugins -- [ ] Integration with CI/CD pipelines +- [ ] Add CI/CD pipeline integration +- [ ] Support for custom agent creation +- [ ] Web UI interface +- [ ] Docker and Helm chart templates generation +- [ ] Integration with monitoring tools (Prometheus, Grafana) +- [ ] Multi-language support for responses +- [ ] Plugin system for extensibility -## Support +--- -For issues and questions, please open an issue on GitHub. \ No newline at end of file +Made with ❀️ by M K Pavan Kumar \ No newline at end of file diff --git a/playground.py b/playground.py deleted file mode 100644 index d9a8857..0000000 --- a/playground.py +++ /dev/null @@ -1 +0,0 @@ -print('playground!') \ No newline at end of file