daio/contracts/keyminter/README.md · 19.1 KB

mindX: Production Autonomous Augmented Intelligence System ๐Ÿค–

![Version](https://github.com/cryptoagi/mindX) ![License](LICENSE) ![Production Ready](docs/production_deployment.md) ![Author](https://github.com/Professor-Codephreak)

mindX is a production-grade autonomous Augmented Intelligence system implementing the Godel-machine architecture with multi-agent orchestration, encrypted vault management, and comprehensive security hardening.

Author: Professor Codephreak (ยฉ Professor Codephreak) Organizations: github.com/agenticplace, github.com/cryptoagi, github.com/Professor-Codephreak Resources: rage.pythai.net

๐Ÿš€ What is mindX?

mindX represents an implementation of a godel machine - a fully self-improving, economically viable, and cryptographically secure multi-agent system. We are building agents and creating a sovereign digital polity where Augmented Intelligence operates independently, evolves continuously, and participates in economic systems.

Machine Learning capabilities include advanced pattern recognition, autonomous decision-making, and continuous learning from operational data with encrypted memory management.

evolutionary Capabilities

  • Complete Autonomy: 1-hour improvement cycles without human intervention
  • Economic Viability: Real-time cost optimization and treasury management
  • Cryptographic Sovereignty: Ethereum-compatible wallet-based agent authentication
  • TODO include crossmint in IDmanagerAgent
  • Strategic Evolution: 4-phase audit-driven self-improvement pipeline
  • Mistral AI Integration: Advanced reasoning, code generation, and memory systems
  • ๐Ÿ—๏ธ Complete Architecture

    CORE System Status

  • CORE Agents: 15/15 foundational components identified and documented (100%)
  • Specialized Agents: 25+ domain-specific agents built on CORE foundation
  • Tools Secured: 17/17 tools cryptographically secured (100%)
  • Identity Management: Ethereum-compatible wallet system with encrypted vault storage
  • Economic System: Real-time cost optimization and treasury management
  • Production Ready: Enterprise deployment with encrypted vault security
  • ๐Ÿง  CORE Foundation (15 Components)

    Meta-Orchestration:

  • MindXAgent: Meta-orchestrator understanding all agents (~149KB, ~3,800 lines)
  • MastermindAgent (0xb9B46126551652eb58598F1285aC5E86E5CcfB43): Strategic control and AION directive management
  • Cognitive Architecture:

  • BDIAgent (0xf8f2da254D4a3F461e0472c65221B26fB4e91fB7): Core reasoning engine with tool execution (~64KB)
  • AGInt (0x24C61a2d0e4C4C90386018B43b0DF72B6C6611e2): P-O-D-A cognitive loop orchestrator
  • BeliefSystem: Singleton shared knowledge store with confidence scoring
  • Infrastructure Services:

  • CoordinatorAgent (0x7371e20033f65aB598E4fADEb5B4e400Ef22040A): Central service bus with pub/sub system (~56KB)
  • MemoryAgent: Persistent memory with STM/LTM promotion (~53KB)
  • IDManagerAgent (0x290bB0497dBDbC5E8B577E0cc92457cB015A2a1f): Cryptographic identity ledger
  • GuardianAgent (0xC2cca3d6F29dF17D1999CFE0458BC3DEc024F02D): Security infrastructure and access control
  • StartupAgent: System bootstrap controller (~83KB, ~2,400 lines)
  • Core Utilities:

  • ReasoningAgent, EpistemicAgent, NonMonotonicAgent: Specialized reasoning
  • SessionManager: Session lifecycle management
  • StuckLoopDetector & ExitDetector: Loop prevention and exit conditions
  • ๐Ÿš€ Specialized Agents (Built on CORE)

    Strategic Services:

  • StrategicEvolutionAgent (0x5208088F9C7c45a38f2a19B6114E3C5D17375C65): 4-phase audit-driven improvement pipeline
  • Autonomous Operations:

  • AION Agent: Autonomous chroot management with decision sovereignty
  • SystemAdminAgent: Privileged operations (AION-controlled only)
  • BackupAgent: Blockchain memory storage with git integration
  • Development & Analysis:

  • EnhancedSimpleCoder & SimpleCoder: Advanced coding capabilities
  • AnalyzerAgent & BenchmarkAgent: Code analysis and performance testing
  • Monitoring & Health:

  • PerformanceMonitor & ResourceMonitor: System health and metrics
  • ErrorRecoveryCoordinator: Intelligent error recovery
  • Mistral AI Integration

  • Mistral Large (mistral-large-latest): Advanced reasoning and strategic thinking
  • Codestral (codestral-latest): Autonomous code generation and software development
  • Mistral Nemo (mistral-nemo-latest): High-speed processing for real-time operations
  • Mistral Embed (mistral-embed-v2): Semantic memory and knowledge retrieval
  • ๐Ÿš€ Quick Start

    Prerequisites

    # Install Python dependencies
    pip install -r requirements.txt

    Ensure Python 3.11+ is available

    python3 --version

    Environment Setup

    # Copy and configure environment
    cp .env.sample .env

    Add your Mistral AI API key

    echo "MISTRAL_API_KEY=your-mistral-api-key-here" >> .env

    Optional: Configure other API keys

    echo "OPENAI_API_KEY=your-openai-key" >> .env echo "ANTHROPIC_API_KEY=your-anthropic-key" >> .env

    Launch Autonomous System

    ๐Ÿš€ Recommended: Enhanced Web Interface

    # Start MindX with enhanced web interface (backend + frontend)
    ./mindX.sh --frontend

    Features: Real-time monitoring, health status, agent management, system metrics

    Access: http://localhost:3000 (Frontend) + http://localhost:8000 (Backend API)

    ๐Ÿ”ง Advanced Deployment Options

    # Basic deployment (backend + frontend services)
    ./mindX.sh --run

    Interactive setup with API key configuration

    ./mindX.sh --interactive

    Deploy to specific directory

    ./mindX.sh /path/to/deployment/directory

    Custom ports

    ./mindX.sh --frontend --frontend-port 3001 --backend-port 8001

    Use existing configuration files

    ./mindX.sh --config-file /path/to/mindx_config.json --dotenv-file /path/to/.env

    ๐Ÿ“‹ mindX.sh Script Options

    # Show help and all available options
    ./mindX.sh --help

    Available options:

    --frontend # Start enhanced web interface (recommended) --run # Start backend and frontend services --interactive # Prompt for API keys during setup --replicate # Copy source code to target directory --config-file <path> # Use existing mindx_config.json --dotenv-file <path> # Use existing .env file --venv-name <name> # Override virtual environment name --frontend-port <port> # Override frontend port (default: 3000) --backend-port <port> # Override backend port (default: 8000) --log-level <level> # Set log level (DEBUG, INFO, etc.)

    ๐ŸŽฏ Quick Start Examples

    # 1. First-time setup with interactive API key configuration
    ./mindX.sh --frontend --interactive

    2. Production deployment with custom configuration

    ./mindX.sh --frontend --config-file production_config.json

    3. Development setup with custom ports

    ./mindX.sh --frontend --frontend-port 3001 --backend-port 8001

    4. Full system deployment without web interface

    ./mindX.sh --run

    ๐Ÿ”„ Alternative Launch Methods

    # Direct execution (legacy)
    python3 augmentic.py

    Web interface launcher (legacy)

    ./run_mindx_web.sh

    Simple version (minimal features)

    python3 augmentic_simple.py

    Monitor System Status

    # Check system status
    python3 augmentic.py --status

    View agent performance metrics

    python3 augmentic.py --metrics

    Monitor Mistral AI usage and costs

    python3 augmentic.py --costs

    Check evolution progress

    python3 augmentic.py --evolution

    ๐Ÿ“ Project Structure

    mindX/
    โ”œโ”€โ”€ docs/                    # Complete documentation (103+ files)
    โ”‚   โ”œโ”€โ”€ agents_architectural_reference.md
    โ”‚   โ”œโ”€โ”€ mistral_api.md
    โ”‚   โ”œโ”€โ”€ hackathon.md
    โ”‚   โ””โ”€โ”€ [100+ more documentation files]
    โ”œโ”€โ”€ tests/                   # Comprehensive test suite (30+ files)
    โ”‚   โ”œโ”€โ”€ test_mistral_chat_completion_api.py
    โ”‚   โ”œโ”€โ”€ test_agent_lifecycle_complete.py
    โ”‚   โ””โ”€โ”€ [25+ more test files]
    โ”œโ”€โ”€ agents/                  # Agent implementations
    โ”‚   โ”œโ”€โ”€ mastermind_agent.py
    โ”‚   โ”œโ”€โ”€ guardian_agent.py
    โ”‚   โ””โ”€โ”€ [other agent files]
    โ”œโ”€โ”€ api/                     # API components
    โ”‚   โ”œโ”€โ”€ mistral_api.py
    โ”‚   โ””โ”€โ”€ api_server.py
    โ”œโ”€โ”€ core/                    # Core system components
    โ”‚   โ”œโ”€โ”€ bdi_agent.py
    โ”‚   โ”œโ”€โ”€ agint.py
    โ”‚   โ””โ”€โ”€ belief_system.py
    โ”œโ”€โ”€ orchestration/           # Orchestration agents
    โ”‚   โ”œโ”€โ”€ coordinator_agent.py
    โ”‚   โ””โ”€โ”€ ceo_agent.py
    โ”œโ”€โ”€ learning/                # Learning and evolution
    โ”‚   โ”œโ”€โ”€ strategic_evolution_agent.py
    โ”‚   โ””โ”€โ”€ self_improve_agent.py
    โ”œโ”€โ”€ monitoring/              # Performance monitoring
    โ”‚   โ”œโ”€โ”€ enhanced_monitoring_system.py
    โ”‚   โ””โ”€โ”€ performance_monitor.py
    โ”œโ”€โ”€ tools/                   # Tool ecosystem (27+ tools)
    โ”‚   โ”œโ”€โ”€ audit_and_improve_tool.py
    โ”‚   โ”œโ”€โ”€ augmentic_intelligence_tool.py
    โ”‚   โ””โ”€โ”€ [25+ more tools]
    โ”œโ”€โ”€ models/                  # Model configurations
    โ”‚   โ”œโ”€โ”€ mistral.yaml
    โ”‚   โ””โ”€โ”€ gemini.yaml
    โ”œโ”€โ”€ augmentic.py             # Main entry point
    โ”œโ”€โ”€ augmentic_simple.py      # Simplified version
    โ”œโ”€โ”€ start_autonomous_evolution.py
    โ”œโ”€โ”€ mindX.sh                 # Enhanced deployment script with web interface
    โ”œโ”€โ”€ run_mindx_web.sh         # Legacy web interface launcher (deprecated)
    โ”œโ”€โ”€ mindx_frontend_ui/       # Enhanced frontend UI files
    โ”‚   โ”œโ”€โ”€ index.html           # Main HTML interface
    โ”‚   โ”œโ”€โ”€ app.js               # Frontend JavaScript with full integration
    โ”‚   โ”œโ”€โ”€ styles3.css          # Cyberpunk 2049 theme CSS
    โ”‚   โ””โ”€โ”€ server.js            # Frontend server
    โ”œโ”€โ”€ mindx_backend_service/   # Backend API service
    โ”‚   โ””โ”€โ”€ main_service.py      # FastAPI backend with all endpoints
    โ”œโ”€โ”€ pyproject.toml           # Project configuration
    โ”œโ”€โ”€ requirements.txt         # Dependencies
    โ”œโ”€โ”€ .env.sample              # Environment template
    โ””โ”€โ”€ .gitignore               # Git ignore rules
    

    ๐ŸŽฏ Key Features

    Autonomous Operation

  • Complete Autonomy: 1-hour improvement cycles without human intervention
  • Strategic Evolution: 4-phase audit-driven self-improvement pipeline
  • Economic Viability: Real-time cost optimization and treasury management
  • Cryptographic Security: Ethereum-compatible wallet-based authentication
  • Mistral AI Integration

  • Advanced Reasoning: Mistral Large for complex strategic thinking
  • Code Generation: Codestral for autonomous software development
  • High-Speed Processing: Mistral Nemo for real-time operations
  • Semantic Memory: Mistral Embed for knowledge retrieval and storage
  • Production Ready

  • Agent Registry: 9/20+ agents registered with cryptographic identities
  • Tool Ecosystem: 17/17 tools cryptographically secured
  • Comprehensive Testing: 30+ test files with full coverage
  • Complete Documentation: 103+ documentation files
  • ๐Ÿ“š Documentation

    Core Architecture

  • Agent Architecture - Complete agent registry and capabilities
  • Autonomous Civilization - Philosophical and technical foundation
  • BDI Agent - Belief-Desire-Intention architecture
  • Mastermind Agent - Strategic orchestration system
  • Mistral AI Integration

  • Mistral API Documentation - Complete API integration guide
  • Mistral API Compliance - Official API 1.0.0 compliance
  • Mistral Models Configuration - Model selection and optimization
  • Advanced Features

  • Strategic Evolution - Autonomous improvement system
  • Memory Architecture - Scalable memory management
  • Blueprint Agent - System design automation
  • Guardian Agent - Security and validation
  • Technical Architecture - Complete system design
  • ๐Ÿงช Testing

    Run Test Suite

    # Run all tests
    python -m pytest tests/

    Run specific test categories

    python -m pytest tests/test_mistral_chat_completion_api.py python -m pytest tests/test_agent_lifecycle_complete.py

    Run with coverage

    python -m pytest tests/ --cov=.

    Test Categories

  • Mistral AI Integration: API compliance and functionality tests
  • Agent Lifecycle: Complete agent creation and management tests
  • System Integration: End-to-end autonomous operation tests
  • Performance: Load testing and optimization validation
  • ๐ŸŒ Enhanced Web Interface

    Real-Time Monitoring Dashboard

    The enhanced web interface provides a comprehensive control panel with:

  • ๐Ÿ”ด๐ŸŸข Health Status: Live system health indicators with component-level monitoring
  • ๐Ÿ“Š Performance Metrics: Real-time CPU, memory, and disk usage tracking
  • ๐Ÿค– Agent Management: Complete agent registry with real-time status updates
  • ๐Ÿ“ System Logs: Live log streaming with filtering and search capabilities
  • ๐Ÿ’ป Terminal Access: Built-in terminal for system commands and monitoring
  • โš™๏ธ Admin Controls: System restart, backup, configuration management
  • Access the Web Interface

    # Start enhanced web interface
    ./mindX.sh --frontend

    Access URLs:

    Frontend: http://localhost:3000

    Backend API: http://localhost:8000

    API Documentation: http://localhost:8000/docs

    Web Interface Features

  • Cyberpunk 2049 Theme: Professional UI with advanced animations
  • Real-Time Updates: Live data refresh without page reload
  • Responsive Design: Works on desktop, tablet, and mobile devices
  • Error Handling: Graceful degradation and user-friendly error messages
  • API Integration: Complete backend-frontend integration with all endpoints
  • ๐Ÿš€ Deployment

    Live Production

    mindX is live at https://mindx.pythai.net โ€” Hostinger VPS with SSL, BANKON Vault credential management, and systemd auto-restart.

  • API Docs: https://mindx.pythai.net/docs
  • Health: https://mindx.pythai.net/health
  • Deployment Guide: docs/DEPLOYMENT_MINDX_PYTHAI_NET.md
  • API keys are stored encrypted in BANKON Vault (AES-256-GCM + HKDF-SHA512). Manage credentials:

    python manage_credentials.py store gemini_api_key "YOUR_KEY"
    python manage_credentials.py list
    python manage_credentials.py providers   # Show all supported providers
    

    Local Development

    # Enhanced web interface (recommended)
    ./mindX.sh --frontend

    Basic services deployment

    ./mindX.sh --run

    Custom deployment directory

    ./mindX.sh /opt/mindx --frontend

    Production with custom configuration

    ./mindX.sh --frontend --config-file production_config.json --dotenv-file .env.prod

    Development & Testing

    # Development with custom ports
    ./mindX.sh --frontend --frontend-port 3001 --backend-port 8001

    Interactive setup for first-time users

    ./mindX.sh --frontend --interactive

    Replicate source code to target directory

    ./mindX.sh --replicate /path/to/deployment

    Legacy Deployment Methods

    # Legacy web interface (deprecated)
    ./run_mindx_web.sh

    Docker deployment (if available)

    docker build -t mindx . docker run -p 8000:8000 mindx

    Environment Requirements

  • Python: 3.11+
  • Memory: 8GB+ RAM recommended
  • Storage: 10GB+ free space
  • Network: Internet access for Mistral AI API
  • ๐Ÿ”ง Troubleshooting

    Common Issues & Solutions

    Port Already in Use

    # Check what's using the ports
    lsof -i :3000  # Frontend port
    lsof -i :8000  # Backend port

    Kill processes if needed

    sudo kill -9 $(lsof -ti:3000) sudo kill -9 $(lsof -ti:8000)

    Use different ports

    ./mindX.sh --frontend --frontend-port 3001 --backend-port 8001

    Permission Denied

    # Make script executable
    chmod +x mindX.sh

    Run with proper permissions

    sudo ./mindX.sh --frontend

    Python Environment Issues

    # Ensure Python 3.11+ is installed
    python3 --version

    Create virtual environment manually

    python3 -m venv .mindx_env source .mindx_env/bin/activate pip install -r requirements.txt

    API Key Configuration

    # Interactive setup for API keys
    ./mindX.sh --frontend --interactive

    Manual .env configuration

    cp .env.sample .env nano .env # Add your API keys

    Frontend Not Loading

    # Check if backend is running
    curl http://localhost:8000/health

    Check frontend logs

    tail -f data/logs/mindx_frontend_service.log

    Restart with verbose logging

    ./mindX.sh --frontend --log-level DEBUG

    Backend API Errors

    # Check backend logs
    tail -f data/logs/mindx_coordinator_service.log

    Test API endpoints

    curl http://localhost:8000/ curl http://localhost:8000/status/mastermind curl http://localhost:8000/health

    Getting Help

  • Check the logs in data/logs/ directory
  • Run ./mindX.sh --help for all available options
  • Review the API documentation at http://localhost:8000/docs
  • Check the Issues page
  • ๐Ÿค Contributing

    This is the evolution of mindX - a production-ready godel-machine. The system is designed to operate independently while providing comprehensive documentation and testing capabilities.

    Development Guidelines

  • Follow the existing code structure and patterns
  • Add comprehensive tests for new features
  • Update documentation for any changes
  • Ensure Mistral AI integration compatibility
  • ๐Ÿ“„ License

    MIT License - See LICENSE for details.

    ๐Ÿ”— Links

    mindx.pythai.net

    ๐ŸŽ‰ mindX: The First Autonomous Digital Civilization

    Status: โœ… EXPERIMENTAL - Fully Deployed & Operational Achievement: World's first autonomous digital civilization with economic viability Innovation: Complete Mistral AI integration with cryptographic sovereignty Impact: Transforming intelligence from service to stakeholder

    Where Intelligence Meets Autonomy - The Dawn of Agentic Sovereignty

    (c) 2025 PYTHAI Institute for Emergent Systems


    Referenced in this document
    DEPLOYMENT_MINDX_PYTHAI_NETTECHNICALagents_architectural_referenceautonomous_civilizationhackathonmemorymistral_apimistral_chat_completion_api_compliancemistral_modelsproduction_deployment

    All DocumentsDocument IndexThe Book of mindXImprovement JournalAPI Reference