Skip to main content

A distributed AI agent orchestration platform with visual LiteGraph interface

Project description

CampfireValley

A Python library that extends the Campfires framework by introducing the concept of "valleys" as interconnected, secure communities of campfires. The library manages docks as gateways for inter-valley communication, handles riverboat (torch) exchanges via MCP, and provides default campfires for loading/offloading, security sanitization, and justice enforcement.

๐Ÿš€ Project Status

Phase 2 Implementation: COMPLETED โœ…

CampfireValley is now ~95% complete with comprehensive enterprise-grade features implemented and tested. The system provides a complete distributed torch processing framework.

โœ… Phase 1 Components (Core Infrastructure)

  • ๐Ÿ” Key Manager: Complete AES-256 and RSA key management system
  • ๐Ÿ”„ Redis MCP Broker: Full pub/sub messaging with connection management
  • ๐Ÿ“ฆ Torch Serialization: Enhanced with Redis transport and MCP communication
  • ๐Ÿญ Dockmaster Campfire: Complete with Loader, Router, and Packer campers
  • ๐Ÿ—๏ธ Core Architecture: Interfaces, models, and base classes

โœ… Phase 2 Components (Enterprise Features)

  • ๐Ÿ›ก๏ธ VALI Services: Complete security scanning and validation framework
  • โš–๏ธ Justice System: Advanced policy enforcement and violation handling
  • ๐Ÿ”ง Specialist Campfires: Domain-specific processing units (Sanitizer, Validator, Router)
  • ๐ŸŒ Advanced Routing: Multi-hop routing with load balancing and failover
  • ๐Ÿ“Š Monitoring & Logging: Comprehensive metrics, alerts, and structured logging
  • โš™๏ธ Configuration Management: Multi-environment config with validation and encryption
  • ๐Ÿ’พ Hierarchical Storage: Multi-tier storage with compression and deduplication

๐Ÿ”„ Future Enhancements

  • Web Interface: Management dashboard and monitoring UI
  • Distributed Consensus: Multi-valley coordination protocols
  • Machine Learning: Intelligent routing and threat detection

Features

Core Infrastructure (Phase 1)

  • Valley Management: Self-contained instances hosting multiple campfires
  • Dock Gateways: Secure entry points for inter-valley communication
  • MCP Integration: Redis-based message communication protocol
  • Key Management: AES-256 encryption and RSA digital signatures
  • GitHub Actions-style Configuration: Familiar YAML configuration format

Enterprise Features (Phase 2)

  • ๐Ÿ›ก๏ธ VALI Security Services:
    • Content validation and signature verification
    • Enhanced security scanning with threat detection
    • Service registry and coordination
  • โš–๏ธ Justice System:
    • Policy-based access control and enforcement
    • Violation detection and automated responses
    • Rate limiting and abuse prevention
  • ๐Ÿ”ง Specialist Campfires:
    • Sanitizer: Content cleaning and threat removal
    • Validator: Data integrity and format validation
    • Router: Intelligent routing decisions
  • ๐ŸŒ Advanced Routing:
    • Multi-hop routing with path optimization
    • Smart load balancing algorithms
    • Automatic failover and health checking
  • ๐Ÿ“Š Monitoring & Logging:
    • Real-time metrics collection and alerting
    • Structured logging with multiple handlers
    • Performance monitoring and health checks
  • โš™๏ธ Configuration Management:
    • Multi-environment configuration (dev/prod)
    • Schema validation and encryption
    • Hot-reload and change tracking
  • ๐Ÿ’พ Hierarchical Storage:
    • Multi-tier storage (hot/warm/cold/archive)
    • Data deduplication and compression
    • Intelligent lifecycle management

๐Ÿš€ Getting Started

Quick Start with Docker

  1. Clone and setup:

    git clone https://github.com/MikeHibbert/pyCampfireValley.git
    cd pyCampfireValley
    cp .env.example .env
    # Edit .env with your API keys
    
  2. Start the server:

    docker-compose up --build
    
  3. Access the web interface:

    • Open your browser to: http://localhost:8000
    • View the LiteGraph canvas with campfire nodes
    • Monitor real-time campfire processes

