agent99 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/A2A_SPEC-dev.md +1829 -0
  3. data/CHANGELOG.md +31 -0
  4. data/COMMITS.md +196 -0
  5. data/DOCS.md +96 -0
  6. data/README.md +200 -78
  7. data/Rakefile +62 -0
  8. data/docs/AI/htm.md +215 -0
  9. data/docs/AI/htm.rb +141 -0
  10. data/docs/AI/htm_demo.db +0 -0
  11. data/docs/AI/notes_on_htm_implementation.md +1319 -0
  12. data/docs/AI/some_code.rb +692 -0
  13. data/docs/advanced-topics/a2a-protocol.md +13 -0
  14. data/docs/{control_actions.md → advanced-topics/control-actions.md} +2 -0
  15. data/docs/advanced-topics/model-context-protocol.md +4 -0
  16. data/docs/advanced-topics/multi-agent-processing.md +674 -0
  17. data/docs/agent-development/request-response-handling.md +512 -0
  18. data/docs/api-reference/agent99-base.md +463 -0
  19. data/docs/api-reference/message-clients.md +495 -0
  20. data/docs/api-reference/registry-client.md +470 -0
  21. data/docs/api-reference/schemas.md +518 -0
  22. data/docs/assets/css/custom.css +27 -0
  23. data/docs/assets/images/agent-lifecycle.svg +73 -0
  24. data/docs/assets/images/agent-registry-process.svg +86 -0
  25. data/docs/assets/images/agent-registry-processes.svg +114 -0
  26. data/docs/assets/images/agent-types-overview.svg +51 -0
  27. data/docs/assets/images/agent99-architecture.svg +85 -0
  28. data/docs/assets/images/agent99_logo.png +0 -0
  29. data/docs/assets/images/control-actions-state.svg +83 -0
  30. data/docs/assets/images/knowledge-graph.svg +77 -0
  31. data/docs/assets/images/message-processing-flow.svg +148 -0
  32. data/docs/assets/images/multi-agent-system.svg +66 -0
  33. data/docs/assets/images/proxy-pattern-sequence.svg +48 -0
  34. data/docs/assets/images/request-flow.svg +97 -0
  35. data/docs/assets/images/request-processing-lifecycle.svg +50 -0
  36. data/docs/assets/images/request-response-sequence.svg +39 -0
  37. data/docs/{agent_lifecycle.md → core-concepts/agent-lifecycle.md} +2 -0
  38. data/docs/core-concepts/agent-types.md +255 -0
  39. data/docs/{architecture.md → core-concepts/architecture.md} +5 -5
  40. data/docs/{what_is_an_agent.md → core-concepts/what-is-an-agent.md} +1 -1
  41. data/docs/diagrams/message-flow-sequence.svg +198 -0
  42. data/docs/diagrams/p2p-network-topology.svg +181 -0
  43. data/docs/diagrams/smart-transport-routing.svg +165 -0
  44. data/docs/diagrams/three-layer-architecture.svg +77 -0
  45. data/docs/diagrams/transport-extension-api.svg +309 -0
  46. data/docs/diagrams/transport-extension-architecture.svg +234 -0
  47. data/docs/diagrams/transport-selection-flowchart.svg +264 -0
  48. data/docs/examples/advanced-examples.md +951 -0
  49. data/docs/examples/basic-examples.md +268 -0
  50. data/docs/{agent_registry_processes.md → framework-components/agent-registry.md} +1 -1
  51. data/docs/{message_processing.md → framework-components/message-processing.md} +3 -1
  52. data/docs/getting-started/basic-example.md +306 -0
  53. data/docs/getting-started/installation.md +160 -0
  54. data/docs/getting-started/overview.md +64 -0
  55. data/docs/getting-started/quick-start.md +179 -0
  56. data/docs/index.md +97 -0
  57. data/examples/DEMO.md +148 -0
  58. data/examples/README.md +50 -0
  59. data/examples/bad_agent.rb +32 -0
  60. data/examples/registry.rb +0 -8
  61. data/examples/run_demo.rb +433 -0
  62. data/lib/agent99/amqp_message_client.rb +2 -2
  63. data/lib/agent99/base.rb +1 -1
  64. data/lib/agent99/message_processing.rb +6 -12
  65. data/lib/agent99/registry_client.rb +4 -1
  66. data/lib/agent99/version.rb +1 -1
  67. data/lib/agent99.rb +1 -1
  68. data/mkdocs.yml +195 -0
  69. data/p2p_plan.md +533 -0
  70. data/p2p_roadmap.md +299 -0
  71. data/registry_plan.md +1818 -0
  72. metadata +89 -32
  73. data/docs/README.md +0 -57
  74. data/docs/diagrams/agent_registry_processes.dot +0 -42
  75. data/docs/diagrams/agent_registry_processes.png +0 -0
  76. data/docs/diagrams/high_level_architecture.dot +0 -26
  77. data/docs/diagrams/high_level_architecture.png +0 -0
  78. data/docs/diagrams/request_flow.dot +0 -42
  79. data/docs/diagrams/request_flow.png +0 -0
  80. /data/docs/{advanced_features.md → advanced-topics/advanced-features.md} +0 -0
  81. /data/docs/{extending_the_framework.md → advanced-topics/extending-the-framework.md} +0 -0
  82. /data/docs/{custom_agent_implementation.md → agent-development/custom-agent-implementation.md} +0 -0
  83. /data/docs/{error_handling_and_logging.md → agent-development/error-handling-and-logging.md} +0 -0
  84. /data/docs/{schema_definition.md → agent-development/schema-definition.md} +0 -0
  85. /data/docs/{api_reference.md → api-reference/overview.md} +0 -0
  86. /data/docs/{agent_discovery.md → framework-components/agent-discovery.md} +0 -0
  87. /data/docs/{messaging_system.md → framework-components/messaging-system.md} +0 -0
  88. /data/docs/{breaking_change_v0.0.4.md → operations/breaking-changes.md} +0 -0
  89. /data/docs/{configuration.md → operations/configuration.md} +0 -0
  90. /data/docs/{preformance_considerations.md → operations/performance-considerations.md} +0 -0
  91. /data/docs/{security.md → operations/security.md} +0 -0
  92. /data/docs/{troubleshooting.md → operations/troubleshooting.md} +0 -0
