This is my submission for the Nosana Builders Challenge: Agent-101. I've built an advanced AI agent ecosystem using the Mastra framework, featuring two specialized agents that demonstrate sophisticated automation capabilities: a Deploy Manager Agent for DevOps automation and a Blockchain Monitor Agent for comprehensive blockchain analytics. The solution showcases agent composition, meta-deployment capabilities, and real-world automation use cases.
Live Demo: https://2KYQRoo4v8UMBvfPvuNpD5fviEiAmFomvK9QUrVW7xJs.node.k8s.prd.nos.ci
Video Demo: https://www.loom.com/share/4768bd5791144d4d95f59f8b9965d9f3
Docker Image: docker.io/bprime/agent-challenge:latest
Repository: This repository contains the complete solution implementation
A comprehensive DevOps automation agent that demonstrates advanced deployment capabilities within the Mastra framework. This agent showcases meta-deployment functionality, allowing it to discover, analyze, and deploy other agents while providing cost optimization and monitoring capabilities.
Key Features:
- Agent Discovery & Meta-Deployment: Discovers available Mastra agents and enables deployment of agents by name
- Real Infrastructure Automation: Actually builds Docker images and deploys to Nosana network
- Live Deployment Execution: Real
docker buildandnosana job postcommands with live monitoring - Cost Intelligence: Analyzes GPU market pricing (RTX 3090, 4090, A6000, A100) with cost optimization
- Real-time Operations: Live job status tracking and actual cost monitoring
- Production Monitoring: Real health checks on deployed agents with performance metrics
Implementation Tools:
agentDiscoveryTool: Discovers and analyzes available Mastra agents with deployment specificationsdockerfileGeneratorTool: Generates optimized Dockerfiles with security best practicesdockerBuildTool: Executes realdocker buildanddocker pushcommands with registry authenticationnosanaJobCreatorTool: Creates Nosana job definitions with optimal GPU market selectiondeploymentExecutorTool: Real Nosana CLI integration withnpx @nosana/cli job postexecutionmonitoringTool: Live job monitoring usingnosana job getwith real-time status updatescostAnalyzerTool: Real cost tracking based on actual elapsed time and GPU market ratestroubleshooterTool: Diagnoses and resolves deployment issues with actionable solutions
Demonstration Use Cases:
- Real Agent Deployment: Actually deploy any Mastra agent to Nosana network with live URLs
- Live Cost Analysis: Real-time cost tracking across different GPU markets with actual pricing
- Production Infrastructure: Generate and execute Docker builds and Nosana deployments
- Live Monitoring: Real-time job monitoring with health checks and performance metrics
A specialized blockchain analytics agent built for the challenge that demonstrates comprehensive monitoring capabilities across multiple networks and DeFi protocols. This agent showcases advanced workflow orchestration and real-time blockchain intelligence gathering.
Key Features:
- Real-time Price Monitoring: Live CoinGecko API integration for actual cryptocurrency prices
- Transaction Analysis: Monitor wallet addresses and detect activity patterns
- DeFi Protocol Monitoring: Track liquidity pools, yield farming, and protocol health
- Risk Assessment: Evaluate investment risks and provide market insights
- Workflow Orchestration: Advanced multi-step monitoring workflows
Implementation Tools:
priceMonitorTool: Real CoinGecko API calls for live cryptocurrency price datatransactionMonitorTool: Wallet address monitoring and transaction analysisdefiMonitorTool: DeFi protocol monitoring and yield analysis
Demonstration Use Cases:
- Portfolio Monitoring: Track cryptocurrency investments with automated alerts
- Market Analysis: Analyze market movements and identify opportunities
- DeFi Tracking: Monitor DeFi protocols and yield farming opportunities
- Risk Assessment: Evaluate investment risks and protocol health
- Compliance Monitoring: Track transactions for regulatory compliance
This solution demonstrates advanced agent integration capabilities where agents can work together to provide comprehensive automation:
Meta-Deployment Capabilities:
- Deploy Manager can discover and deploy the Blockchain Monitor Agent
- Automated configuration and optimization for blockchain monitoring deployments
- Cost analysis for running blockchain monitoring infrastructure
- Real-time monitoring of deployed blockchain monitoring services
Agent Orchestration:
- Seamless integration between deployment automation and blockchain monitoring
- Agents can be deployed independently or work together in workflows
- Demonstrates composable agent architecture principles
- Showcases real-world automation scenarios
- Framework: Built with Mastra framework for TypeScript-based AI applications
- Agent System: Modular agent architecture with specialized tools
- Workflow Engine: Multi-step orchestration for complex operations
- Tool Integration: Custom tools with Zod schema validation
- Deployment: Real deployment on Nosana GPU network with live monitoring
- Production Ready: Full CI/CD integration with real Docker builds and job submission
The Blockchain Monitor Agent includes a sophisticated workflow (blockchain-monitor-workflow.ts) that orchestrates multiple monitoring operations:
- Market Analysis: Analyzes current market conditions and price movements
- Transaction Monitoring: Monitors wallet addresses for activity patterns
- DeFi Analysis: Evaluates yield opportunities and protocol health
- Report Generation: Creates comprehensive monitoring reports with alerts
Workflow Triggers:
portfolio: Monitor cryptocurrency portfoliosdefi: Analyze DeFi protocols and opportunitieswhale-watching: Monitor large wallet addressesmarket-analysis: Comprehensive market analysis
The Deploy Manager Agent demonstrates advanced meta-deployment capabilities:
// Example deployment flow
1. User: "Deploy the blockchain monitor agent"
2. Deploy Manager:
- Discovers agent requirements and specifications
- Analyzes cost implications across GPU markets
- Generates agent-specific optimized Dockerfile
- Creates Nosana job definition with appropriate GPU selection
- Builds and pushes Docker image to registry
- Deploys to Nosana network with monitoring setup
- Provides service URL for accessing the deployed agent# Install dependencies
pnpm install
# Start development server
pnpm run dev
# Visit http://localhost:8080-
Install Nosana CLI:
npm install -g @nosana/cli
-
Setup Nosana Wallet:
# Generate new wallet npx @nosana/cli wallet new # Fund wallet with SOL and NOS tokens npx @nosana/cli wallet balance
-
Configure Environment:
# Copy example configuration cp .env.nosana.example .env # Update with your settings: # NOSANA_WALLET_PATH=~/.nosana/nosana_key.json # DOCKER_USERNAME=yourdockerhubusername # DOCKER_TOKEN=your_docker_access_token
# Build and deploy using the Deploy Manager Agent
pnpm run dev
# Then interact with the Deploy Manager Agent to:
# 1. Build Docker images with real `docker build`
# 2. Deploy to Nosana network with real `nosana job post`
# 3. Monitor live deployments with real job tracking
# Or deploy manually:
pnpm run deploy:manager # Uses real Nosana CLI# Build container (can be automated by Deploy Manager Agent)
docker build -t yourusername/agent-challenge:latest .
# Run locally
docker run -p 8080:8080 --env-file .env yourusername/agent-challenge:latest
# Push to registry (automated by Deploy Manager Agent)
docker push yourusername/agent-challenge:latest# Mastra Configuration
MODEL_NAME_AT_ENDPOINT=qwen2.5:1.5b
API_BASE_URL=http://127.0.0.1:11434/api
# Nosana Real Deployment Configuration
NOSANA_WALLET_PATH=~/.nosana/nosana_key.json
NOSANA_DEFAULT_MARKET=nvidia-3090
DOCKER_USERNAME=yourdockerhubusername
DOCKER_TOKEN=your_docker_access_token- "What agents can I deploy?" β Lists available agents with deployment specs
- "Deploy the blockchain monitor agent" β Actually deploys to Nosana network with live URL
- "Analyze costs for deploying on A100 market" β Real cost analysis with current GPU pricing
- "Monitor deployment JOB_ID" β Live monitoring using real Nosana CLI job status
- "Build Docker image for my agent" β Executes real
docker buildwith registry push
- "Monitor Bitcoin and Ethereum prices" β Live CoinGecko API data with real prices
- "Track wallet address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa" β Transaction monitoring
- "Analyze Uniswap V3 liquidity pools" β DeFi protocol analysis
- "Generate a market analysis report" β Comprehensive market data
- "Set up portfolio monitoring workflow" β Multi-step workflow orchestration
- "Show me all available agents with their costs" β Real deployment specifications
- "Deploy the blockchain monitor agent to track BTC and ETH" β Actually deploys with live monitoring
- "What's the deployment complexity of different agents?" β Real resource analysis
- "Monitor my deployment costs in real-time" β Live cost tracking with actual billing
src/mastra/agents/
βββ deploy-manager/ # DevOps automation agent
β βββ deploy-manager-agent.ts
β βββ agent-discovery-tool.ts
β βββ cost-analyzer-tool.ts
β βββ deployment-executor-tool.ts
β βββ docker-build-tool.ts
β βββ dockerfile-generator-tool.ts
β βββ monitoring-tool.ts
β βββ nosana-job-creator-tool.ts
β βββ troubleshooter-tool.ts
βββ blockchain-monitor/ # Blockchain monitoring agent
β βββ blockchain-monitor-agent.ts
β βββ blockchain-monitor-workflow.ts
β βββ defi-monitor-tool.ts
β βββ price-monitor-tool.ts
β βββ transaction-monitor-tool.ts
βββ weather-agent/ # Example weather agent
βββ weather-agent.ts
βββ weather-tool.ts
βββ weather-workflow.ts
- Docker Image:
docker.io/bprime/agent-challenge:latest - Nosana Service URL: https://2KYQRoo4v8UMBvfPvuNpD5fviEiAmFomvK9QUrVW7xJs.node.k8s.prd.nos.ci
- Market: nvidia-3060
- Status: Active and running
- Real Meta-Deployment Architecture: Deploy Manager actually deploys agents to Nosana network
- Live Cost-Aware Deployment: Real-time cost tracking with intelligent GPU market selection
- Production-Ready Agent System: Real Docker builds and live Nosana deployments
- Real-World Applications: Actual deployments for DevOps automation and blockchain monitoring
- Live Workflow Orchestration: Real-time monitoring with intelligent decision making
- Full CI/CD Integration: Complete deployment pipeline from code to live production
- Docker Integration: Real
docker build,docker pushwith registry authentication - Nosana CLI Integration: Real
npx @nosana/cli job postdeployment execution - Live Job Monitoring: Real-time job status with
nosana job getintegration - Cost Tracking: Actual cost monitoring based on real elapsed time and GPU rates
- Health Monitoring: Live health checks on deployed services
- Environment Configuration: Complete
.envsetup for wallet and credentials - Security: Secure credential management with Docker token support
- Documentation: Comprehensive setup guide in
NOSANA_SETUP.md - Error Handling: Production-grade error handling and troubleshooting
This implementation demonstrates real production deployment where the Deploy Manager Agent can actually deploy other agents to the Nosana network, monitor them in real-time, and provide live cost analysis - showcasing the power of composable AI agents in production environments.