Server Components

The CampfireValley server includes:

  • Web Interface: LiteGraph-based visual campfire management at http://localhost:8000
  • Valley Management: Core campfire orchestration and routing
  • Redis: Inter-campfire communication and caching
  • Monitoring: Real-time metrics and health monitoring

Web UI Highlights

  • Snapshot UX: searchable/clickable snapshot picker (no manual typing) with delete support
  • Chat UX: markdown-rendered chat (code blocks, lists, links) for readable responses
  • Chat TTS: โน๏ธ Stop Audio button to interrupt in-progress text-to-speech
  • Layout: one-click radial auto-arrange (Valley โ†’ Campfires โ†’ Campers) with hex-terminal-aware anchors
  • Auditor:
    • Answers status/settings questions deterministically (no surprise team mutations)
    • Supports reordering workflow steps via natural language (e.g. โ€œmove Intake Camper to first stepโ€ฆโ€)
    • Supports self audit and self audit cid:<correlation_id> to verify that campers ran in order
    • Enforces synthesis in the final step via a required Role Contributions appendix in the final report

Discord Bot (Optional)

The Docker stack includes an optional Discord bot service (campfire-discord-bot) that:

  • Listens in DISCORD_CHANNEL
  • Sends the request to valley:<VALLEY_IDENTIFIER>/<CAMPFIRE_IDENTIFIER>
  • Posts the final report as a reply (chunked into multiple messages when needed)
  • Attaches a full .md report if the output is longer than the configured message limit

๐Ÿ“‹ Valley Configuration with Manifests

CampfireValley uses GitHub Actions-style YAML manifests to configure valleys and their campfires. You can easily change your valley's behavior by supplying different manifest files.

Basic Manifest Structure

Create a manifest.yaml file in your project root:

# Valley Configuration Manifest
name: "MyValley"
version: "1.0"

# Environment settings
env:
  dock_mode: "public"          # public, partial, private
  security_level: "standard"   # basic, standard, high
  auto_create_dock: true

# Define visible and hidden campfires
campfires:
  visible: ["welcome", "helper", "analyzer"]
  hidden: ["internal-audit", "security-scanner"]

# Dock gateway configuration
dock:
  steps:
    - name: "Initialize gateway"
      uses: "dock/gateway@v1"
      with:
        port: 6379
        encryption: true
    - name: "Setup discovery"
      uses: "dock/discovery@v1"
      if: "${{ env.dock_mode == 'public' }}"
      with:
        broadcast_interval: 30

# Community and networking
community:
  discovery: true
  trusted_valleys: ["FriendlyValley", "HelperValley"]

Changing Valley Tasks with Different Manifests

You can completely change your valley's purpose by using different manifest configurations:

1. Development Valley (manifest-dev.yaml)

name: "DevValley"
version: "1.0"
env:
  dock_mode: "private"
  security_level: "basic"
  auto_create_dock: true
campfires:
  visible: ["code-reviewer", "test-runner", "documentation"]
  hidden: ["debug-logger"]
community:
  discovery: false
  trusted_valleys: []

2. Marketing Valley (manifest-marketing.yaml)

name: "MarketingValley"
version: "1.0"
env:
  dock_mode: "public"
  security_level: "standard"
  auto_create_dock: true
campfires:
  visible: ["content-creator", "social-media", "analytics"]
  hidden: ["competitor-analysis"]
community:
  discovery: true
  trusted_valleys: ["ContentValley", "AnalyticsValley"]

3. Security Valley (manifest-security.yaml)

name: "SecurityValley"
version: "1.0"
env:
  dock_mode: "private"
  security_level: "high"
  auto_create_dock: false
campfires:
  visible: ["threat-detector", "vulnerability-scanner"]
  hidden: ["forensics", "incident-response", "audit-logger"]
community:
  discovery: false
  trusted_valleys: []

Using Different Manifests