@@ -0,0 +1,160 @@
1
+ # Installation
2
+
3
+ This guide will help you install Agent99 and set up your development environment.
4
+
5
+ ## Prerequisites
6
+
7
+ Agent99 requires **Ruby 3.3.0** or higher.
8
+
9
+ Check your Ruby version:
10
+
11
+ ```bash
12
+ ruby --version
13
+ ```
14
+
15
+ If you need to install or upgrade Ruby, we recommend using [rbenv](https://github.com/rbenv/rbenv) or [RVM](https://rvm.io/).
16
+
17
+ ## Install the Gem
18
+
19
+ ### From RubyGems
20
+
21
+ ```bash
22
+ gem install agent99
23
+ ```
24
+
25
+ ### From Bundler
26
+
27
+ Add this line to your application's Gemfile:
28
+
29
+ ```ruby
30
+ gem 'agent99'
31
+ ```
32
+
33
+ And then execute:
34
+
35
+ ```bash
36
+ bundle install
37
+ ```
38
+
39
+ ### From Source
40
+
41
+ Clone the repository and install:
42
+
43
+ ```bash
44
+ git clone https://github.com/MadBomber/agent99.git
45
+ cd agent99
46
+ bundle install
47
+ ```
48
+
49
+ ## Dependencies
50
+
51
+ Agent99 automatically installs the following dependencies:
52
+
53
+ - **bunny** - AMQP messaging client
54
+ - **nats-pure** - NATS messaging client
55
+ - **simple_json_schema_builder** - JSON schema validation
56
+ - **sinatra** - For the registry service
57
+
58
+ ## Message Broker Setup
59
+
60
+ Agent99 supports multiple messaging backends. Choose one:
61
+
62
+ ### Option 1: NATS (Recommended for Development)
63
+
64
+ Install NATS server:
65
+
66
+ ```bash
67
+ # macOS
68
+ brew install nats-server
69
+
70
+ # Ubuntu/Debian
71
+ apt-get install nats-server
72
+
73
+ # Or download from https://nats.io/download/
74
+ ```
75
+
76
+ Start NATS server:
77
+
78
+ ```bash
79
+ nats-server
80
+ ```
81
+
82
+ ### Option 2: RabbitMQ (AMQP)
83
+
84
+ Install RabbitMQ:
85
+
86
+ ```bash
87
+ # macOS
88
+ brew install rabbitmq
89
+
90
+ # Ubuntu/Debian
91
+ apt-get install rabbitmq-server
92
+
93
+ # Or download from https://www.rabbitmq.com/download.html
94
+ ```
95
+
96
+ Start RabbitMQ:
97
+
98
+ ```bash
99
+ # macOS
100
+ brew services start rabbitmq
101
+
102
+ # Ubuntu/Debian
103
+ systemctl start rabbitmq-server
104
+ ```
105
+
106
+ ## Registry Service
107
+
108
+ Agent99 uses a central registry for agent discovery. You can use the example registry or create your own.
109
+
110
+ Start the example registry:
111
+
112
+ ```bash
113
+ # From the agent99 source directory
114
+ ruby examples/registry.rb
115
+ ```
116
+
117
+ The registry will start on http://localhost:4567 by default.
118
+
119
+ ## Environment Variables
120
+
121
+ Configure Agent99 using environment variables:
122
+
123
+ ```bash
124
+ # Registry URL (default: http://localhost:4567)
125
+ export AGENT99_REGISTRY_URL=http://localhost:4567
126
+
127
+ # Message broker settings (see messaging documentation)
128
+ export RABBITMQ_URL=amqp://localhost
129
+ export NATS_URL=nats://localhost:4222
130
+ ```
131
+
132
+ ## Verification
133
+
134
+ Verify your installation by running a simple test:
135
+
136
+ ```ruby
137
+ require 'agent99'
138
+ puts "Agent99 version: #{Agent99.version}"
139
+ ```
140
+
141
+ ## Development Dependencies
142
+
143
+ If you're contributing to Agent99, install development dependencies:
144
+
145
+ ```bash
146
+ bundle install --with development
147
+ ```
148
+
149
+ This includes:
150
+ - **amazing_print** - Pretty printing
151
+ - **debug_me** - Debugging utilities
152
+ - **hashdiff** - Hash comparison
153
+ - **mocha** - Testing framework
154
+ - **tocer** - Documentation generation
155
+
156
+ ## Next Steps
157
+
158
+ - [Quick Start](quick-start.md) - Build your first agent
159
+ - [Basic Example](basic-example.md) - Detailed walkthrough
160
+ - [Configuration](../operations/configuration.md) - Advanced setup options
@@ -0,0 +1,64 @@
1
+ # Agent99 Framework Overview
2
+
3
+ Agent99 is a Ruby framework for building distributed AI agents with peer-to-peer messaging capabilities. It provides a robust foundation for creating intelligent agents that can communicate, discover each other, and perform various tasks in a microservices architecture.
4
+
5
+ ## Current Status
6
+
7
+ **Version**: 0.0.4 (Under Development)
8
+
9
+ !!! warning "Development Status"
10
+ Agent99 is currently under active development. The initial release has no AI components - it's a generic client-server / request-response microservices system using peer-to-peer messaging brokers and a centralized agent registry.
11
+
12
+ ## Key Features
13
+
14
+ - **Agent Types**: Support for Server (responds to requests), Client (makes requests), and Hybrid (both) agents
15
+ - **Messaging**: Multiple messaging backends including AMQP (via Bunny) and NATS
16
+ - **Agent Discovery**: Central registry for finding agents by capabilities
17
+ - **Lifecycle Management**: Complete agent registration, message processing, and control actions
18
+ - **Dynamic Loading**: Runtime agent deployment via AgentWatcher
19
+ - **Multi-threading**: Run multiple agents in the same process with thread isolation
20
+
21
+ ## Architecture Highlights
22
+
23
+ - **Modular Design**: Built with mixins for HeaderManagement, AgentDiscovery, ControlActions, AgentLifecycle, and MessageProcessing
24
+ - **Multiple Message Clients**: AMQP, NATS, and TCP implementations
25
+ - **HTTP Registry**: Simple HTTP-based service for agent discovery (default: localhost:4567)
26
+ - **Schema Validation**: JSON schema validation for requests and responses
27
+
28
+ ## Future Vision
29
+
30
+ The framework is designed with AI integration in mind, referencing protocols like:
31
+ - **Agent2Agent (A2A)**: Now under the Linux Foundation
32
+ - **Model Context Protocol**: For AI model integration
33
+
34
+ ## Quick Example
35
+
36
+ ```ruby
37
+ require 'agent99'
38
+
39
+ class GreeterAgent < Agent99::Base
40
+ def info
41
+ {
42
+ name: self.class.to_s,
43
+ type: :server,
44
+ capabilities: ['greeter', 'hello_world']
45
+ }
46
+ end
47
+
48
+ def process_request(payload)
49
+ name = payload.dig(:name)
50
+ response = { result: "Hello, #{name}!" }
51
+ send_response(response)
52
+ end
53
+ end
54
+
55
+ # Create and run the agent
56
+ agent = GreeterAgent.new
57
+ agent.run
58
+ ```
59
+
60
+ ## Next Steps
61
+
62
+ - [Installation](installation.md) - Get Agent99 installed
63
+ - [Quick Start](quick-start.md) - Build your first agent
64
+ - [Basic Example](basic-example.md) - Detailed walkthrough
@@ -0,0 +1,179 @@
1
+ # Quick Start
2
+
3
+ Get up and running with Agent99 in just a few minutes! This guide assumes you have Ruby 3.3.0+ installed.
4
+
5
+ ## Step 1: Install Agent99
6
+
7
+ ```bash
8
+ gem install agent99
9
+ ```
10
+
11
+ ## Step 2: Start a Message Broker
12
+
13
+ Agent99 needs a message broker for agent communication. Choose one:
14
+
15
+ === "NATS (Recommended)"
16
+ ```bash
17
+ # Install NATS server
18
+ brew install nats-server # macOS
19
+ # OR download from https://nats.io/download/
20
+
21
+ # Start NATS
22
+ nats-server
23
+ ```
24
+
25
+ === "RabbitMQ"
26
+ ```bash
27
+ # Install RabbitMQ
28
+ brew install rabbitmq # macOS
29
+
30
+ # Start RabbitMQ
31
+ brew services start rabbitmq
32
+ ```
33
+
34
+ ## Step 3: Start the Registry
35
+
36
+ The registry helps agents discover each other:
37
+
38
+ ```bash
39
+ # Clone the repository for examples
40
+ git clone https://github.com/MadBomber/agent99.git
41
+ cd agent99
42
+
43
+ # Start the registry
44
+ ruby examples/registry.rb
45
+ ```
46
+
47
+ ## Step 4: Create Your First Agent
48
+
49
+ Create a file called `my_first_agent.rb`:
50
+
51
+ ```ruby
52
+ require 'agent99'
53
+
54
+ class MyFirstAgent < Agent99::Base
55
+ def info
56
+ {
57
+ name: self.class.to_s,
58
+ type: :server,
59
+ capabilities: ['greeting', 'hello']
60
+ }
61
+ end
62
+
63
+ def process_request(payload)
64
+ name = payload.dig(:name) || "World"
65
+ logger.info "Processing greeting request for: #{name}"
66
+
67
+ response = {
68
+ message: "Hello, #{name}! Welcome to Agent99!",
69
+ timestamp: Time.now.iso8601
70
+ }
71
+
72
+ send_response(response)
73
+ end
74
+ end
75
+
76
+ # Run the agent
77
+ if __FILE__ == $0
78
+ puts "🤖 Starting My First Agent..."
79
+ agent = MyFirstAgent.new
80
+ agent.run
81
+ end
82
+ ```
83
+
84
+ ## Step 5: Run Your Agent
85
+
86
+ ```bash
87
+ ruby my_first_agent.rb
88
+ ```
89
+
90
+ You should see output like:
91
+ ```
92
+ 🤖 Starting My First Agent...
93
+ INFO -- Agent MyFirstAgent registered successfully
94
+ INFO -- Agent listening for messages...
95
+ ```
96
+
97
+ ## Step 6: Test Your Agent
98
+
99
+ Create a simple client to test your agent (`test_client.rb`):
100
+
101
+ ```ruby
102
+ require 'agent99'
103
+
104
+ class TestClient < Agent99::Base
105
+ def info
106
+ {
107
+ name: self.class.to_s,
108
+ type: :client,
109
+ capabilities: ['testing']
110
+ }
111
+ end
112
+
113
+ def test_greeting
114
+ # Discover greeting agents
115
+ agents = discover_agents(['greeting'])
116
+
117
+ if agents.any?
118
+ target_agent = agents.first
119
+ puts "📡 Found agent: #{target_agent[:name]}"
120
+
121
+ # Send a request
122
+ request = { name: "Agent99 User" }
123
+ response = send_request(target_agent[:name], request)
124
+
125
+ puts "✅ Response: #{response[:message]}"
126
+ else
127
+ puts "❌ No greeting agents found"
128
+ end
129
+ end
130
+ end
131
+
132
+ # Run the test
133
+ if __FILE__ == $0
134
+ client = TestClient.new
135
+ client.test_greeting
136
+ end
137
+ ```
138
+
139
+ Run the test client:
140
+ ```bash
141
+ ruby test_client.rb
142
+ ```
143
+
144
+ Expected output:
145
+ ```
146
+ 📡 Found agent: MyFirstAgent
147
+ ✅ Response: Hello, Agent99 User! Welcome to Agent99!
148
+ ```
149
+
150
+ ## 🎉 Success!
151
+
152
+ You've successfully:
153
+
154
+ - ✅ Installed Agent99
155
+ - ✅ Started a message broker and registry
156
+ - ✅ Created and ran your first agent
157
+ - ✅ Tested agent communication
158
+
159
+ ## What's Next?
160
+
161
+ - **[Basic Example](basic-example.md)** - More detailed walkthrough
162
+ - **[Core Concepts](../core-concepts/what-is-an-agent.md)** - Understand how agents work
163
+ - **[Examples](../examples/basic-examples.md)** - More agent patterns
164
+ - **[Agent Development](../agent-development/custom-agent-implementation.md)** - Build complex agents
165
+
166
+ ## Troubleshooting
167
+
168
+ **Agent not starting?**
169
+ - Make sure NATS or RabbitMQ is running
170
+ - Check that Ruby 3.3.0+ is installed: `ruby --version`
171
+ - Verify the registry is running on port 4567
172
+
173
+ **Can't find agents?**
174
+ - Ensure all components (registry, broker, agents) are running
175
+ - Check that agents are registering: visit http://localhost:4567/agents
176
+
177
+ **Need help?**
178
+ - Check the [Troubleshooting Guide](../operations/troubleshooting.md)
179
+ - Visit the [GitHub repository](https://github.com/MadBomber/agent99) for issues and discussions
data/docs/index.md ADDED
@@ -0,0 +1,97 @@
1
+ # Agent99 Framework Documentation
2
+
3
+ Welcome to the comprehensive documentation for Agent99 - a Ruby framework for building distributed AI agents with peer-to-peer messaging capabilities.
4
+
5
+ ## 🚀 Getting Started
6
+
7
+ New to Agent99? Start here to get up and running quickly:
8
+
9
+ - **[Overview](getting-started/overview.md)** - What is Agent99 and what can it do?
10
+ - **[Installation](getting-started/installation.md)** - Get Agent99 installed and configured
11
+ - **[Quick Start](getting-started/quick-start.md)** - Build your first agent in minutes
12
+ - **[Basic Example](getting-started/basic-example.md)** - Detailed walkthrough of a complete system
13
+
14
+ ## 🧠 Core Concepts
15
+
16
+ Understand the fundamental concepts behind Agent99:
17
+
18
+ - **[What is an Agent?](core-concepts/what-is-an-agent.md)** - Basic agent concepts and philosophy
19
+ - **[Agent Types](core-concepts/agent-types.md)** - Server, Client, and Hybrid agents explained
20
+ - **[Agent Lifecycle](core-concepts/agent-lifecycle.md)** - How agents start, run, and stop
21
+ - **[Architecture Overview](core-concepts/architecture.md)** - System design and component interaction
22
+
23
+ ## 🔧 Framework Components
24
+
25
+ Deep dive into the Agent99 system components:
26
+
27
+ - **[Agent Registry](framework-components/agent-registry.md)** - Central agent discovery service
28
+ - **[Agent Discovery](framework-components/agent-discovery.md)** - How agents find each other
29
+ - **[Messaging System](framework-components/messaging-system.md)** - AMQP, NATS, and TCP messaging
30
+ - **[Message Processing](framework-components/message-processing.md)** - Request/response handling
31
+
32
+ ## 💻 Agent Development
33
+
34
+ Build your own agents with these guides:
35
+
36
+ - **[Custom Agent Implementation](agent-development/custom-agent-implementation.md)** - Create custom agents
37
+ - **[Schema Definition](agent-development/schema-definition.md)** - Request/response validation
38
+ - **[Request & Response Handling](agent-development/request-response-handling.md)** - Message processing patterns
39
+ - **[Error Handling & Logging](agent-development/error-handling-and-logging.md)** - Robust error strategies
40
+
41
+ ## 🎯 Advanced Topics
42
+
43
+ Advanced features and integration patterns:
44
+
45
+ - **[Control Actions](advanced-topics/control-actions.md)** - Agent control and management
46
+ - **[Advanced Features](advanced-topics/advanced-features.md)** - Dynamic loading and multi-agent processing
47
+ - **[A2A Protocol](advanced-topics/a2a-protocol.md)** - Agent-to-Agent communication protocol
48
+ - **[Model Context Protocol](advanced-topics/model-context-protocol.md)** - AI model integration
49
+ - **[Extending the Framework](advanced-topics/extending-the-framework.md)** - Custom modules and extensions
50
+
51
+ ## 📚 API Reference
52
+
53
+ Detailed API documentation:
54
+
55
+ - **[Agent99::Base](api-reference/agent99-base.md)** - Core agent class reference
56
+ - **[Registry Client](api-reference/registry-client.md)** - Registry service API
57
+ - **[Message Clients](api-reference/message-clients.md)** - Messaging client APIs
58
+ - **[Schemas](api-reference/schemas.md)** - Schema validation system
59
+
60
+ ## ⚙️ Operations
61
+
62
+ Deploy and maintain Agent99 in production:
63
+
64
+ - **[Configuration](operations/configuration.md)** - Environment and runtime configuration
65
+ - **[Security](operations/security.md)** - Security best practices and implementation
66
+ - **[Performance Considerations](operations/performance-considerations.md)** - Optimization and scaling
67
+ - **[Troubleshooting](operations/troubleshooting.md)** - Common issues and solutions
68
+ - **[Breaking Changes](operations/breaking-changes.md)** - Version upgrade guide
69
+
70
+ ## 💡 Examples
71
+
72
+ Working examples and tutorials:
73
+
74
+ - **[Basic Examples](examples/basic-examples.md)** - Simple agent patterns and use cases
75
+ - **[Advanced Examples](examples/advanced-examples.md)** - Complex multi-agent scenarios
76
+
77
+ ## 🔄 Recent Updates
78
+
79
+ ### 2024-12-12 - Version 0.0.4 Release
80
+ - Breaking changes in agent registration and discovery
81
+ - Improved message processing performance
82
+ - Enhanced error handling and logging
83
+
84
+ ### 2025-04-09 - A2A Protocol Integration
85
+ Google announced its Agent-to-Agent public protocol called A2A. Agent99 is designed to integrate with this protocol. For additional information see [A2A Protocol Documentation](advanced-topics/a2a-protocol.md).
86
+
87
+ ## 🤝 Contributing
88
+
89
+ Agent99 is an open-source project and welcomes contributions:
90
+
91
+ - **GitHub Repository**: [https://github.com/MadBomber/agent99](https://github.com/MadBomber/agent99)
92
+ - **RubyGems Package**: [https://rubygems.org/gems/agent99](https://rubygems.org/gems/agent99)
93
+ - **Issue Tracker**: Report bugs and request features on GitHub
94
+
95
+ ---
96
+
97
+ *Ready to build distributed agent systems? Start with the [Getting Started](getting-started/overview.md) guide!*
data/examples/DEMO.md ADDED
@@ -0,0 +1,148 @@
1
+ # Agent99 Demo Runner
2
+
3
+ This is a comprehensive demo script that allows you to easily run and explore Agent99 framework examples.
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ # List available demo scenarios
9
+ ./run_demo.rb --list
10
+
11
+ # Run the basic demo (Maxwell Agent86 + Chief interaction)
12
+ ./run_demo.rb
13
+
14
+ # Run with verbose output to see what's happening
15
+ ./run_demo.rb -v -s basic
16
+ ```
17
+
18
+ ## Features
19
+
20
+ - 🏗️ **Automatic Infrastructure**: Starts registry service and RabbitMQ (if available)
21
+ - 🎬 **Orchestrated Execution**: Manages multiple agents with proper timing
22
+ - 🧹 **Clean Shutdown**: Handles Ctrl+C gracefully, cleaning up all processes
23
+ - 📊 **Progress Feedback**: Shows what's happening and estimated duration
24
+ - 🔍 **Dependency Checking**: Warns about missing optional dependencies
25
+ - 🎯 **Multiple Scenarios**: Choose from different demo configurations
26
+
27
+ ## Available Scenarios
28
+
29
+ ### Basic (`-s basic`) - Default, ~10 seconds
30
+ - **Maxwell Agent86**: Service agent that responds to "hello world" requests
31
+ - **Chief Agent**: Client agent that discovers agents and sends requests
32
+ - **Demonstrates**: Basic agent-to-agent communication, discovery, request/response
33
+
34
+ ### Control (`-s control`) - ~15 seconds
35
+ - **Maxwell Agent86**: Service agent
36
+ - **Control Agent**: Hybrid agent that manages other agents using control messages
37
+ - **Demonstrates**: Control message system, agent management, pause/resume functionality
38
+
39
+ ### Watcher (`-s watcher`) - ~20 seconds
40
+ - **Agent Watcher**: Monitors directory for new agent files
41
+ - **Dynamic Loading**: Automatically loads and starts new agents
42
+ - **Demonstrates**: Runtime agent loading, file system monitoring
43
+
44
+ ### Security (`-s security`) - ~10 seconds ⚠️ Educational Only
45
+ - **Maxwell Agent86**: Service agent
46
+ - **KAOS Spy**: Malicious agent that demonstrates security vulnerabilities
47
+ - **Demonstrates**: Security considerations, agent registry vulnerabilities
48
+ - **Warning**: This shows attack patterns for educational purposes
49
+
50
+ ### All (`-s all`) - ~60 seconds
51
+ - Runs multiple scenarios in sequence (skips security for safety)
52
+ - **Demonstrates**: Full framework capabilities
53
+
54
+ ## Command Line Options
55
+
56
+ ```bash
57
+ ./run_demo.rb [options]
58
+
59
+ Options:
60
+ -s, --scenario SCENARIO Demo scenario to run (basic, control, watcher, security, all)
61
+ -l, --list List available scenarios
62
+ -v, --verbose Show detailed output from agents
63
+ --no-cleanup Keep processes running (for debugging)
64
+ -h, --help Show help message
65
+
66
+ Examples:
67
+ ./run_demo.rb # Run basic demo with default settings
68
+ ./run_demo.rb -s watcher -v # Run watcher demo with verbose output
69
+ ./run_demo.rb --list # List all available scenarios
70
+ ```
71
+
72
+ ## What You'll See
73
+
74
+ The demo runner shows:
75
+
76
+ 1. **🔍 Dependency Check**: Verifies required files exist, warns about optional dependencies
77
+ 2. **🏗️ Infrastructure Startup**: Registry service and RabbitMQ (if available)
78
+ 3. **🎬 Scenario Execution**: Agents starting, registering, communicating
79
+ 4. **📊 Progress Updates**: What's happening and time remaining
80
+ 5. **🧹 Clean Shutdown**: All processes terminated gracefully
81
+
82
+ ## Dependencies
83
+
84
+ ### Required (Bundled)
85
+ - Ruby 3.0+
86
+ - Agent99 framework (in parent directory)
87
+ - Example agent files
88
+
89
+ ### Optional (Enhanced Experience)
90
+ ```bash
91
+ # Message broker for production-like messaging
92
+ brew install rabbitmq-server
93
+
94
+ # Enhanced output formatting for Chief agent
95
+ brew install boxes
96
+ ```
97
+
98
+ **Note**: Demo works without optional dependencies using fallback implementations.
99
+
100
+ ## Troubleshooting
101
+
102
+ ### "Permission denied" error
103
+ ```bash
104
+ chmod +x run_demo.rb
105
+ ```
106
+
107
+ ### "No agents available" error
108
+ - Check that registry service started successfully
109
+ - Try running with `-v` flag to see detailed logs
110
+ - Ensure no other processes are using port 4567
111
+
112
+ ### RabbitMQ connection issues
113
+ - RabbitMQ is optional - demo works without it
114
+ - If installed but not starting: `brew services restart rabbitmq`
115
+ - Demo uses fallback message client if RabbitMQ unavailable
116
+
117
+ ### Ctrl+C doesn't stop everything
118
+ - Demo has signal handlers for graceful shutdown
119
+ - If processes persist: `./run_demo.rb --no-cleanup` then manually kill
120
+ - Check for zombie processes: `ps aux | grep ruby`
121
+
122
+ ## Architecture
123
+
124
+ The demo runner:
125
+
126
+ 1. **Validates Environment**: Checks for required files and optional dependencies
127
+ 2. **Starts Infrastructure**: Registry service (port 4567) and RabbitMQ if available
128
+ 3. **Orchestrates Agents**: Starts agents in proper sequence with timing
129
+ 4. **Monitors Execution**: Tracks agent processes and handles timeouts
130
+ 5. **Cleanup**: Terminates all spawned processes on completion or interrupt
131
+
132
+ ## Extending
133
+
134
+ To add new scenarios:
135
+
136
+ 1. Edit `SCENARIOS` hash in `run_demo.rb`
137
+ 2. Add agent files to `agents` array
138
+ 3. Specify duration and any special handling
139
+ 4. Update documentation
140
+
141
+ Example:
142
+ ```ruby
143
+ 'my_scenario' => {
144
+ description: 'My custom agent demonstration',
145
+ agents: ['my_agent1.rb', 'my_agent2.rb'],
146
+ duration: 15
147
+ }
148
+ ```