### Install BMasterAI Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/getting-started.md Installs the BMasterAI library using pip. This is the basic installation for getting started. ```bash pip install bmasterai ``` -------------------------------- ### Install BMasterAI with All Features Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/getting-started.md Installs BMasterAI along with all optional dependencies, enabling the full suite of features. ```bash pip install bmasterai[all] ``` -------------------------------- ### Install BMasterAI for Development Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/getting-started.md Clones the BMasterAI repository and installs it in editable mode with development dependencies. Useful for contributing to the project. ```bash git clone https://github.com/travis-burmaster/bmasterai.git cd bmasterai pip install -e .[dev] ``` -------------------------------- ### Install RAG Dependencies and Set Up Environment Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/getting-started.md Installs necessary dependencies for Retrieval-Augmented Generation (RAG) using Qdrant and sets up required environment variables for API keys and connection details. ```bash pip install -r examples/minimal-rag/requirements_qdrant.txt export QDRANT_URL="https://your-cluster.qdrant.io" export QDRANT_API_KEY="your-qdrant-api-key" export OPENAI_API_KEY="your-openai-api-key" ``` -------------------------------- ### Install Gradio and Anthropic for Web Interface Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/getting-started.md Installs the Gradio library for building web interfaces and the Anthropic library for accessing Claude models. This is required for the web interface example. ```bash pip install gradio anthropic ``` -------------------------------- ### Create and Run a Basic BMasterAI Agent Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/getting-started.md Demonstrates how to create a simple AI agent using BMasterAI's logging and monitoring utilities. It includes initializing the agent, executing tasks, and tracking performance. The example shows how to configure logging, start monitoring, log events like agent start and task completion/errors, and track task durations. ```python from bmasterai.logging import configure_logging, get_logger, LogLevel, EventType from bmasterai.monitoring import get_monitor import time # Configure logging configure_logging(log_level=LogLevel.INFO) # Start monitoring monitor = get_monitor() monitor.start_monitoring() class MyFirstAgent: def __init__(self, agent_id: str, name: str): self.agent_id = agent_id self.name = name self.logger = get_logger() self.monitor = monitor # Log agent creation self.logger.log_event( self.agent_id, EventType.AGENT_START, f"Agent {self.name} initialized", metadata={"name": self.name} ) def execute_task(self, task_name: str, task_data: dict = None): start_time = time.time() try: # Log task start self.logger.log_event( self.agent_id, EventType.TASK_START, f"Starting task: {task_name}", metadata={"task_data": task_data or {}} ) # Simulate task execution time.sleep(1) # Your actual task logic here result = {"status": "completed", "task": task_name} # Calculate duration and track performance duration_ms = (time.time() - start_time) * 1000 self.monitor.track_task_duration(self.agent_id, task_name, duration_ms) # Log task completion self.logger.log_event( self.agent_id, EventType.TASK_COMPLETE, f"Completed task: {task_name}", duration_ms=duration_ms, metadata={"result": result} ) return result except Exception as e: # Log error self.logger.log_event( self.agent_id, EventType.TASK_ERROR, f"Task failed: {task_name} - {str(e)}", level=LogLevel.ERROR ) self.monitor.track_error(self.agent_id, "task_execution") return {"status": "failed", "error": str(e)} # Create and run your agent if __name__ == "__main__": agent = MyFirstAgent("my-agent-001", "MyFirstAgent") # Execute some tasks result1 = agent.execute_task("data_processing", {"input": "sample_data"}) result2 = agent.execute_task("analysis", {"type": "basic"}) print(f"Task 1 result: {result1}") print(f"Task 2 result: {result2}") # Get performance dashboard dashboard = monitor.get_agent_dashboard("my-agent-001") print(f"Agent performance: {dashboard}") ``` -------------------------------- ### Run Python Agent Script Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/getting-started.md Executes the Python script containing the BMasterAI agent example. This command starts the agent and its tasks. ```bash python my_first_agent.py ``` -------------------------------- ### Run All Examples Source: https://github.com/travis-burmaster/bmasterai/blob/main/INSTALL.md Navigates to the examples directory and executes a script to run all provided examples. ```bash cd examples python run_examples.py ``` -------------------------------- ### BMasterAI CLI: Start Monitoring Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/getting-started.md Starts the BMasterAI monitoring service. This command enables the collection and display of performance metrics and logs. ```bash bmasterai monitor ``` -------------------------------- ### Test RAG Connection and Launch Interface Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/getting-started.md Tests the connection to the Qdrant vector database and launches a Gradio-based web interface for interacting with the RAG system. This allows users to test the setup and use the RAG functionality interactively. ```bash python examples/minimal-rag/test_qdrant_connection.py python examples/minimal-rag/gradio_qdrant_rag.py ``` -------------------------------- ### Local Development Setup Source: https://github.com/travis-burmaster/bmasterai/blob/main/examples/gradio-anthropic/README.md Steps to set up the Gradio Anthropic example locally. This involves navigating to the example directory, installing Python dependencies, configuring environment variables, and running the application. ```bash cd examples/gradio-anthropic pip install -r requirements.txt cp .env.example .env # Edit .env and add your ANTHROPIC_API_KEY python gradio-app-bmasterai.py ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/travis-burmaster/bmasterai/blob/main/examples/rag-qdrant/README.md Clones the BMasterAI repository from GitHub and changes the directory to the RAG example setup. This is the initial step to get the project code. ```bash git clone https://github.com/travis-burmaster/bmasterai.git cd bmasterai/examples/rag-qdrant ``` -------------------------------- ### Development Workflow Example Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/cli/overview.md A practical example demonstrating a typical development workflow using the BMasterAI CLI, starting with project initialization and then launching the monitoring service in the background. ```bash # 1. Create new project bmasterai init my-ai-app cd my-ai-app # 2. Start monitoring in background bmasterai monitor & ``` -------------------------------- ### Install BMasterAI Qdrant RAG Dependencies Source: https://github.com/travis-burmaster/bmasterai/blob/main/examples/minimal-rag/README_qdrant_cloud.md Installs necessary Python packages for the BMasterAI Qdrant Cloud RAG example using pip. This includes the BMasterAI framework, Qdrant client, OpenAI library, and sentence transformers. ```bash pip install -r requirements_qdrant.txt # Or install individually pip install bmasterai qdrant-client openai sentence-transformers numpy ``` -------------------------------- ### Run Individual Examples Source: https://github.com/travis-burmaster/bmasterai/blob/main/INSTALL.md Executes specific example functionalities using Python's -c flag. Demonstrates stateful agents, multi-agent coordination, and advanced monitoring. ```python python -c "from examples.enhanced_examples import example_stateful_agent_with_logging; example_stateful_agent_with_logging()" ``` ```python python -c "from examples.enhanced_examples import example_multi_agent_coordination_with_logging; example_multi_agent_coordination_with_logging()" ``` ```python python -c "from examples.enhanced_examples import example_advanced_monitoring_and_alerts; example_advanced_monitoring_and_alerts()" ``` -------------------------------- ### BMasterAI CLI: Initialize Project Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/getting-started.md Initializes a new BMasterAI project with a specified name. This command sets up the basic directory structure and configuration files for a new AI project. ```bash bmasterai init my-ai-project cd my-ai-project ``` -------------------------------- ### Run BMasterAI Qdrant RAG Example Source: https://github.com/travis-burmaster/bmasterai/blob/main/examples/minimal-rag/README_qdrant_cloud.md Executes the main Python script to start the BMasterAI Qdrant Cloud RAG system, initiating document processing, vector storage, and query handling. ```bash python bmasterai_rag_qdrant_cloud.py ``` -------------------------------- ### Kubernetes Backup: Velero Setup and Backup Creation Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Illustrates how to set up and use Velero for Kubernetes backups. It includes applying the Velero installation manifest and creating manual backups for specific namespaces. ```APIDOC Kubernetes Backup with Velero: Install Velero (example for v1.12.0): kubectl apply -f https://github.com/vmware-tanzu/velero/releases/latest/download/velero-v1.12.0-linux-amd64.tar.gz - Downloads and applies the Velero installation manifest to set up the backup tool. Create a backup: velero backup create bmasterai-backup --include-namespaces bmasterai - Initiates a backup of all resources within the 'bmasterai' namespace, naming it 'bmasterai-backup'. Schedule regular backups: velero schedule create bmasterai-daily --schedule="0 2 * * *" --include-namespaces bmasterai - Configures a daily backup job (at 2 AM UTC) for the 'bmasterai' namespace. ``` -------------------------------- ### Install ArgoCD for GitOps Automation Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Installs ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. This involves creating the ArgoCD namespace and applying the official installation manifest. ```bash kubectl create namespace argocd kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml ``` -------------------------------- ### Basic Python Installation Source: https://github.com/travis-burmaster/bmasterai/blob/main/README.md Installs the core BMasterAI framework using pip. This is the recommended starting point for most users. ```bash pip install bmasterai ``` -------------------------------- ### Install AWS CLI and eksctl Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Installs the necessary command-line tools for interacting with Amazon EKS, including the AWS CLI and eksctl. ```bash aws --version eksctl version ``` -------------------------------- ### Install and View kube-bench Results Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Installs the kube-bench tool to run CIS Kubernetes Benchmarks and then retrieves the job logs to view the results. Ensure you have kubectl configured to connect to your cluster. ```bash # Install kube-bench kubectl apply -f https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job.yaml # View results kubectl logs job/kube-bench ``` -------------------------------- ### Install Kubecost for Cost Monitoring Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Installs Kubecost, a tool for monitoring and optimizing Kubernetes costs, using Helm. This command adds the Kubecost Helm repository and installs the chart into a dedicated namespace. ```bash helm repo add kubecost https://kubecost.github.io/cost-analyzer/ helm install kubecost kubecost/cost-analyzer \ --namespace kubecost \ --create-namespace ``` -------------------------------- ### Basic Agent Setup and Execution Source: https://github.com/travis-burmaster/bmasterai/blob/main/README.md Demonstrates how to configure logging, monitoring, integrations, and run a basic agent with a task execution example. ```python from bmasterai.logging import configure_logging, LogLevel from bmasterai.monitoring import get_monitor from bmasterai.integrations import get_integration_manager, SlackConnector # Configure logging and monitoring logger = configure_logging(log_level=LogLevel.INFO) monitor = get_monitor() monitor.start_monitoring() # Setup integrations integration_manager = get_integration_manager() slack = SlackConnector(webhook_url="YOUR_SLACK_WEBHOOK") integration_manager.add_connector("slack", slack) # Create and run an agent from bmasterai.examples import EnhancedAgent agent = EnhancedAgent("agent-001", "DataProcessor") agent.start() # Execute tasks with full monitoring result = agent.execute_task("data_analysis", {"dataset": "sales.csv"}) print(f"Task result: {result}") # Get performance dashboard dashboard = monitor.get_agent_dashboard("agent-001") print(f"Agent performance: {dashboard}") agent.stop() ``` -------------------------------- ### Run Test Suite Source: https://github.com/travis-burmaster/bmasterai/blob/main/examples/minimal-rag/README_qdrant_cloud.md Provides the bash commands necessary to install testing dependencies and execute the test suite for the RAG system. This ensures code quality and functionality. ```bash # Install test dependencies pip install pytest pytest-asyncio # Run tests pytest test_qdrant_rag.py -v ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/examples/rag-tutorials.md Installs the necessary Python libraries for building RAG systems, including BMasterAI, Qdrant client, OpenAI, and sentence transformers. ```bash pip install bmasterai qdrant-client openai sentence-transformers numpy ``` -------------------------------- ### Configuration Setup Source: https://github.com/travis-burmaster/bmasterai/blob/main/INSTALL.md Copies the default configuration file and sets environment variables for sensitive data like API keys or webhook URLs. ```bash cp config/config.yaml ./config.yaml ``` ```bash export SLACK_WEBHOOK_URL="your-slack-webhook" export EMAIL_USERNAME="your-email@domain.com" export EMAIL_PASSWORD="your-app-password" ``` -------------------------------- ### Install and Access BMasterAI CLI Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/cli/overview.md Demonstrates how to install the BMasterAI CLI using pip and how to access its help information to verify the installation. ```bash pip install bmasterai bmasterai --help ``` -------------------------------- ### Install Trivy Operator and Scan Image Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Installs the Trivy Kubernetes operator and then scans a Docker image named 'bmasterai:latest' for vulnerabilities. Requires kubectl and Trivy operator installation. ```bash # Install Trivy operator kubectl apply -f https://raw.githubusercontent.com/aquasecurity/trivy-operator/main/deploy/static/trivy-operator.yaml # Scan BMasterAI image trivy image bmasterai:latest ``` -------------------------------- ### Install Azure CLI Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Installs the Azure Command-Line Interface, used for managing Azure resources, including AKS clusters. ```bash az version ``` -------------------------------- ### Install Fluent Bit with Elasticsearch Output Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Installs Fluent Bit using Helm, configuring it to send logs to an Elasticsearch cluster. Requires Helm and a running Elasticsearch instance. ```bash helm repo add fluent https://fluent.github.io/helm-charts helm install fluent-bit fluent/fluent-bit \ --namespace logging \ --set config.outputs='[OUTPUT]\n Name es\n Match *\n Host elasticsearch-master\n Port 9200' ``` -------------------------------- ### Run Simple RAG System Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/examples/rag-tutorials.md Command to execute the Python script for the RAG system demo. This initiates the system, indexes documents, and processes example queries. ```Bash python basic_rag.py ``` -------------------------------- ### Set Anthropic API Key and Launch Chat Interface Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/getting-started.md Sets the Anthropic API key as an environment variable and launches a Gradio chat interface that integrates with BMasterAI and Anthropic Claude. This enables conversational AI interactions. ```bash export ANTHROPIC_API_KEY="your-anthropic-api-key" python examples/gradio-anthropic/gradio-app-bmasterai.py ``` -------------------------------- ### Kubernetes Quick Start Scripts Source: https://github.com/travis-burmaster/bmasterai/blob/main/README.md Utilizes provided shell scripts for a quick setup and deployment of BMasterAI on Kubernetes, specifically targeting AWS EKS. ```bash git clone https://github.com/travis-burmaster/bmasterai.git cd bmasterai ./eks/setup-scripts/01-create-cluster.sh ./eks/setup-scripts/02-deploy-bmasterai.sh ``` -------------------------------- ### Install Jaeger for Distributed Tracing Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Installs the Jaeger tracing system using its official Helm chart. This enables distributed tracing capabilities for services within the cluster. ```bash helm repo add jaegertracing https://jaegertracing.github.io/helm-charts helm install jaeger jaegertracing/jaeger -n tracing --create-namespace ``` -------------------------------- ### BMasterAI CLI: Check System Status Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/getting-started.md Checks the current status of the BMasterAI system and its components. This command is useful for verifying that the environment is set up correctly. ```bash bmasterai status ``` -------------------------------- ### BMasterAI CLI Commands Source: https://github.com/travis-burmaster/bmasterai/blob/main/INSTALL.md Essential commands for managing and interacting with the BMasterAI system. These include starting monitoring services and running integration tests. ```APIDOC BMasterAI CLI: monitor Starts the BMasterAI monitoring mode. test-integrations Executes integration tests for the BMasterAI system. ``` -------------------------------- ### Initialize New Project Source: https://github.com/travis-burmaster/bmasterai/blob/main/INSTALL.md Creates a new BMasterAI project directory with a standard file structure, including agent, config, and logs directories. ```bash bmasterai init my-ai-project cd my-ai-project ``` -------------------------------- ### Install Gradio for Web Interface Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/examples/rag-tutorials.md Command to install the Gradio library, typically used for creating web interfaces for machine learning models. This is a prerequisite for building a web UI for the RAG system. ```Bash pip install gradio ``` -------------------------------- ### Quick Installation Source: https://github.com/travis-burmaster/bmasterai/blob/main/INSTALL.md Installs the BMasterAI package in editable mode. This is the standard installation for using the framework. ```bash cd bmasterai pip install -e . ``` -------------------------------- ### Bash Development Setup and Dependencies Source: https://github.com/travis-burmaster/bmasterai/blob/main/README.md Provides essential bash commands for setting up the development environment. This includes cloning the repository, installing project dependencies with development extras, and configuring pre-commit hooks for code quality. ```Bash git clone https://github.com/travis-burmaster/bmasterai.git cd bmasterai pip install -e .[dev] pre-commit install ``` -------------------------------- ### Install and Initialize BMasterAI Locally Source: https://github.com/travis-burmaster/bmasterai/blob/main/README.md Installs the BMasterAI package using pip and initializes a new project. This is the recommended approach for local development and testing. ```bash pip install bmasterai bmasterai init my-project ``` -------------------------------- ### Install gcloud SDK Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Installs the Google Cloud SDK, which is required for managing Google Cloud resources, including GKE clusters. ```bash gcloud version ``` -------------------------------- ### Install Vault Helm Chart Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Installs HashiCorp Vault using its official Helm chart. Vault is a tool for securely accessing secrets, encrypting data, and managing identities. ```bash helm repo add hashicorp https://helm.releases.hashicorp.com helm install vault hashicorp/vault -n vault --create-namespace ``` -------------------------------- ### Execute Advanced RAG Script Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/examples/rag-tutorials.md This command executes the `advanced_rag.py` Python script, which is assumed to perform more complex RAG operations or setup. It requires Python to be installed and the script to be present in the current directory. ```bash python advanced_rag.py ``` -------------------------------- ### Install Prometheus Stack with Helm Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Deploys the kube-prometheus-stack Helm chart, which includes Prometheus, Alertmanager, and Grafana. This provides a comprehensive monitoring solution for Kubernetes. ```bash helm repo add prometheus-community https://prometheus-community.github.io/helm-charts helm install prometheus prometheus-community/kube-prometheus-stack \ --namespace monitoring \ --create-namespace \ --set grafana.adminPassword=admin123 ``` -------------------------------- ### Deploy BMasterAI with Custom Helm Values Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Installs the BMasterAI Helm chart using a custom values file for production configurations. ```bash # Add custom values cat > values-production.yaml << EOF replicaCount: 3 image: repository: bmasterai tag: "latest" resources: limits: cpu: 1000m memory: 1Gi requests: cpu: 500m memory: 512Mi autoscaling: enabled: true minReplicas: 2 maxReplicas: 10 persistence: enabled: true size: 10Gi secrets: openaiApiKey: "eW91ci1hcGkta2V5" # base64 encoded anthropicApiKey: "eW91ci1hbnRocm9waWMta2V5" EOF # Deploy with custom values helm install bmasterai ./helm/bmasterai \ --namespace bmasterai \ --values values-production.yaml ``` -------------------------------- ### Setup Local Qdrant with Docker Source: https://github.com/travis-burmaster/bmasterai/blob/main/examples/rag-qdrant/README.md Starts a local Qdrant vector database instance using Docker. This command maps the default Qdrant port (6333) to the host machine, making it accessible for the RAG system. ```bash docker run -p 6333:6333 qdrant/qdrant ``` -------------------------------- ### Install AWS Load Balancer Controller on EKS Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Installs the AWS Load Balancer Controller using Helm to manage AWS Application Load Balancers (ALBs) and Network Load Balancers (NLBs) for Kubernetes services. ```bash helm repo add eks https://aws.github.io/eks-charts helm install aws-load-balancer-controller eks/aws-load-balancer-controller \ -n kube-system \ --set clusterName=bmasterai-cluster ``` -------------------------------- ### Deploy BMasterAI using Helm Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Deploys the BMasterAI application using a Helm chart, creating a namespace and setting the OpenAI API key. ```bash # Create namespace kubectl create namespace bmasterai # Install BMasterAI helm install bmasterai ./helm/bmasterai \ --namespace bmasterai \ --set secrets.openaiApiKey=$(echo -n "your-api-key" | base64) ``` -------------------------------- ### Development Installation Source: https://github.com/travis-burmaster/bmasterai/blob/main/README.md Installs BMasterAI in editable mode with development dependencies, suitable for contributing to the framework. ```bash git clone https://github.com/travis-burmaster/bmasterai.git cd bmasterai pip install -e .[dev] ``` -------------------------------- ### Clone BMasterAI Repository Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Clones the BMasterAI project repository from GitHub and navigates into the project directory. ```bash git clone https://github.com/travis-burmaster/bmasterai.git cd bmasterai ``` -------------------------------- ### Verify Installation Source: https://github.com/travis-burmaster/bmasterai/blob/main/INSTALL.md Checks if the BMasterAI installation was successful by running a status command. ```bash bmasterai status ``` -------------------------------- ### Running Tests Source: https://github.com/travis-burmaster/bmasterai/blob/main/INSTALL.md Commands for installing test dependencies and running the test suite using pytest, with options for coverage and specific files. ```bash pip install -e .[dev] pytest pytest --cov=bmasterai pytest tests/test_enhanced_functionality.py -v ``` -------------------------------- ### Start the BMasterAI RAG Application Source: https://github.com/travis-burmaster/bmasterai/blob/main/examples/rag-qdrant/README.md Executes the main Python script to launch the BMasterAI RAG system with a Gradio interface. This command starts the server, making the application accessible via a web browser. ```python python bmasterai-gradio-rag.py ``` -------------------------------- ### Development Installation Source: https://github.com/travis-burmaster/bmasterai/blob/main/INSTALL.md Installs the BMasterAI package with development and integration dependencies. Recommended for contributing to the project or using all features. ```bash pip install -e .[dev,integrations] ``` -------------------------------- ### Full Integration Python Installation Source: https://github.com/travis-burmaster/bmasterai/blob/main/README.md Installs BMasterAI along with all optional integrations and dependencies, enabling the full suite of features. ```bash pip install bmasterai[all] ``` -------------------------------- ### Deploy ELK Stack (Elasticsearch & Kibana) with Helm Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Installs Elasticsearch and Kibana using their respective Helm charts. This sets up a basic ELK stack for centralized logging and analysis. ```bash helm repo add elastic https://helm.elastic.co helm install elasticsearch elastic/elasticsearch -n logging --create-namespace helm install kibana elastic/kibana -n logging ``` -------------------------------- ### Deploy BMasterAI using kubectl Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Applies all Kubernetes manifests from the k8s directory to deploy BMasterAI. ```bash # Apply all manifests kubectl apply -f k8s/ ``` -------------------------------- ### Docker Compose Deployment Source: https://github.com/travis-burmaster/bmasterai/blob/main/examples/gradio-anthropic/README.md Configuration and command to deploy the application using Docker Compose. This method simplifies multi-container setups and requires setting the API key in a local .env file. ```yaml # Set your API key in .env file echo "ANTHROPIC_API_KEY=your-api-key" > .env # Start the application docker-compose up -d ``` -------------------------------- ### Configure EKS Managed Node Group with Spot Instances Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md An example configuration using eksctl to create an EKS cluster with managed node groups that utilize EC2 Spot Instances. This helps optimize costs for worker nodes. ```yaml # EKS managed node group with spot apiVersion: eksctl.io/v1alpha5 kind: ClusterConfig metadata: name: bmasterai-cluster region: us-west-2 managedNodeGroups: - name: spot-workers instanceTypes: - m5.large - m5.xlarge spot: true minSize: 1 maxSize: 10 desiredCapacity: 3 ``` -------------------------------- ### Kubernetes Troubleshooting: Storage Issues Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Guides on diagnosing storage-related problems by checking Persistent Volumes (PVs) and Persistent Volume Claims (PVCs), describing storage classes, and examining disk usage within pods. ```APIDOC Kubernetes Storage Issue Diagnosis: Check Persistent Volumes and Claims: kubectl get pv,pvc -n bmasterai - Lists all Persistent Volumes and Persistent Volume Claims in the 'bmasterai' namespace to check their status and binding. Describe storage class: kubectl describe storageclass - Shows details of available StorageClasses, which define how storage is provisioned. Check disk usage within a pod: kubectl exec -it -n bmasterai -- df -h - Executes the 'df -h' command inside a pod to check mounted filesystems and disk space usage. ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/travis-burmaster/bmasterai/blob/main/examples/rag-qdrant/README.md Installs all necessary Python packages listed in the requirements.txt file. This ensures the project has all its dependencies met for execution. ```bash pip install -r requirements.txt ``` -------------------------------- ### BMasterAI CLI Commands Source: https://github.com/travis-burmaster/bmasterai/blob/main/INSTALL.md Common commands for interacting with the BMasterAI Command Line Interface, including project initialization and status checks. ```bash bmasterai init my-project ``` ```bash bmasterai status ``` -------------------------------- ### Install General Utilities Source: https://github.com/travis-burmaster/bmasterai/blob/main/examples/rag-qdrant/requirements.txt Includes utility libraries for displaying progress bars, creating command-line interfaces, rich text formatting, and human-readable time/size conversions. ```requirements tqdm>=4.65.0 ``` ```requirements click>=8.1.0 ``` ```requirements rich>=13.0.0 ``` ```requirements humanize>=4.7.0 ``` -------------------------------- ### Docker Build and Run Source: https://github.com/travis-burmaster/bmasterai/blob/main/examples/gradio-anthropic/README.md Instructions for building a Docker image for the Gradio application and running it as a container. It includes setting the Anthropic API key as an environment variable. ```bash docker build -t bmasterai-gradio . docker run -p 7860:7860 -e ANTHROPIC_API_KEY=your-key bmasterai-gradio ``` -------------------------------- ### Install/Upgrade BMasterAI CLI Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/cli/overview.md Install or upgrade the BMasterAI command-line interface. This is crucial if the 'bmasterai' command is not found or if you need the latest features. ```bash # If bmasterai command is not found pip install --upgrade bmasterai ``` -------------------------------- ### Install Optional Production Deployment Tools Source: https://github.com/travis-burmaster/bmasterai/blob/main/examples/rag-qdrant/requirements.txt Optional packages for production deployment, including WSGI/ASGI servers, Docker integration, and Kubernetes client libraries. ```requirements # gunicorn>=21.0.0 # WSGI server ``` ```requirements # uvicorn>=0.23.0 # ASGI server ``` ```requirements # docker>=6.1.0 # Docker integration ``` ```requirements # kubernetes>=27.0.0 # Kubernetes deployment ``` -------------------------------- ### Customizing System Prompt Source: https://github.com/travis-burmaster/bmasterai/blob/main/examples/gradio-anthropic/README.md Python code snippet showing how to set a custom system prompt for the AI model by passing it to the `BMasterAIConfig` constructor. ```python config = BMasterAIConfig( # ... system_prompt="You are a specialized AI assistant for [your use case]." ) ``` -------------------------------- ### Deploy BMasterAI with Kustomize Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Applies the Kustomize configuration to deploy the BMasterAI application. This command processes the kustomization.yaml file and applies the resulting manifests to the Kubernetes cluster. ```bash kubectl apply -k . ``` -------------------------------- ### Create and Navigate Project Directory Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/examples/rag-tutorials.md Initializes a new project directory for the RAG system and changes the current working directory into it. ```bash mkdir my-rag-system cd my-rag-system ``` -------------------------------- ### Initialize SimpleRAGSystem Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/examples/rag-tutorials.md Initializes the RAG system by configuring logging, setting up the agent ID, and initializing Qdrant, OpenAI, and the embedding model. ```python from qdrant_client import QdrantClient from qdrant_client.models import Distance, VectorParams, PointStruct from sentence_transformers import SentenceTransformer import openai import hashlib import os from typing import List, Dict, Any # Assuming configure_logging, get_logger, get_monitor, EventType, LogLevel are defined elsewhere # For demonstration, let's mock them: class MockLogger: def log_event(self, agent_id, event_type, message, **kwargs): print(f"LOG: Agent='{agent_id}', Event='{event_type}', Msg='{message}', Kwargs={kwargs}") class MockMonitor: def start_monitoring(self): print("MONITOR: Monitoring started") def configure_logging(log_level): print(f"LOGGING: Configured with level {log_level}") def get_logger(): return MockLogger() def get_monitor(): return MockMonitor() class EventType: AGENT_START = "AGENT_START" TASK_START = "TASK_START" TASK_COMPLETE = "TASK_COMPLETE" TASK_ERROR = "TASK_ERROR" class LogLevel: INFO = "INFO" ERROR = "ERROR" class SimpleRAGSystem: def __init__(self): # Configure BMasterAI configure_logging(log_level=LogLevel.INFO) self.logger = get_logger() self.monitor = get_monitor() self.monitor.start_monitoring() self.agent_id = "simple-rag" # Initialize components self._init_qdrant() self._init_openai() self._init_embeddings() self.logger.log_event( self.agent_id, EventType.AGENT_START, "Simple RAG system initialized" ) def _init_qdrant(self): """Initialize Qdrant client""" self.qdrant_client = QdrantClient( url=os.getenv("QDRANT_URL"), api_key=os.getenv("QDRANT_API_KEY") ) self.collection_name = "simple_rag_demo" def _init_openai(self): """Initialize OpenAI client""" openai.api_key = os.getenv("OPENAI_API_KEY") def _init_embeddings(self): """Initialize embedding model""" self.embedding_model = SentenceTransformer('all-MiniLM-L6-v2') ``` -------------------------------- ### Initialize BMasterAI Project (`bmasterai init`) Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/cli/overview.md Initializes a new BMasterAI project with a standard directory structure, including agent templates, configuration files, and log directories. It follows best practices for BMasterAI development. ```bash bmasterai init ``` ```bash bmasterai init customer-support-ai ``` ```text my-project/ ├── agents/my_agent.py # Working agent template ├── config/config.yaml # Configuration file └── logs/ # Log directory ``` ```bash cd customer-support-ai python agents/my_agent.py ``` -------------------------------- ### Run RAG System with Queries Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/examples/rag-tutorials.md This Python script demonstrates how to initialize and use a RAGSystem to process a list of queries. It iterates through predefined questions, sends them to the RAG system for answers, and prints the results. Ensure the RAGSystem class and its dependencies are correctly installed. ```python from rag_system import RAGSystem import os def main(): # Load environment variables if needed # For example, if your RAGSystem needs API keys from .env # from dotenv import load_dotenv # load_dotenv() # Initialize RAG system # Assuming RAGSystem takes a configuration path or object # For this example, let's assume it loads default config or requires minimal setup rag = RAGSystem() queries = [ "What are the core components of a RAG system?", "How does retrieval augmentation improve LLM responses?", "Explain the benefits of using RAG for AI applications" ] for query in queries: print(f"\n{'='*60}") answer = rag.query(query) print(f"{'='*60}") if __name__ == "__main__": main() ``` -------------------------------- ### Run Production RAG System Demo (Python) Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/examples/rag-tutorials.md This Python script initializes and demonstrates the production RAG system. It performs a health check, processes sample queries, and prints the results, including status and answer snippets. It requires the 'bmasterai' library and other dependencies listed in requirements.txt. ```Python print("🏭 Starting Production RAG System...") try: # Initialize production system prod_rag = ProductionRAGSystem() # Health check health = prod_rag.health_check() print(f"System Status: {health['status']}") # Sample queries queries = [ "What is artificial intelligence?", "How does machine learning work?", "Explain neural networks" ] for query in queries: print(f"\n🔍 Query: {query}") result = prod_rag.query(query) print(f"Status: {result['status']}") print(f"Duration: {result['duration_ms']:.2f}ms") if result['status'] == 'success': print(f"Answer: {result['answer'][:200]}...") print("\n✅ Production RAG system demo completed!") except Exception as e: print(f"❌ Production system error: {e}") # Assuming a main function exists to call this logic # def main(): # # ... logic above ... # # if __name__ == "__main__": # main() ``` -------------------------------- ### EKS Deployment and Monitoring Scripts Source: https://github.com/travis-burmaster/bmasterai/blob/main/README.md Shell scripts for creating an EKS cluster, deploying BMasterAI, and installing monitoring tools like Prometheus and Grafana. ```bash ./eks/setup-scripts/01-create-cluster.sh ./eks/setup-scripts/02-deploy-bmasterai.sh ./eks/setup-scripts/03-install-monitoring.sh ``` -------------------------------- ### BMasterAI Command Line Interface (CLI) Usage Source: https://github.com/travis-burmaster/bmasterai/blob/main/README.md Examples of using the BMasterAI CLI for project initialization, system status checks, monitoring, and integration testing. ```bash # Install BMasterAI pip install bmasterai # View help bmasterai --help # Initialize a new project bmasterai init my-ai-project # Check system status bmasterai status # Start real-time monitoring bmasterai monitor # Test integrations bmasterai test-integrations ``` -------------------------------- ### Install Vertical Pod Autoscaler (VPA) Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Installs the Vertical Pod Autoscaler (VPA) components into the Kubernetes cluster. This enables automatic adjustment of pod resource requests and limits. ```bash git clone https://github.com/kubernetes/autoscaler.git cd autoscaler/vertical-pod-autoscaler ./hack/vpa-install.sh ``` -------------------------------- ### Install OPA Gatekeeper Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Installs the Open Policy Agent (OPA) Gatekeeper, a Kubernetes admission controller, using its official deployment manifest. This is a prerequisite for enforcing custom policies. ```bash kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper/release-3.14/deploy/gatekeeper.yaml ``` -------------------------------- ### Basic RAG System Initialization Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/examples/rag-tutorials.md Initializes a Python script for a basic Retrieval-Augmented Generation (RAG) system using BMasterAI and Qdrant Cloud. It includes logging and monitoring setup. ```python #!/usr/bin/env python3 """Basic RAG system with BMasterAI and Qdrant Cloud""" import os import time from typing import List, Dict, Any # BMasterAI imports from bmasterai.logging import configure_logging, get_logger, LogLevel, EventType from bmasterai.monitoring import get_monitor ``` -------------------------------- ### Install EBS CSI Driver on EKS Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Installs the Amazon Elastic Block Store (EBS) Container Storage Interface (CSI) driver on the EKS cluster for persistent volume management. ```bash eksctl create addon --name aws-ebs-csi-driver --cluster bmasterai-cluster ``` -------------------------------- ### Configure Qdrant and OpenAI Credentials Source: https://github.com/travis-burmaster/bmasterai/blob/main/examples/minimal-rag/README_qdrant_cloud.md Sets up environment variables for Qdrant Cloud URL, API key, and OpenAI API key, which are essential for the RAG system to connect to these services. ```bash # Qdrant Cloud configuration export QDRANT_URL="https://your-cluster.qdrant.io" export QDRANT_API_KEY="your-qdrant-api-key" # OpenAI configuration export OPENAI_API_KEY="your-openai-api-key" ``` ```env QDRANT_URL=https://your-cluster.qdrant.io QDRANT_API_KEY=your-qdrant-api-key OPENAI_API_KEY=your-openai-api-key ``` -------------------------------- ### Install External Secrets Operator Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/kubernetes-deployment.md Installs the External Secrets Operator (ESO) using Helm. ESO allows Kubernetes to securely fetch secrets from external sources like cloud provider secret managers. ```bash helm repo add external-secrets https://charts.external-secrets.io helm install external-secrets external-secrets/external-secrets -n external-secrets-system --create-namespace ``` -------------------------------- ### Deploy RAG System with Docker (Bash) Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/examples/rag-tutorials.md These bash commands demonstrate how to build the Docker image for the RAG system and run it as a container. The `docker run` command maps the container's port 7860 to the host's port 7860 and sets essential environment variables for Qdrant and OpenAI API access. ```Bash # Build Docker image docker build -t my-rag-system . # Run container docker run -p 7860:7860 \ -e QDRANT_URL="https://your-cluster.qdrant.io" \ -e QDRANT_API_KEY="your-api-key" \ -e OPENAI_API_KEY="your-openai-key" \ my-rag-system ``` -------------------------------- ### Initialize Qdrant and RAG Configurations Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/rag/qdrant-cloud.md Demonstrates how to initialize configuration objects for Qdrant Cloud and the RAG system using Python. This includes specifying connection details, collection parameters, embedding models, and LLM settings. ```python from examples.minimal_rag.bmasterai_rag_qdrant_cloud import QdrantConfig, RAGConfig from qdrant_client.http.models import Distance # Qdrant Cloud configuration qdrant_config = QdrantConfig( url="https://your-cluster.qdrant.io", api_key="your-qdrant-api-key", collection_name="bmasterai_knowledge", vector_size=384, # Matches embedding model dimensions distance=Distance.COSINE, # Similarity metric timeout=30 # Request timeout in seconds ) # RAG system configuration rag_config = RAGConfig( openai_api_key="your-openai-api-key", embedding_model="all-MiniLM-L6-v2", # SentenceTransformers model llm_model="gpt-3.5-turbo", # OpenAI model max_tokens=1000, temperature=0.7, top_k_results=5, similarity_threshold=0.7 ) ``` -------------------------------- ### Build Docker Image for RAG System (Dockerfile) Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/examples/rag-tutorials.md This Dockerfile defines the environment for the RAG system. It uses a slim Python 3.9 image, sets the working directory, installs dependencies from requirements.txt, copies the application code, exposes the application port, and specifies the command to run the Python script. ```Dockerfile FROM python:3.9-slim WORKDIR /app # Install dependencies COPY requirements.txt . RUN pip install -r requirements.txt # Copy application COPY . . # Expose port EXPOSE 7860 # Run application CMD ["python", "production_rag.py"] ``` -------------------------------- ### Get Agent Dashboard and System Health Source: https://github.com/travis-burmaster/bmasterai/blob/main/examples/minimal-rag/README_qdrant_cloud.md Retrieves the dashboard specific to an agent and checks the overall system health status. These functions are part of the monitoring capabilities of the BMasterAI framework. ```python # Get agent-specific dashboard dashboard = monitor.get_agent_dashboard("qdrant-rag-agent") # Get system health health = monitor.get_system_health() ``` -------------------------------- ### List RAG System Dependencies (requirements.txt) Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/examples/rag-tutorials.md This file lists all the Python packages and their minimum version requirements for the RAG system. It includes the core 'bmasterai' library, client libraries for Qdrant and OpenAI, and tools for embeddings and web interfaces. ```Text bmasterai>=0.2.0 qdrant-client>=1.7.0 openai>=1.0.0 sentence-transformers>=2.2.0 numpy>=1.24.0 gradio>=4.0.0 pyyaml>=6.0 ``` -------------------------------- ### CI/CD Workflow for BMasterAI Health Check Source: https://github.com/travis-burmaster/bmasterai/blob/main/docs/cli/overview.md An example GitHub Actions workflow to check BMasterAI integrations on code push or pull requests. It installs BMasterAI and runs integration tests. ```yaml # .github/workflows/bmasterai-check.yml name: BMasterAI Health Check on: [push, pull_request] jobs: health-check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Install BMasterAI run: pip install bmasterai - name: Test integrations run: bmasterai test-integrations env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} ```