To switch between different valley configurations:

  1. Method 1: Replace the default manifest

    cp manifest-marketing.yaml manifest.yaml
    docker-compose restart
    
  2. Method 2: Specify manifest path in code

    from campfirevalley import Valley
    
    # Load specific manifest
    valley = Valley("MyValley", manifest_path="./manifest-security.yaml")
    await valley.start()
    

๐Ÿ—ฃ๏ธ Tray Agent Voice UX (PTT, STT, TTS, History)

The Tray Agent provides a streamlined voice interface:

  • Push-to-talk with overlay timer and auto-stop
  • Secure recorder window to ensure navigator.mediaDevices availability
  • Local speech-to-text (Windows SAPI) for accurate transcripts sent to the LLM
  • Text-to-speech of LLM replies with selectable engine:
    • Web Speech (fast)
    • Windows SAPI (sink-aware playback via selected output device)
  • Output device and voice picker with live โ€œVoice โ€ sample
  • Minimal tray menu: Settingsโ€ฆ, Target Campfire, Historyโ€ฆ, Quit
  • History viewer shows recent transcripts and replies

Quickstart:

  1. cd tray-agent && npm run dev
  2. Settingsโ€ฆ โ†’ choose Input/Output devices, voice, and TTS/STT engines
  3. Hold or toggle Alt+Space to speak; release to send
  4. Tray logs show โ€œTranscribed: โ€ฆโ€ and โ€œUpload succeeded. Reply: โ€ฆโ€
  5. Historyโ€ฆ opens the transcript/reply list

Server-side fallback:

  • /api/voice/ingest transcribes audio when text is empty or a placeholder (e.g., โ€œvoice sampleโ€) ensuring audio becomes text before LLM processing.

Team Orchestration API

  • POST /api/team/organize
    • Body: { "base_campfire": "Development Team", "personas": [ { "name": "Planner", "persona": "analytical", "model": "gemma3:4b", "system_prompt": "You plan tasks with care." }, ... ] }
    • Creates LLMCampfires per persona with the provided model and system prompt.
  • POST /api/team/add
    • Body: { "persona": { "name": "Designer", "persona": "empathetic", "model": "gemma3:4b", "system_prompt": "You focus on user experience and clarity." } }
    • Adds a single camper campfire.
  1. Method 3: Environment variable
    export CAMPFIRE_MANIFEST_PATH="./manifest-dev.yaml"
    docker-compose up --build
    

Advanced Configuration

For more complex setups, you can use the full configuration system:

# Advanced manifest with specialist campfires
name: "EnterpriseValley"
version: "2.0"

env:
  dock_mode: "partial"
  security_level: "high"
  auto_create_dock: true
  enable_monitoring: true
  enable_justice: true

# Specialist campfire configurations
campfires:
  visible: ["sanitizer", "validator", "router"]
  hidden: ["justice-enforcer", "metrics-collector"]

# Advanced dock configuration
dock:
  steps:
    - name: "Initialize secure gateway"
      uses: "dock/gateway@v2"
      with:
        port: 6379
        encryption: true
        auth_required: true
    - name: "Setup load balancer"
      uses: "dock/loadbalancer@v1"
      with:
        strategy: "round_robin"
        health_check: true
    - name: "Enable monitoring"
      uses: "dock/monitoring@v1"
      with:
        metrics_endpoint: "/metrics"
        alerts_enabled: true

# Justice system policies
justice:
  policies:
    - name: "rate_limiting"
      max_requests_per_minute: 100
    - name: "content_filtering"
      blocked_patterns: ["spam", "malware"]

community:
  discovery: true
  trusted_valleys: ["SecurityValley", "MonitoringValley"]
  federation_enabled: true

Configuration Validation

CampfireValley automatically validates your manifest files:

from campfirevalley.config import ConfigManager

# Validate manifest before using
try:
    config = ConfigManager.load_valley_config("./my-manifest.yaml")
    print("โœ… Manifest is valid!")
except ValueError as e:
    print(f"โŒ Invalid manifest: {e}")

๐ŸŽฏ Demos & Examples

CampfireValley includes comprehensive demos showcasing real-world AI agent collaboration workflows. These demos demonstrate the complete system capabilities from idea generation to technical implementation.

๐Ÿš€ Marketing Team Demo

The marketing team demo showcases a complete AI-driven workflow where marketing strategists generate innovative ideas and collaborate with development teams to create technical implementations.

Demo Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Marketing      โ”‚    โ”‚   Development    โ”‚    โ”‚   Generated     โ”‚
โ”‚  Strategist     โ”‚โ”€โ”€โ”€โ–ถโ”‚   Team API       โ”‚โ”€โ”€โ”€โ–ถโ”‚   Report        โ”‚
โ”‚  (AI Agent)     โ”‚    โ”‚  (Dockerized)    โ”‚    โ”‚   (JSON/HTML)   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Quick Demo Execution

Option 1: Simplified Demo (Recommended)

# Start Docker containers
docker-compose up -d

# Run the simplified marketing demo
python simple_marketing_demo.py

Option 2: Full Valley Demo

# Start Docker containers
docker-compose up -d

# Run the complete valley demo
python demo_marketing_team.py

Demo Workflow

  1. Idea Generation: Marketing strategist AI generates innovative business ideas
  2. Strategic Analysis: Each idea is analyzed for market potential and feasibility
  3. Development Requests: Ideas are formatted and sent to the development team API
  4. Technical Analysis: Development team provides detailed technical requirements
  5. Report Generation: Complete workflow results are compiled into comprehensive reports

Expected Output

The demo generates:

  • 3 Marketing Ideas: E-commerce Innovation, SaaS Solution, Mobile App Concept
  • Strategic Analysis: Market research, target audience, competitive analysis
  • Technical Requirements: Architecture, features, UX considerations
  • Development Analysis: Detailed technical implementation plans
  • Comprehensive Report: JSON and HTML formats with complete workflow results

Demo Files

  • simple_marketing_demo.py: Streamlined demo bypassing MCP complexities
  • demo_marketing_team.py: Full valley implementation with MCP integration
  • development_team_server.py: Dockerized development team API service
  • docker-compose.yml: Container orchestration for demo services

๐Ÿณ Docker Container Services

The demo utilizes several containerized services:

Service Container Port Purpose
Development Team campfire-development-team 8080 Technical analysis API
Redis MCP Broker campfire-redis 6379 Message communication
Ollama LLM campfire-ollama 11434 Local AI model serving
Prometheus campfire-prometheus 9090 Monitoring and metrics

Container Status Check

# View running containers
docker ps

# Check container logs
docker logs campfire-development-team
docker logs campfire-redis

๐Ÿ”ง Troubleshooting

Common Issues and Solutions

1. MCP Broker Connection Issues

# Symptom: Demo hangs at "Subscribing to MCP channels"
# Solution: Use simplified demo
python simple_marketing_demo.py

2. Docker Container Issues

# Restart all containers
docker-compose down
docker-compose up -d

# Check container health
docker ps

3. Development Team API 404 Errors

# Verify development team container is running
docker logs campfire-development-team

# Check API endpoint
curl http://localhost:8080/api/develop_website

4. Port Conflicts

# Check port usage
netstat -an | findstr :8080
netstat -an | findstr :6379

# Modify ports in docker-compose.yml if needed

Demo Variations

Simplified Workflow (No MCP)

  • Bypasses MCP broker subscription issues
  • Direct API communication
  • Faster execution
  • Recommended for demonstrations

Full Valley Workflow (With MCP)

  • Complete CampfireValley architecture
  • MCP broker integration
  • Inter-valley communication
  • Production-like environment

๐Ÿ“Š Demo Reports

Demo execution generates detailed reports:

JSON Report Structure:

{
  "execution_summary": {
    "ideas_generated": 3,
    "dev_requests_sent": 3,
    "successful_responses": 3,
    "execution_time": "45.2 seconds"
  },
  "marketing_ideas": [...],
  "development_analysis": [...],
  "workflow_metrics": {...}
}

Report Locations:

  • simplified_marketing_report_YYYYMMDD_HHMMSS.json
  • marketing_team_report.html (if HTML generation enabled)

Quick Start

Installation

pip install campfirevalley

Basic Usage

  1. Create a valley configuration:
campfirevalley create-config MyValley --output manifest.yaml
  1. Start a valley:
campfirevalley start MyValley --manifest manifest.yaml
  1. Programmatic usage:
import asyncio
from campfirevalley import Valley

async def main():
    # Create and start a valley
    valley = Valley("MyValley", "./manifest.yaml")
    await valley.start()
    
    # Valley is now running and can communicate with other valleys
    print(f"Valley '{valley.name}' is running")
    
    # Stop the valley
    await valley.stop()

asyncio.run(main())

๐Ÿ—๏ธ Phase 1 Implementation Details

Key Manager (campfirevalley.key_manager)

  • AES-256 Encryption: Secure payload encryption/decryption
  • RSA Digital Signatures: Torch signing and verification
  • Key Rotation: Community-based key management
  • Secure Storage: Encrypted key storage in .secrets/

Redis MCP Broker (campfirevalley.mcp)

  • Pub/Sub Messaging: Redis-based inter-valley communication
  • Connection Management: Robust connection pooling and error handling
  • Message Routing: Channel-based message distribution
  • Async Support: Full asyncio compatibility

Enhanced Torch Model (campfirevalley.models)

  • Redis Serialization: Optimized for Redis transport
  • MCP Envelopes: Structured message format
  • Compression: Automatic compression for large payloads
  • Routing Channels: Smart channel determination

Dockmaster Campfire (campfirevalley.campfires.dockmaster)

  • LoaderCamper: Torch validation and unpacking
  • RouterCamper: Intelligent routing decisions
  • PackerCamper: Transport preparation and packaging
  • Pipeline Processing: Complete torch processing workflow

๐Ÿ—๏ธ Phase 2 Implementation Details

VALI Services (campfirevalley.vali)

  • Service Registry: Centralized service discovery and management
  • Content Validator: Deep content analysis and validation
  • Signature Verifier: Cryptographic signature verification
  • Security Scanner: Advanced threat detection with multiple engines
  • Coordinator: Service orchestration and lifecycle management

Justice System (campfirevalley.justice)

  • Policy Engine: Rule-based access control and enforcement
  • Enforcement Engine: Automated violation response and remediation
  • Violation Detection: Real-time monitoring and threat identification
  • Rate Limiting: Configurable rate limiting and abuse prevention
  • Audit Trail: Complete violation and enforcement logging

Specialist Campfires (campfirevalley.specialist_campfires)

  • SanitizerCampfire: Content sanitization with multiple levels
  • ValidatorCampfire: Data validation with custom rules
  • RouterCampfire: Intelligent routing with strategy selection
  • Configurable Rules: Custom sanitization, validation, and routing rules
  • Pipeline Integration: Seamless integration with torch processing

Advanced Routing (campfirevalley.routing)

  • Route Optimization: Intelligent path selection and optimization
  • Load Balancing: Multiple algorithms (round-robin, weighted, least-connections)
  • Health Checking: Continuous endpoint health monitoring
  • Failover Strategies: Automatic failover with multiple strategies
  • Metrics Collection: Real-time routing performance metrics

Monitoring & Logging (campfirevalley.monitoring)

  • Metrics System: Comprehensive metrics collection and aggregation
  • Alert Management: Configurable alerts with multiple severity levels
  • Structured Logging: JSON-based logging with multiple handlers
  • Performance Monitoring: Real-time performance tracking
  • Health Checking: System-wide health monitoring

Configuration Management (campfirevalley.config_manager)

  • Multi-Environment: Separate configs for development, production, etc.
  • Schema Validation: JSON Schema-based configuration validation
  • Encryption Support: Sensitive configuration data encryption
  • Hot Reload: Runtime configuration updates without restart
  • Change Tracking: Complete configuration change history

Hierarchical Storage (campfirevalley.hierarchical_storage)

  • Multi-Tier Storage: Hot, warm, cold, and archive tiers
  • Data Lifecycle: Intelligent data movement between tiers
  • Deduplication: Content-based deduplication to save space
  • Compression: Configurable compression algorithms
  • Storage Optimization: Automated storage optimization and cleanup

Usage Example

import asyncio
from campfirevalley import Valley, CampfireKeyManager, RedisMCPBroker
from campfirevalley.campfires import DockmasterCampfire
from campfirevalley.models import Torch

async def main():
    # Initialize components
    key_manager = CampfireKeyManager("MyValley")
    mcp_broker = RedisMCPBroker("redis://localhost:6379")
    dockmaster = DockmasterCampfire(mcp_broker)
    
    # Start services
    await mcp_broker.connect()
    await dockmaster.start()
    
    # Create and process a torch
    torch = Torch(
        id="example_001",
        sender_valley="MyValley",
        target_address="TargetValley:dockmaster/loader",
        payload={"message": "Hello from CampfireValley!"},
        signature="example_signature"
    )
    
    # Process through Dockmaster pipeline
    response = await dockmaster.process_torch(torch)
    print(f"Processed torch: {response}")
    
    # Cleanup
    await dockmaster.stop()
    await mcp_broker.disconnect()

asyncio.run(main())

๐Ÿ”ง Configuration-Driven Architecture

CampfireValley implements a comprehensive configuration-driven approach that enables flexible, maintainable, and environment-specific deployments without code changes.

Core Configuration Philosophy

The system follows these key principles:

  • Declarative Configuration: Define what you want, not how to achieve it
  • Environment Separation: Clean separation between dev, staging, and production
  • Schema Validation: All configurations are validated against JSON schemas
  • Hot Reload: Runtime configuration updates without service restart
  • Encryption Support: Sensitive data is automatically encrypted

Gateway CLI

CampfireValley ships with a gateway CLI that mirrors an OpenClaw-like workflow:

  • Initialize a project:
    • campfirevalley onboard MyValley
      • Creates config/ with default.yaml and environment files
      • Creates manifest.yaml if missing
      • Sets up .secrets/ for local allowlists and keys
  • Validate configuration:
    • campfirevalley validate-config ./manifest.yaml
  • Run the gateway (foreground):
    • campfirevalley start MyValley --manifest ./manifest.yaml
  • Run with PID tracking and status checks:
    • campfirevalley daemon run MyValley --manifest ./manifest.yaml
    • campfirevalley daemon status MyValley

The daemon run command keeps a PID file in .campfirevalley/<valley>.pid for simple status checks. On Windows this runs in the foreground; service installation is intentionally left to external supervisors.

Voice Ingestion (Interactive Pathway)

Send speech-to-text results into running campfires for interactive dialogue and admin control:

  • HTTP endpoint
    • POST /api/voice/ingest
    • Body:
      • text: transcribed text
      • campfire (optional): target campfire name (defaults to first available)
      • admin_token (optional): required for admin-only intents
  • Admin token
    • Place a token in .secrets/admin_token or set CAMPFIRE_ADMIN_TOKEN
  • Examples
    • Route inline: {"text": "send to assistant: summarize the notes"}
    • Explicit target: {"text": "please reindex project docs", "campfire": "assistant"}
    • Admin: {"text": "update rag path /docs/new", "campfire": "assistant", "admin_token": "..." }

This endpoint accepts transcribed text from any STT system (local or external). Future adapters can integrate directly with providers.

Web UI Features

The LiteGraph web UI (http://localhost:8000) includes a chat panel per node with a small action bar:

  • ๐Ÿงฐ Tools panel
    • Toggle Zeitgeist features per campfire/camper:
      • Enable Zeitgeist
      • Web Search (injects web results + excerpts into the prompt)
      • Image OCR (uses an Ollama multimodal model to extract text from image URLs)
    • Select Ollama model (per campfire/camper):
      • The UI queries Ollama for available models and lets you choose one
      • This selection is persisted in the campfire config YAML and used for future requests
  • ๐Ÿ”’ Freeze Beliefs
    • Extracts compact โ€œbeliefโ€ statements from the nodeโ€™s chat history and stores them in the embeddings database
    • Beliefs are injected back into future prompts as a short โ€œYou rememberโ€ฆโ€ prefix
  • ๐Ÿ“œ Logs
    • Shows the persisted JSONL log for the selected campfire/camper
  • โฌ‡ Export
    • Exports the selected campfire (config + logs + beliefs) as YAML
  • ๐Ÿ“ฅ Import Campfire
    • Imports a previously exported campfire YAML into the running valley
  • ๐Ÿ’พ Save Valley / ๐Ÿ“ Load Valley
    • Saves and restores a snapshot containing the full node graph plus campfire configurations

API Notes

  • List Ollama models:
    • GET /api/ollama/models
  • Set per-campfire LLM model:
    • POST /api/campfire/llm body: { "campfire": "Name", "provider": "ollama", "model": "llama3.2:latest" }
  • Freeze beliefs:
    • POST /api/beliefs/freeze

Local Parakeet STT (Default Fallback)

By default, Campfire Valley uses a local Parakeet STT engine as the fallback:

  • Config (config/default.yaml):
  • POST body options:
    • Provide text directly, or
    • Provide audio_base64 (WAV/MP3 bytes) or audio_url
  • Expected Parakeet server contract:
    • POST to /transcribe with { "audio_base64": "...", "audio_url": "..." }
    • Returns { "text": "transcript" }

You can point the endpoint to your local Parakeet HTTP bridge, or swap engines later without changing clients.

Configuration Hierarchy

CampfireValley uses a multi-layered configuration system:

  1. Base Configuration: Core system defaults
  2. Environment Configuration: Environment-specific overrides (dev/prod)
  3. Valley Configuration: Valley-specific settings
  4. Runtime Configuration: Dynamic updates during operation

GitHub Actions-Style YAML Format

CampfireValley uses familiar GitHub Actions-style YAML configuration:

name: "MyValley"
version: "1.0"

env:
  dock_mode: "public"
  security_level: "standard"
  auto_create_dock: true

campfires:
  visible: ["helper", "processor"]
  hidden: ["internal"]

community:
  discovery: true
  trusted_valleys: ["FriendValley"]

# Advanced configuration sections
security:
  vali:
    enabled: true
    scan_level: "comprehensive"
    threat_detection: true
  
  justice:
    enabled: true
    policy_enforcement: "strict"
    rate_limiting:
      requests_per_minute: 100
      burst_limit: 20

routing:
  strategy: "intelligent"
  load_balancing: "weighted_round_robin"
  health_checks:
    enabled: true
    interval: 30
    timeout: 5

storage:
  hierarchical:
    enabled: true
    tiers:
      hot: { retention: "7d", compression: false }
      warm: { retention: "30d", compression: "lz4" }
      cold: { retention: "1y", compression: "gzip" }
      archive: { retention: "7y", compression: "bzip2" }

monitoring:
  metrics:
    enabled: true
    collection_interval: 10
  
  logging:
    level: "INFO"
    format: "json"
    handlers: ["console", "file", "redis"]
  
  alerts:
    enabled: true
    channels: ["email", "slack"]

Environment-Specific Configuration

Create separate configuration files for different environments:

config/dev.yaml:

extends: "base.yaml"

env:
  security_level: "development"
  debug: true

monitoring:
  logging:
    level: "DEBUG"

security:
  vali:
    scan_level: "basic"

config/prod.yaml:

extends: "base.yaml"

env:
  security_level: "maximum"
  debug: false

security:
  vali:
    scan_level: "comprehensive"
    threat_detection: true
  
  justice:
    policy_enforcement: "strict"

monitoring:
  alerts:
    enabled: true
    severity_threshold: "warning"

Configuration Management Features

1. Schema Validation

All configurations are validated against JSON schemas:

from campfirevalley.config_manager import ConfigManager

# Load and validate configuration
config_manager = ConfigManager()
config = config_manager.load_config("config/prod.yaml")
# Automatically validates against schema

2. Encryption Support

Sensitive configuration data is automatically encrypted:

database:
  host: "db.example.com"
  username: "admin"
  password: "!encrypted:AES256:base64encodeddata"  # Auto-encrypted

3. Hot Reload

Update configurations without restarting services:

# Configuration changes are automatically detected and applied
config_manager.watch_for_changes()

4. Environment Variables

Override any configuration value with environment variables:

export CAMPFIREVALLEY_SECURITY_LEVEL="maximum"
export CAMPFIREVALLEY_MONITORING_LOGGING_LEVEL="ERROR"

Configuration Sections Reference

Core Settings

  • name: Valley identifier
  • version: Configuration version
  • env: Environment variables and basic settings

Security Configuration

  • security.vali: VALI security services settings
  • security.justice: Justice system and policy enforcement
  • security.encryption: Encryption and key management

Routing Configuration

  • routing.strategy: Routing algorithm selection
  • routing.load_balancing: Load balancing configuration
  • routing.health_checks: Health monitoring settings

Storage Configuration

  • storage.hierarchical: Multi-tier storage settings
  • storage.compression: Compression algorithms
  • storage.retention: Data retention policies

Monitoring Configuration

  • monitoring.metrics: Metrics collection settings
  • monitoring.logging: Logging configuration
  • monitoring.alerts: Alert management

Best Practices

  1. Use Environment Inheritance: Extend base configurations for environments
  2. Validate Early: Always validate configurations during startup
  3. Encrypt Secrets: Use the built-in encryption for sensitive data
  4. Monitor Changes: Enable configuration change tracking
  5. Test Configurations: Validate configurations in CI/CD pipelines

Configuration Examples

See the examples/ directory for complete configuration examples:

  • examples/basic_valley.yaml: Simple valley setup
  • examples/enterprise_valley.yaml: Full enterprise configuration
  • examples/development.yaml: Development environment setup
  • examples/production.yaml: Production-ready configuration

Architecture

  • Valley: Main container managing campfires and infrastructure
  • Dock: Gateway for inter-valley communication
  • Campfire: Individual AI agent containers
  • Torch: Message format for inter-valley communication
  • Party Box: Storage system for attachments and payloads
  • MCP Broker: Redis-based message routing

Development

Requirements

  • Python 3.8+
  • Redis server (for MCP broker)
  • PyYAML, Pydantic, cryptography

Running Tests

pip install -e ".[dev]"
pytest

Additional Documentation

Support

If you encounter issues:

  1. Check the Troubleshooting Guide for common problems
  2. Review the Demo Guide for step-by-step execution instructions
  3. Use the simplified demo (simple_marketing_demo.py) to bypass MCP broker issues
  4. Check Docker container logs: docker-compose logs [service-name]

License

MIT License - see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

campfirevalley-1.2.2.tar.gz (479.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

campfirevalley-1.2.2-py3-none-any.whl (464.1 kB view details)

Uploaded Python 3

File details

Details for the file campfirevalley-1.2.2.tar.gz.

File metadata

  • Download URL: campfirevalley-1.2.2.tar.gz
  • Upload date:
  • Size: 479.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.8

File hashes

Hashes for campfirevalley-1.2.2.tar.gz
Algorithm Hash digest
SHA256 ff22ef3170206c132193bb4db47fa60e6c1cd2c56559451dd8849d7bac691e80
MD5 14c0059dc5fde7e021623e7419e285e5
BLAKE2b-256 07f4083dfc2c9e192fe8c0a6aed11ef1da230e5ec03c874e9575d16986ec15d1

See more details on using hashes here.

File details

Details for the file campfirevalley-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: campfirevalley-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 464.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.8

File hashes

Hashes for campfirevalley-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8c3742e5ce84830adfd6a8492740af24bcdd3c2b7e915808da8494846abdf26c
MD5 b61d2523568ae5c4a21380839408a881
BLAKE2b-256 3932bd3702c61f9ba9d5045fb114be6526836b6b569a44b599db3dcabf647b39

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page